/* Brainwave - Dark Theme Styles */
/* Designed to complement Tailwind CSS */

:root {
    --color-primary: #818cf8;
    --color-primary-hover: #6366f1;
    --color-primary-dim: rgba(129, 140, 248, 0.15);
    --color-accent: #a78bfa;
    --color-bg: #0a0e1a;
    --color-bg-secondary: #0f1424;
    --color-bg-tertiary: #151a2e;
    --color-surface: #111827;
    --color-border: rgba(255, 255, 255, 0.08);
    --color-border-hover: rgba(255, 255, 255, 0.15);
    --color-text: #e2e8f0;
    --color-text-secondary: #94a3b8;
    --color-text-muted: #64748b;
    --color-text-heading: #f1f5f9;
    --color-success: #34d399;
    --color-warning: #fbbf24;
    --color-error: #f87171;
    --wave-color: 129, 140, 248;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.4);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --nav-bg: rgba(10, 14, 26, 0.8);
    --grain-opacity: 0.035;
    --scrollbar-thumb: rgba(255, 255, 255, 0.1);
    --scrollbar-thumb-hover: rgba(255, 255, 255, 0.2);
}

/* Light theme overrides */
html[data-theme="light"] {
    --color-primary: #6366f1;
    --color-primary-hover: #4f46e5;
    --color-primary-dim: rgba(99, 102, 241, 0.12);
    --color-accent: #7c3aed;
    --color-bg: #ffffff;
    --color-bg-secondary: #f9fafb;
    --color-bg-tertiary: #f3f4f6;
    --color-surface: #ffffff;
    --color-border: #e5e7eb;
    --color-border-hover: #d1d5db;
    --color-text: #111827;
    --color-text-secondary: #6b7280;
    --color-text-muted: #9ca3af;
    --color-text-heading: #111827;
    --color-success: #059669;
    --color-warning: #d97706;
    --color-error: #dc2626;
    --wave-color: 99, 102, 241;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --nav-bg: rgba(255, 255, 255, 0.85);
    --grain-opacity: 0.015;
    --scrollbar-thumb: rgba(0, 0, 0, 0.12);
    --scrollbar-thumb-hover: rgba(0, 0, 0, 0.2);
}

/* NEW badge */
.new-badge {
    border: 1px solid var(--color-primary-dim);
    background: var(--color-primary-dim);
    color: var(--color-text-secondary);
    transition: all var(--transition-base);
    text-decoration: none;
    animation: badge-glow 2s ease-in-out infinite alternate;
}
.new-badge:hover {
    border-color: var(--color-primary);
    background: rgba(129, 140, 248, 0.2);
    color: var(--color-text);
}
.new-badge-tag {
    background: var(--color-primary);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}
html[data-theme="light"] .new-badge-tag {
    background: var(--color-primary);
    color: #fff;
}
@keyframes badge-glow {
    from { box-shadow: 0 0 6px rgba(129, 140, 248, 0.15); }
    to   { box-shadow: 0 0 16px rgba(129, 140, 248, 0.35); }
}

/* Product Hunt logo: show orange icon in dark, horizontal in light */
.ph-logo-light { display: none; }
.ph-logo-dark  { display: inline-block; }
html[data-theme="light"] .ph-logo-light { display: inline-block; }
html[data-theme="light"] .ph-logo-dark  { display: none; }

/* Crunchbase logo: white in dark theme, original dark in light theme */
.crunchbase-logo { fill: #ffffff; }
html[data-theme="light"] .crunchbase-logo { fill: #146aff; }

/* Base resets */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    transition: background-color 0.3s, color 0.3s;
}

/* SVG noise grain overlay */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: var(--grain-opacity);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.025em;
    color: var(--color-text-heading);
}

