:root {
    --bg-dark: #0f1115;
    --bg-card: #161b22;
    --text-main: #e6edf3;
    --text-muted: #8b949e;
    --primary: #2f81f7;
    --primary-hover: #58a6ff;
    --accent: #a371f7;
    --success: #3fb950;
    --warning: #d29922;
    --danger: #f85149;
    --border: #30363d;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    /* Gradients */
    --gradient-hero: linear-gradient(135deg, #2f81f7 0%, #a371f7 100%);
    --gradient-glow: radial-gradient(circle at 50% 0%, rgba(56, 139, 253, 0.15) 0%, rgba(9, 9, 11, 0) 50%);
}

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

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

/* Background Effects */
.bg-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--gradient-glow);
    z-index: -2;
    pointer-events: none;
}

.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-image: 
        linear-gradient(to right, #30363d1a 1px, transparent 1px),
        linear-gradient(to bottom, #30363d1a 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
    z-index: -1;
    pointer-events: none;
}

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

/* Typography */
h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 1rem;
    text-align: center;
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.gradient-text {
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subhead {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 3rem;
}

/* Header */
header {
    padding: 20px 0;
    margin-bottom: 40px;
}

.logo {
    font-weight: 700;
    font-size: 2rem;
}

.logo .highlight {
    color: var(--primary);
}

/* Hero Features */
.features-grid {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.feature-item {
    background: rgba(48, 54, 61, 0.4);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Mini Example */
.mini-example {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 4rem;
}

.example-pill {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.example-pill .kw { color: var(--text-main); font-weight: 500; }
.example-pill .arrow { color: var(--text-muted); }
.example-pill .res { font-weight: 600; }
.example-pill.buyer .res { color: var(--primary); }
.example-pill.buyer-local .res { color: var(--success); }
.example-pill.research .res { color: var(--warning); }

/* Tool Interface */
.card-glass {
    background: rgba(22, 27, 34, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    margin-bottom: 2rem;
}

.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.cta-micro {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

textarea {
    width: 100%;
    height: 250px;
    background: #0d1117;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    color: var(--text-main);
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.95rem;
    resize: vertical;
    margin-bottom: 1.5rem;
    transition: border-color 0.2s;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(47, 129, 247, 0.1);
}

/* Toggle Switch */
.toggle-switch {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
}

.toggle-switch input {
    display: none;
}

.toggle-switch .slider {
    position: relative;
    width: 36px;
    height: 20px;
    background-color: var(--border);
    border-radius: 20px;
    margin-right: 10px;
    transition: .3s;
}

.toggle-switch .slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: .3s;
}

.toggle-switch input:checked + .slider {
    background-color: var(--success);
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(16px);
}

/* Buttons */
.action-bar {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    align-items: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    border-color: var(--text-muted);
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: underline;
}

.btn-text:hover {
    color: var(--primary);
}

/* Promo Ad (shows with results) */
.promo-ad {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(47, 129, 247, 0.12) 0%, rgba(163, 113, 247, 0.10) 100%);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.promo-copy {
    min-width: 220px;
    flex: 1;
}

.promo-kicker {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.promo-title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.35rem;
    color: var(--text-main);
}

.promo-sub {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.promo-cta {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* Mobile */
@media (max-width: 720px) {
    .promo-ad {
        flex-direction: column;
        align-items: flex-start;
    }

    .promo-cta {
        width: 100%;
    }

    .promo-cta .btn-primary {
        width: 100%;
        text-align: center;
    }
}

/* Results Table */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.table-wrapper {
    overflow-x: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 3rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: rgba(48, 54, 61, 0.5);
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

th:hover {
    color: var(--text-main);
}

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

/* Badges */
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

.badge-buyer { background: rgba(63, 185, 80, 0.15); color: var(--success); }
.badge-mixed { background: rgba(210, 153, 34, 0.15); color: var(--warning); }
.badge-research { background: rgba(48, 54, 61, 0.5); color: var(--text-muted); }

/* FAQ */
.faq-accordion {
    margin-top: 4rem;
    margin-bottom: 4rem;
}

.accordion-item {
    border-bottom: 1px solid var(--border);
}

.accordion-header {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 500;
    padding: 1.5rem 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
}

.accordion-header:after {
    content: '+';
    font-size: 1.5rem;
    font-weight: 300;
}

.accordion-item.active .accordion-header:after {
    content: '-';
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    color: var(--text-muted);
}

.accordion-content p {
    margin-bottom: 1rem;
}

.accordion-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.accordion-item.active .accordion-content {
    max-height: 500px;
}

.hidden {
    display: none;
}

footer {
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

#results-section {
    animation: fadeIn 0.4s ease-out;
}
