/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e5e7eb;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: #1f2937;
}

.logo-icon {
    font-size: 1.5rem;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: #6b7280;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #3b82f6;
}

/* Hero Section */
.hero {
    padding: 8rem 0 4rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.gradient-text {
    background: linear-gradient(45deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 3rem;
    opacity: 0.9;
    line-height: 1.6;
}

/* Tool Container */
.tool-container {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    color: #333;
    margin-bottom: 2rem;
}

/* Search Box */
.search-box {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

#keywordInput {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f9fafb;
}

#keywordInput:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: white;
}

.search-btn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-width: 160px;
}

.search-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

.search-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-text {
    display: inline-block;
}

.btn-loading {
    display: none;
    align-items: center;
    gap: 0.5rem;
}

.search-btn.loading .btn-text {
    display: none;
}

.search-btn.loading .btn-loading {
    display: flex;
}

/* Spinner */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Results Container */
.results-container {
    min-height: 60px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.results-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
}

.export-btn {
    padding: 0.5rem 1rem;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.export-btn:hover {
    background: #059669;
}

.results-list {
    display: grid;
    gap: 0.75rem;
}

.result-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.result-item:hover {
    background: #f3f4f6;
    transform: translateX(4px);
}

.keyword-text {
    font-weight: 500;
    color: #1f2937;
}

.trend-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 120px;
}

.bar-container {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #3b82f6);
    border-radius: 4px;
    transition: width 0.8s ease;
}

.trend-value {
    font-size: 0.875rem;
    color: #6b7280;
    min-width: 30px;
}

.search-volume {
    font-weight: 600;
    color: #1f2937;
    text-align: right;
    min-width: 80px;
}

/* Simple One-Row Layout */
.table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.2fr 1fr;
    gap: 1rem;
    padding: 1rem;
    background: #f3f4f6;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
}

.header-cell {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.help-text {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 400;
}

.result-item.simple {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.2fr 1fr;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.result-item.simple:hover {
    background: #f3f4f6;
    transform: translateX(4px);
}

.competition-cell {
    display: flex;
    justify-content: center;
}

.competition-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    min-width: 60px;
    text-align: center;
}

.trend-cell {
    display: flex;
    align-items: center;
    justify-content: center;
}

.volume-cell {
    font-weight: 600;
    color: #1f2937;
    text-align: center;
}

.bid-cell {
    font-weight: 600;
    color: #059669;
    font-size: 0.875rem;
    text-align: center;
}

.data-explanation {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f0f9ff;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
}

.data-explanation h4 {
    margin: 0 0 1rem 0;
    color: #1f2937;
    font-size: 1rem;
}

.data-explanation p {
    margin: 0.5rem 0;
    color: #4b5563;
    font-size: 0.875rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .table-header, .result-item.simple {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .table-header {
        display: none; /* Hide headers on mobile */
    }
    
    .result-item.simple {
        padding: 1rem;
        text-align: center;
    }
    
    .result-item.simple > div {
        margin-bottom: 0.5rem;
    }
    
    .result-item.simple > div:before {
        content: attr(data-label);
        font-weight: 600;
        display: block;
        margin-bottom: 0.25rem;
        color: #6b7280;
        font-size: 0.75rem;
    }
}

/* OAuth2 Authentication */
.auth-section {
    margin: 1.5rem 0;
    text-align: center;
}

.auth-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: #f0f9ff;
    border-radius: 8px;
    border: 1px solid #bfdbfe;
}

.auth-text {
    color: #1e40af;
    font-weight: 500;
    font-size: 0.875rem;
}

.connect-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.connect-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.connect-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.auth-status.connected {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.auth-status.connected .auth-text {
    color: #15803d;
}

.auth-status.connected .connect-btn {
    background: #dc2626;
}

.auth-status.connected .connect-btn:hover {
    background: #b91c1c;
}

.btn-icon {
    font-size: 1rem;
}

/* Usage Info */
.usage-info {
    text-align: center;
    margin-top: 1rem;
    color: #6b7280;
    font-size: 0.875rem;
}

/* Error State */
.error-message {
    background: #fee2e2;
    color: #dc2626;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    margin: 1rem 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    color: #6b7280;
    padding: 2rem;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Features Section */
.features {
    padding: 6rem 0;
    background: #f9fafb;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: #1f2937;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1f2937;
}

.feature-card p {
    color: #6b7280;
    line-height: 1.6;
}

/* How It Works */
.how-it-works {
    padding: 6rem 0;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-top: 3rem;
}

.step {
    text-align: center;
}

.step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.step h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.step p {
    color: #6b7280;
}

/* Pricing */
.pricing {
    padding: 6rem 0;
    background: #f9fafb;
}

.pricing-card {
    max-width: 400px;
    margin: 0 auto;
    background: white;
    padding: 3rem 2rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.price {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.currency {
    font-size: 2rem;
    font-weight: 600;
    color: #6b7280;
}

.amount {
    font-size: 4rem;
    font-weight: 700;
    color: #1f2937;
}

.period {
    font-size: 1.25rem;
    color: #6b7280;
}

.plan-features {
    margin-bottom: 2rem;
}

.feature {
    padding: 0.5rem 0;
    color: #374151;
}

.cta-btn {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

.trial-note {
    margin-top: 1rem;
    color: #6b7280;
    font-size: 0.875rem;
}

/* FAQ */
.faq {
    padding: 6rem 0;
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid #e5e7eb;
    padding: 1.5rem 0;
}

.faq-question {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.faq-answer {
    color: #6b7280;
    line-height: 1.6;
}

/* Footer */
.footer {
    background: #1f2937;
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 2rem;
}

.footer-left p {
    margin-top: 0.5rem;
    color: #9ca3af;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #374151;
    color: #9ca3af;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav {
        gap: 1rem;
    }
    
    .hero {
        padding: 6rem 0 3rem;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .search-btn {
        width: 100%;
    }
    
    .result-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        text-align: center;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
    }
}

/* Keyword Suggestions Styles */
.suggestions-container {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    margin: 1.5rem 0;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.suggestions-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.suggestions-header:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
}

.suggestions-icon {
    font-size: 1.25rem;
}

.suggestions-title {
    flex: 1;
    font-weight: 600;
    font-size: 1.1rem;
}

.toggle-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.suggestions-content {
    padding: 0.75rem;
    display: none;
}

.suggestions-content.expanded {
    display: block;
}

/* New Clean Suggestions List */
.suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.suggestion-item-clean {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.suggestion-item-clean:hover {
    background: #f8fafc;
    border-left-color: #3b82f6;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.suggestion-keyword {
    font-size: 1rem;
    font-weight: 500;
    color: #1f2937;
    flex: 1;
}

.suggestion-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
    white-space: nowrap;
}

.suggestions-footer {
    text-align: center;
    padding: 1rem;
    border-top: 1px solid #e5e7eb;
    margin-top: 0.5rem;
    color: #6b7280;
    font-size: 0.875rem;
}


/* Loading state for suggestions */
.suggestions-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #6b7280;
    font-size: 0.95rem;
}

.suggestions-loading .spinner {
    width: 20px;
    height: 20px;
    margin-right: 0.5rem;
}

/* Error state for suggestions */
.suggestions-error {
    padding: 1.5rem;
    text-align: center;
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    margin: 1rem;
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .tool-container {
        padding: 1.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .suggestions-header {
        padding: 0.875rem 1rem;
    }
    
    .suggestions-title {
        font-size: 1rem;
    }
    
    .suggestion-item-clean {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.75rem;
    }
    
    .suggestion-tag {
        align-self: flex-end;
    }
}