/* Custom animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Character reveal animation */
@keyframes charReveal {
    from {
        opacity: 0;
        transform: translateY(8px);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* Scroll reveal animation */
@keyframes scrollReveal {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Neural shimmer gradient */
@keyframes neuralShimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* Neural pulse outward */
@keyframes neuralPulse {
    0% { opacity: 0.15; transform: scaleX(1); }
    50% { opacity: 0.6; transform: scaleX(1.05); }
    100% { opacity: 0.15; transform: scaleX(1); }
}

/* Radar sweep */
@keyframes radarSweep {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Status dot glow pulse */
@keyframes statusGlow {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 4px var(--color-success), 0 0 8px var(--color-success);
    }
    50% {
        opacity: 0.7;
        box-shadow: 0 0 2px var(--color-success), 0 0 4px var(--color-success);
    }
}

/* Result card enhanced entrance */
@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Ripple effect */
@keyframes ripple {
    from {
        transform: scale(0);
        opacity: 0.4;
    }
    to {
        transform: scale(2.5);
        opacity: 0;
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

.animate-fade-in-up {
    animation: fadeInUp 0.4s ease-out both;
}

.animate-slide-in {
    animation: slideIn 0.5s ease-out;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Scroll reveal */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
}

.scroll-reveal.revealed {
    animation: scrollReveal 0.6s ease-out forwards;
}

/* Character reveal spans */
.char-reveal span {
    display: inline-block;
    opacity: 0;
    animation: charReveal 0.4s ease-out forwards;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-bg-tertiary) 25%,
        var(--color-bg-secondary) 50%,
        var(--color-bg-tertiary) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.375rem;
}

/* Spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-small {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

/* Card hover lift effect */
.card-hover {
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(129, 140, 248, 0.1);
    border-color: rgba(129, 140, 248, 0.3);
}

/* Result card styles */
.result-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all var(--transition-base);
    animation: cardEntrance 0.4s ease-out both;
}

.result-card:hover {
    border-color: var(--color-border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Score badge styles */
.score-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.score-high {
    background-color: rgba(52, 211, 153, 0.15);
    color: #34d399;
}

.score-medium {
    background-color: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.score-low {
    background-color: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
}

/* Search input focus ring */
.search-input {
    background: var(--color-surface);
    border-color: var(--color-border);
    color: var(--color-text);
}

.search-input::placeholder {
    color: var(--color-text-muted);
}

.search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
}

/* Button styles */
.btn-primary {
    background-color: var(--color-primary);
    color: #0a0e1a;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(129, 140, 248, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Ripple on btn-primary */
.btn-primary .ripple {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, transparent 70%);
    width: 100px;
    height: 100px;
    margin-top: -50px;
    margin-left: -50px;
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}

.btn-secondary {
    background-color: var(--color-surface);
    color: var(--color-text);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--color-border);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background-color: var(--color-bg-tertiary);
    border-color: var(--color-border-hover);
}

/* Quick search chips */
.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    background-color: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 9999px;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chip:hover {
    background-color: var(--color-bg-tertiary);
    border-color: rgba(129, 140, 248, 0.3);
    color: var(--color-text);
    box-shadow: 0 0 8px rgba(129, 140, 248, 0.1);
}

/* Navigation styles */
.nav-link {
    color: var(--color-text-secondary);
    font-weight: 500;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--color-text);
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: var(--color-primary);
}

/* Alert badge */
.alert-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background-color: var(--color-error);
    color: white;
    font-size: 0.625rem;
    font-weight: 600;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Latency display */
.latency-badge {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    background-color: var(--color-surface);
    color: var(--color-text-secondary);
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    backdrop-filter: blur(4px);
    border: 1px solid var(--color-border);
    z-index: 50;
}

/* Status indicator */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--color-success);
    animation: statusGlow 2s ease-in-out infinite;
}

/* Scrollbar styles */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--scrollbar-thumb-hover);
}

/* Auth modal styles */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    transition: transform var(--transition-base);
}

.modal-backdrop.active .modal-content {
    transform: scale(1);
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 4rem;
    right: 1rem;
    background-color: var(--color-surface);
    color: var(--color-text);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
    z-index: 200;
    transform: translateY(100px);
    opacity: 0;
    transition: all var(--transition-base);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-secondary);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    color: var(--color-text-muted);
}

/* Logo invert for dark theme */
#logo {
    filter: invert(1);
}

/* Canvas brainwave background */
#brainwave-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Hero glow orbs */
.hero-glow {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    will-change: transform;
}

.hero-glow-1 {
    width: 500px;
    height: 500px;
    top: -100px;
    left: 50%;
    transform: translateX(-70%);
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
}

.hero-glow-2 {
    width: 400px;
    height: 400px;
    top: 0;
    left: 50%;
    transform: translateX(-20%);
    background: radial-gradient(circle, rgba(139, 92, 246, 0.12) 0%, transparent 70%);
}

/* Neural network search wrapper */
.search-neural-wrap {
    position: relative;
}

.neural-line {
    position: absolute;
    height: 1px;
    transform-origin: left center;
    opacity: 0.08;
    background: linear-gradient(90deg, var(--color-primary), transparent);
    background-size: 200% 100%;
    animation: neuralShimmer 3s ease-in-out infinite;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.neural-node {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--color-primary);
    opacity: 0.15;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

/* Focus state */
.neural-focused .neural-line {
    opacity: 0.25;
}

.neural-focused .neural-node {
    opacity: 0.4;
}

.neural-focused .search-glow {
    opacity: 1;
}

/* Search glow behind input */
.search-glow {
    position: absolute;
    inset: -2px;
    border-radius: 0.85rem;
    background: linear-gradient(135deg, rgba(129, 140, 248, 0.15), rgba(139, 92, 246, 0.1));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
    filter: blur(8px);
}

/* Searching state */
.neural-searching .neural-line {
    animation: neuralPulse 1s ease-in-out infinite;
}

.neural-searching .neural-node {
    opacity: 0.5;
}

.neural-searching .radar-sweep {
    opacity: 1;
}

/* Radar sweep */
.radar-sweep {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0%, rgba(129, 140, 248, 0.08) 10%, transparent 20%);
    animation: radarSweep 2s linear infinite;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: -1;
}

/* Dashboard specific */
.idea-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    padding: 1.25rem;
    transition: all var(--transition-base);
}

