:root {
    --bg-dark: #030308;
    --bg-panel: rgba(20, 20, 35, 0.4);
    --primary: #6366f1;
    --primary-glow: #818cf8;
    --secondary: #06b6d4;
    --accent: #d946ef;

    --text-main: #f8fafc;
    --text-muted: #94a3b8;

    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shine: rgba(255, 255, 255, 0.03);

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Space Grotesk', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Ambient Background */
.ambient-light {
    display: none;
    position: fixed;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
    animation: float 20s infinite ease-in-out;
}

.ambient-light.one {
    top: -100px;
    left: -100px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
}

.ambient-light.two {
    bottom: -100px;
    right: -100px;
    background: radial-gradient(circle, rgba(217, 70, 239, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
    animation-delay: -10s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(50px, 30px);
    }
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* Header */
.glass-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    margin-top: 20px;
    background: rgba(10, 10, 20, 0.85);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    position: sticky;
    top: 20px;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1.5rem;
    letter-spacing: -0.01em;
    color: #ffffff;
}



.highlight {
    color: #ffffff;
}

.main-nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

.main-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    font-size: 0.95rem;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--text-main);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Nav dropdown */
.nav-dropdown { position:relative;display:inline-flex;align-items:center; }
.nav-dropdown-toggle { cursor:pointer;user-select:none; }
.nav-dropdown-menu {
    display:none;position:absolute;top:100%;left:0;padding-top:10px;
    z-index:100;
}
.nav-dropdown-menu::before {
    content:'';position:absolute;top:0;left:0;right:0;height:10px;
}
.nav-dropdown-menu > div {
    background:rgba(15,15,25,0.98);border:1px solid rgba(255,255,255,0.1);
    border-radius:10px;padding:6px 0;min-width:180px;
}
.nav-dropdown:hover .nav-dropdown-menu { display:block; }
.nav-dropdown-menu a {
    display:block !important;padding:8px 16px !important;color:#9ca3af !important;font-size:0.95rem !important;
    text-decoration:none;transition:all 0.15s;white-space:nowrap;font-weight:500;
}
.nav-dropdown-menu a:hover { color:var(--text-main) !important;background:rgba(255,255,255,0.04); }
.nav-dropdown-menu a.active { color:#818cf8 !important; }

/* Mobile hamburger menu */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 201;
}
.hamburger-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-main);
    margin: 5px 0;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.hamburger-btn.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger-btn.active span:nth-child(2) { opacity: 0; }
.hamburger-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 15, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 200;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
}
.mobile-menu-overlay.active {
    display: flex;
    flex-direction: column;
    opacity: 1;
}
.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mobile-menu-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}
.mobile-menu-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 0;
}
.mobile-menu-nav a {
    display: block;
    padding: 14px 0;
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 500;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: color 0.2s;
}
.mobile-menu-nav a:last-child { border-bottom: none; }
.mobile-menu-nav a:hover, .mobile-menu-nav a.active { color: var(--text-main); }
.mobile-menu-nav .mobile-nav-section {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.25);
    padding: 24px 0 8px;
    border-bottom: none;
}
.mobile-menu-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.mobile-menu-footer button {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--glass-shine);
    border-color: rgba(255, 255, 255, 0.2);
}



/* Hero Section */
.hero-section {
    padding: 100px 0 60px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 3.5vw, 2.4rem);
    line-height: 1.1;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -0.03em;
}

.gradient-text {
    color: var(--text-main);
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
}


.hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 600px;
    margin-bottom: 80px;
    line-height: 1.6;
}

/* Search Interface */
.glass-panel {
    background: var(--bg-panel);
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    border-radius: 20px;
}

.search-interface {
    width: 100%;
    max-width: 100%;
    padding: 30px;
    position: relative;
    overflow: hidden;
}

/* Subtle glow behind search */
.search-interface::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, rgba(0, 0, 0, 0) 70%);
    z-index: -1;
    display: none;
}

.search-container {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.input-wrapper {
    flex: 1;
    position: relative;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    transition: border-color 0.3s;
}

.input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

#keywordInput,
#auditInput {
    width: 100%;
    background: transparent;
    border: none;
    padding: 18px 18px 18px 50px;
    color: var(--text-main);
    font-size: 1.1rem;
    font-family: var(--font-body);
    outline: none;
}

#keywordInput::placeholder,
#auditInput::placeholder {
    color: rgba(148, 163, 184, 0.6);
}

.btn-primary {
    background: transparent;
    border: 1px solid rgba(139,92,246,0.3);
    border-radius: 8px;
    padding: 0 30px;
    color: #a78bfa;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    font-family: var(--font-body);
    transition: all 0.2s;
}