.idea-card:hover {
    border-color: var(--color-border-hover);
}

/* Theme-adaptive helper classes */
.nav-bg {
    background-color: var(--nav-bg);
    transition: background-color 0.3s;
}

.section-alt {
    background-color: var(--color-bg-secondary);
    transition: background-color 0.3s;
}

.surface-card {
    background-color: var(--color-surface);
    border-color: var(--color-border);
    transition: background-color 0.3s, border-color 0.3s;
}

.border-themed {
    border-color: var(--color-border);
    transition: border-color 0.3s;
}

.text-heading {
    color: var(--color-text-heading);
}

.text-body {
    color: var(--color-text);
}

.text-secondary {
    color: var(--color-text-secondary);
}

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

/* Theme toggle button */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 9999px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 0;
    flex-shrink: 0;
}

.theme-toggle:hover {
    border-color: var(--color-border-hover);
    color: var(--color-text);
    background: var(--color-bg-tertiary);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon { display: none; }

/* Dark (default): show sun icon to switch to light */
.theme-toggle .icon-sun { display: block; }
.theme-toggle .icon-moon { display: none; }

html[data-theme="light"] .theme-toggle .icon-sun { display: none; }
html[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* Light theme: logo does not need invert */
html[data-theme="light"] #logo {
    filter: none;
}

/* Light theme: glow orbs use softer colors */
html[data-theme="light"] .hero-glow-1 {
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
}

html[data-theme="light"] .hero-glow-2 {
    background: radial-gradient(circle, rgba(139, 92, 246, 0.06) 0%, transparent 70%);
}

/* Light theme: nav-link hover */
html[data-theme="light"] .nav-link:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

/* Light theme: card hover glow uses indigo instead of white-blue */
html[data-theme="light"] .card-hover:hover {
    box-shadow: var(--shadow-lg), 0 0 20px rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.25);
}

/* Light theme: chip hover */
html[data-theme="light"] .chip:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.08);
}

/* Light theme: search input focus ring */
html[data-theme="light"] .search-input:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

/* Light theme: btn-primary text */
html[data-theme="light"] .btn-primary {
    color: #ffffff;
}

/* Light theme: search input border */
html[data-theme="light"] .search-input {
    border-color: var(--color-border);
}

/* Mobile responsive utilities */
@media (max-width: 640px) {
    .hide-mobile {
        display: none !important;
    }

    .hero-glow-1 {
        width: 300px;
        height: 300px;
    }

    .hero-glow-2 {
        width: 250px;
        height: 250px;
    }
}

@media (min-width: 641px) {
    .hide-desktop {
        display: none !important;
    }
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .scroll-reveal {
        opacity: 1;
        transform: none;
    }

    .char-reveal span {
        opacity: 1;
        transform: none;
        filter: none;
    }

    #brainwave-canvas {
        display: none;
    }

    .hero-glow {
        display: none;
    }

    .neural-line, .neural-node, .radar-sweep, .search-glow {
        display: none;
    }

    body::after {
        display: none;
    }
}

/* ============================================
   Deep Research Styles
   ============================================ */

/* Tab buttons */
.tab-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-text-muted);
    border-bottom: 2px solid transparent;
    background: none;
    border-left: none;
    border-right: none;
    border-top: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

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

.tab-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* Score circle using conic-gradient */
.score-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: conic-gradient(
        var(--score-color, var(--color-primary)) calc(var(--score, 0) * 1%),
        var(--color-border) calc(var(--score, 0) * 1%)
    );
    position: relative;
}

.score-circle::before {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: var(--color-surface);
}

.score-value {
    position: relative;
    z-index: 1;
}

/* Thread items */
.thread-item {
    padding: 0.375rem 0;
    border-bottom: 1px solid var(--color-border);
}

.thread-item:last-child {
    border-bottom: none;
}

.thread-icon {
    width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Competitor table */
.competitor-table {
    border-collapse: collapse;
}

.competitor-table thead {
    border-bottom: 1px solid var(--color-border);
}

.competitor-table tbody tr {
    border-bottom: 1px solid var(--color-border);
}

.competitor-table tbody tr:last-child {
    border-bottom: none;
}

/* Risk cards */
.risk-card {
    border-left: 3px solid;
}

.risk-critical {
    border-left-color: var(--color-error);
}

.risk-moderate {
    border-left-color: var(--color-warning);
}

/* Print styles for research report */
@media print {
    nav, .theme-toggle, #authBtn, .latency-badge, .toast,
    button[onclick="exportPDF()"],
    button[onclick="shareReport()"],
    button[onclick="resetToInput()"] {
        display: none !important;
    }

    body {
        background: white !important;
        color: #111 !important;
    }

    body::after {
        display: none !important;
    }

    .surface-card, .score-card, .risk-card {
        background: white !important;
        border-color: #e5e7eb !important;
        break-inside: avoid;
    }

    .tab-btn { display: none !important; }
    #tabContent { break-inside: avoid; }

    .text-heading, .text-body { color: #111 !important; }
    .text-secondary, .text-muted { color: #6b7280 !important; }
}