.btn-primary:hover {
    border-color: rgba(139,92,246,0.5);
    background: rgba(139,92,246,0.06);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-cta {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border: none;
    border-radius: 8px;
    padding: 0 30px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    font-family: var(--font-body);
    transition: all 0.2s;
}

.btn-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-cta:active {
    transform: scale(0.98);
}

.btn-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, rgba(0, 0, 0, 0) 60%);
    transform: scale(0);
    transition: transform 0.6s ease-out;
    opacity: 0;
}

.btn-primary:hover .btn-glow {
    transform: scale(1);
    opacity: 1;
    transition: transform 0.6s ease-out, opacity 0.6s ease-out;
}

/* Sourses Selector */
.sources-selector {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.selector-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.source-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.source-group {
    display: flex;
    gap: 10px;
}

.source-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: all 0.3s;
}

.source-checkbox:hover {
    background: rgba(255, 255, 255, 0.1);
}

.source-checkbox input {
    display: none;
}

.source-checkbox input:checked+.source-icon {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Style parent when checked (requires JS or :has support) - falling back to basic check */
.source-checkbox:has(input:checked) {
    background: rgba(99, 102, 241, 0.15);
    /* primary-glow 0.15 */
    border-color: var(--primary);
    color: var(--text-main);
}

.source-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    transition: all 0.3s;
}

.search-options {
    display: flex;
    justify-content: center;
    gap: 30px;
}

/* Custom Checkbox */
.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-muted);
    user-select: none;
    transition: color 0.2s;
}

.custom-checkbox:hover {
    color: var(--text-main);
}

.custom-checkbox input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 5px;
    position: relative;
    transition: all 0.2s;
}

.custom-checkbox input:checked+.checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.2s;
}

.custom-checkbox input:checked+.checkmark::after {
    opacity: 1;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 60px 0;
}

.feature-card {
    padding: 30px;
    transition: transform 0.3s, background 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    background: rgba(30, 30, 50, 0.5);
}

.icon-box {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.icon-box svg {
    width: 24px;
    height: 24px;
}

.icon-box.purple {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-glow);
}

.icon-box.cyan {
    background: rgba(6, 182, 212, 0.1);
    color: var(--secondary);
}

.icon-box.blue {
    background: rgba(56, 189, 248, 0.1);
    color: #38bdf8;
}

.feature-card h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    margin-bottom: 10px;
}

.feature-card p {
    color: var(--text-muted);
    line-height: 1.5;
    font-size: 0.95rem;
}

footer {
    text-align: center;
    padding: 40px 0;
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
    border-top: 1px solid var(--glass-border);
    margin-top: 40px;
}

/* Responsive */
@media (max-width: 768px) {
    .glass-header {
        flex-direction: row;
        gap: 0;
        position: sticky;
        top: 10px;
        padding: 14px 18px;
        margin-top: 10px;
    }

    .main-nav {
        display: none;
    }

    .user-profile {
        display: none;
    }

    .hamburger-btn {
        display: block;
    }

    .hero-section {
        padding: 60px 0 40px;
    }

    .hero-title {
        font-size: 1.6rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 30px;
    }

    .search-interface {
        padding: 20px;
    }

    .search-container {
        flex-direction: column;
    }

    .btn-primary {
        padding: 15px;
        width: 100%;
    }

    .source-options {
        gap: 8px;
    }

    .source-checkbox {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .source-group {
        width: 100%;
        justify-content: center;
    }

    .search-options {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 40px 0;
    }

    .section-header h2 {
        font-size: 1.8rem;
    }

    /* Table mobile: horizontal scroll wrapper */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table {
        min-width: 600px;
        table-layout: auto !important;
    }

    .data-table th:nth-child(1),
    .data-table td:nth-child(1) {
        width: auto !important;
        max-width: none !important;
        min-width: 200px;
    }

    .data-table th,
    .data-table td {
        padding: 14px 8px !important;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .results-title-row h2 {
        font-size: 1.5rem;
    }

    .user-profile .btn-secondary {
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    footer {
        padding: 25px 0;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .app-container {
        padding: 0 12px;
    }

    .hero-title {
        font-size: 1.4rem;
    }

    .glass-header {
        padding: 12px 15px;
        border-radius: 12px;
    }

    .search-interface {
        padding: 15px;
        border-radius: 14px;
    }

    .source-checkbox {
        padding: 5px 10px;
        font-size: 0.75rem;
    }

    .source-icon {
        width: 16px;
        height: 16px;
        font-size: 0.55rem;
    }

    .keyword-cell {
        gap: 6px;
    }

    .keyword-rank {
        min-width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }
}

/* Results Section */
.results-preview {
    max-width: 1200px;
    margin: 100px auto 60px;
    padding: 0 20px;
}

.section-header {
    text-align: center;
    margin-bottom: 30px;
}

.section-header h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.section-header p {
    color: var(--text-muted);
}

.table-container {
    overflow-x: auto;
    padding: 0;
    /* Override glass-panel padding */
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-family: var(--font-body);
    font-size: 0.95rem;
}

.data-table th,
.data-table td {
    padding: 18px 25px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.data-table th {
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.data-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.keyword-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
    font-weight: 500;
}

.keyword-cell .icon {
    font-size: 0.9em;
    opacity: 0.7;
}

/* Badges */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.badge.commercial {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge.transactional {
    background: rgba(217, 70, 239, 0.15);
    color: #f0abfc;
    border: 1px solid rgba(217, 70, 239, 0.3);
}

.badge.info {
    background: rgba(6, 182, 212, 0.15);
    color: #67e8f9;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

/* Popularity Badges */
.pop-badge {
    font-weight: 700;
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 8px;
    letter-spacing: 0.02em;
}

.pop-badge.fire {
    color: #f59e0b;
    /* Gold/Orange */
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.1);
}

.pop-badge.high {
    color: #10b981;
    /* Green */
}

.pop-badge.med {
    color: #fbbf24;
    /* Yellow */
}

.pop-badge.low {
    color: var(--text-muted);
    /* Gray */
    font-weight: 500;
}

/* Source Tags */
.source-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.source-tag.google {
    background: rgba(66, 133, 244, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(66, 133, 244, 0.3);
}

.source-tag.youtube {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.source-icon.wiki {
    font-family: 'Times New Roman', serif;
}
.source-icon.alphabetsoup {
    font-size: 0.55rem;
}

/* ========================================
   KEYWORD RESEARCH RESULTS STYLES
   ======================================== */

/* Loading Section */
.loading-section {
    margin: 40px 0;
    animation: fadeIn 0.3s ease-in;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto;
    border: 4px solid rgba(167, 139, 250, 0.2);
    border-top: 4px solid #a78bfa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* Error Section */
.error-section {
    margin: 40px 0;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

/* Results Section */
.results-section {
    margin: 60px 0;
    animation: fadeIn 0.5s ease-in;
}

.results-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.results-actions {
    display: flex;
    gap: 10px;
}

/* Results Table Enhancements */
.data-table tbody tr {
    cursor: pointer;
    transition: all 0.2s ease;
}

.data-table tbody tr:hover {
    background: rgba(139, 92, 246, 0.1);
    transform: scale(1.01);
}

/* Keyword Cell with Ranking */
.keyword-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.keyword-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    padding: 0 8px;
}

.keyword-text {
    flex: 1;
    font-weight: 500;
    line-height: 1.4;
    word-break: break-word;
}

/* Source Badge */
.source-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid rgba(99, 102, 241, 0.3);
    white-space: nowrap;
}

/* Intent Badge */
.intent-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Popularity Badges */
.popularity-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.popularity-badge.top {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.popularity-badge.high {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.popularity-badge.medium {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.4);
}

.popularity-badge.low {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.4);
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .results-section .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .keyword-cell {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* ========================================
   WIDTH ALIGNMENT
   ======================================== */

/* Выравниваем все секции по ширине search-interface */
.results-section,
.features-grid {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

/* Убеждаемся что search-interface тоже той же ширины */
.search-interface {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Table container на всю ширину секции */
.results-section .table-container {
    width: 100%;
}

/* Results section spacing */
.results-section {
    margin-top: 60px;
    margin-bottom: 60px;
    padding: 0;
}

/* Features grid spacing */
.features-grid {
    margin-top: 80px;
    margin-bottom: 80px;
    padding: 0;
}

/* Live trends spacing (merged into main .results-preview) */

/* Source badge fix - keep on one line */
/* Source badge fix - keep on one line (merged above) */

/* Circle-letter icons inside source badges (matching form source-icon unchecked style) */
.source-icon-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.1);
    color: inherit;
    vertical-align: middle;
}
.source-icon-inline.alphabetsoup { font-size: 0.55rem; }
.source-icon-inline.wiki { font-family: 'Times New Roman', serif; }

/* Table cell for source - prevent wrapping */
.data-table td:nth-child(2) {
    white-space: nowrap;
}

/* ========================================
   RESULTS HEADER WITH FILTER
   ======================================== */

/* Section header layout */
.results-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
}

.results-header-left {
    flex: 0 0 auto;
}

.results-section .section-header h2 {
    flex: 1 1 auto;
    text-align: center;
    margin: 0;
}

.results-actions {
    flex: 0 0 auto;
}

/* Intent filter dropdown */
.intent-filter-dropdown {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 8px;
    color: #e2e8f0;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    min-width: 180px;
}

.intent-filter-dropdown:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.5);
}

.intent-filter-dropdown:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.intent-filter-dropdown option {
    background: #1e293b;
    color: #e2e8f0;
    padding: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .results-section .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .results-section .section-header h2 {
        text-align: left;
        order: -1;
    }

    .results-header-left {
        width: 100%;
    }

    .intent-filter-dropdown {
        width: 100%;
    }
}

/* ========================================
   RESULTS LAYOUT FIX - Title on top
   ======================================== */

/* Title row - centered above */
.results-title-row {
    text-align: center;
    margin-bottom: 20px;
}

.results-title-row h2 {
    margin: 0;
    font-size: 32px;
}

/* Controls row - filter left, export right */
.results-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
}

/* Remove focus outline from dropdown */
.intent-filter-dropdown:focus {
    border-color: rgba(99, 102, 241, 0.3);
    /* Убрана голубая подсветка */
    box-shadow: none;
    /* Убрана тень */
    outline: none;
}

/* Override previous styles */
.results-section .section-header {
    display: none !important;
    /* Скрываем старый header */
}

@media (max-width: 768px) {
    .results-controls-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .results-header-left,
    .results-actions {
        width: 100%;
    }

    .intent-filter-dropdown {
        width: 100%;
    }
}

/* ========================================
   TABLE COLUMNS WIDTH FIX - More space for right columns
   ======================================== */

/* Column widths for keyword research table (must sum to ~100% with table-layout:fixed) */
.data-table th:nth-child(1),
.data-table td:nth-child(1) {
    width: 52% !important;
    padding-left: 14px !important;
}

.data-table th:nth-child(2),
.data-table td:nth-child(2) {
    width: 11% !important;
    white-space: nowrap !important;
    text-align: center !important;
}

.data-table th:nth-child(3),
.data-table td:nth-child(3) {
    width: 11% !important;
    white-space: nowrap !important;
    text-align: center !important;
}

.data-table th:nth-child(4),
.data-table td:nth-child(4) {
    width: 13% !important;
    white-space: nowrap !important;
    text-align: center !important;
}

.data-table th:nth-child(5),
.data-table td:nth-child(5) {
    width: 8% !important;
    text-align: center !important;
    white-space: nowrap !important;
}

.data-table th:nth-child(6),
.data-table td:nth-child(6) {
    width: 5% !important;
    text-align: center !important;
    padding-right: 14px !important;
    padding-left: 0 !important;
}

/* General cell padding */
.data-table th,
.data-table td {
    padding: 18px 6px !important;
}

/* ========================================
   ACTION LINK STYLE (from link-quality)
   ======================================== */

.action-link {
    color: var(--text-muted, #94a3b8);
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
}

.action-link:hover {
    color: var(--primary-glow, #a78bfa);
}

.dropdown-arrow {
    font-size: 0.65rem;
    margin-left: 1px;
    opacity: 0.7;
    display: inline-block;
    transform: scaleX(1.4);
    position: relative;
    top: 2px;
}

/* Filter dropdown menu */
.results-header-left {
    position: relative;
}

.filter-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    padding: 8px 0;
    min-width: 180px;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.filter-option {
    padding: 10px 16px;
    cursor: pointer;
    color: #e2e8f0;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.filter-option:hover {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

.filter-option.active {
    background: rgba(139, 92, 246, 0.3);
    color: #a78bfa;
    font-weight: 600;
}
/* Pagination */
.pagination-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #e2e8f0;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
    min-width: 36px;
    text-align: center;
}
.pagination-btn:hover:not(:disabled) {
    background: rgba(139,92,246,0.15);
    border-color: rgba(139,92,246,0.4);
}
.pagination-btn.active {
    background: rgba(139,92,246,0.25);
    border-color: #8b5cf6;
    color: #a78bfa;
    font-weight: 600;
}
.pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.delete-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #ef4444;
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: var(--font-body);
    transition: all 0.2s;
}
.delete-btn:hover {
    background: rgba(239, 68, 68, 0.18);
    border-color: #f87171;
}

/* ═══ Unified action button ═══ */
.run-btn {
    width: 100%;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    border: none;
    padding: 18px 40px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    font-family: var(--font-body);
    transition: all 0.2s;
    margin-top: 10px;
}
.run-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}
.run-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
