/* ============================================
   DARK/LIGHT MODE THEME TOGGLE SYSTEM
   Quantum Navigator - Professional Theme System
   ============================================ */

/* ============================================
   CSS CUSTOM PROPERTIES - THEME VARIABLES
   ============================================ */

/* Dark Mode (Default) - Original Quantum Navigator Design */
:root,
:root[data-theme="dark"] {
    /* Background Colors */
    --bg-primary: #0a0a1a;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #2a2a3e;
    --glass-subtle: rgba(255, 255, 255, 0.03);
    --glass-medium: rgba(255, 255, 255, 0.06);

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #d0d0d0;
    --text-muted: #b0b0b0;

    /* Accent Colors */
    --primary-cyan: #00c4e8;
    --primary-blue: #0088cc;
    --primary-indigo: #0066aa;
    --accent-orange: #ff8001;
    --accent-orange-glow: rgba(255, 128, 1, 0.3);

    /* Border Colors */
    --border-subtle: rgba(100, 180, 255, 0.25);
    --border-medium: rgba(100, 180, 255, 0.4);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 24px rgba(0, 196, 232, 0.15);

    /* Special Elements */
    --card-bg: rgba(26, 26, 46, 0.6);
    --input-bg: rgba(255, 255, 255, 0.05);
    --input-border: rgba(100, 180, 255, 0.3);

    /* Theme-specific meta color */
    --theme-color: #1a1a2e;
}

/* Light Mode - Professional & Accessible Design */
:root[data-theme="light"] {
    /* Background Colors - Clean white with subtle grays */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --glass-subtle: rgba(0, 0, 0, 0.02);
    --glass-medium: rgba(0, 0, 0, 0.04);

    /* Text Colors - High contrast for readability */
    --text-primary: #0a0e27;
    --text-secondary: #495057;
    --text-muted: #6c757d;

    /* Accent Colors - Vibrant but WCAG compliant */
    --primary-cyan: #0077cc;
    --primary-blue: #0066aa;
    --primary-indigo: #004488;
    --accent-orange: #d46800;
    --accent-orange-glow: rgba(212, 104, 0, 0.2);

    /* Border Colors */
    --border-subtle: rgba(0, 119, 204, 0.2);
    --border-medium: rgba(0, 119, 204, 0.35);

    /* Shadows - Softer for light backgrounds */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 24px rgba(0, 119, 204, 0.12);

    /* Special Elements */
    --card-bg: #ffffff;
    --input-bg: #ffffff;
    --input-border: rgba(0, 119, 204, 0.3);

    /* Theme-specific meta color */
    --theme-color: #ffffff;
}

/* ============================================
   THEME-SPECIFIC OVERRIDES
   IMPORTANT: Uses html[data-theme] with !important to override ALL hardcoded colors
   ============================================ */

/* ============================================
   DARK MODE - Force all elements to use dark theme
   ============================================ */

html[data-theme="dark"] body,
html[data-theme="dark"],
:root[data-theme="dark"] {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

/* Dark Mode - Override all containers and sections */
html[data-theme="dark"] .container,
html[data-theme="dark"] section,
html[data-theme="dark"] .main-content,
html[data-theme="dark"] .company-grid,
html[data-theme="dark"] .search-container,
html[data-theme="dark"] .filter-container,
html[data-theme="dark"] .advanced-search,
html[data-theme="dark"] .comparison-page,
html[data-theme="dark"] .company-profile,
html[data-theme="dark"] .hero-section,
html[data-theme="dark"] .stats-section,
html[data-theme="dark"] .insights-section {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

/* Dark Mode - Cards */
html[data-theme="dark"] .company-card,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .filter-group,
html[data-theme="dark"] .search-result-card {
    background: var(--card-bg) !important;
    border-color: var(--border-subtle) !important;
    color: var(--text-primary) !important;
}

/* ============================================
   LIGHT MODE - Force all elements to use light theme
   ============================================ */

html[data-theme="light"] body,
html[data-theme="light"],
:root[data-theme="light"] {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
    color: var(--text-primary) !important;
}

/* Light Mode - Override ALL containers, sections, and page elements */
html[data-theme="light"] .container,
html[data-theme="light"] section,
html[data-theme="light"] .main-content,
html[data-theme="light"] .company-grid,
html[data-theme="light"] .search-container,
html[data-theme="light"] .filter-container,
html[data-theme="light"] .advanced-search,
html[data-theme="light"] .comparison-page,
html[data-theme="light"] .company-profile,
html[data-theme="light"] .hero-section,
html[data-theme="light"] .stats-section,
html[data-theme="light"] .insights-section,
html[data-theme="light"] main,
html[data-theme="light"] article,
html[data-theme="light"] .content-wrapper {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

/* Light Mode - Secondary backgrounds for contrast */
html[data-theme="light"] .filter-section,
html[data-theme="light"] .sidebar,
html[data-theme="light"] .panel,
html[data-theme="light"] .modal-content {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

/* Light Mode - Card Backgrounds */
html[data-theme="light"] .company-card,
html[data-theme="light"] .stat-card,
html[data-theme="light"] .filter-group,
html[data-theme="light"] .search-result-card {
    background: var(--card-bg) !important;
    border-color: var(--border-subtle) !important;
    box-shadow: var(--shadow-sm) !important;
    color: var(--text-primary) !important;
}

html[data-theme="light"] .company-card:hover,
html[data-theme="light"] .stat-card:hover {
    box-shadow: var(--shadow-md) !important;
    background: var(--bg-secondary) !important;
}

/* Light Mode - Inputs & Selects */
html[data-theme="light"] input[type="text"],
html[data-theme="light"] input[type="search"],
html[data-theme="light"] select,
html[data-theme="light"] textarea {
    background: var(--input-bg) !important;
    border-color: var(--input-border) !important;
    color: var(--text-primary) !important;
}

html[data-theme="light"] select option {
    background: #ffffff !important;
    color: #0a0e27 !important;
}

/* Light Mode - Breadcrumbs */
html[data-theme="light"] .breadcrumb a,
html[data-theme="light"] .company-breadcrumb a {
    color: var(--primary-cyan) !important;
}

/* Light Mode - Footer */
html[data-theme="light"] .quantum-footer,
html[data-theme="light"] footer {
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border-top-color: var(--border-medium) !important;
    color: var(--text-primary) !important;
}

/* Light Mode - Cookie Consent */
html[data-theme="light"] #cookieConsent {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-top-color: var(--border-medium) !important;
}

/* Light Mode - Filter Buttons */
html[data-theme="light"] .filter-btn,
html[data-theme="light"] .category-filter,
html[data-theme="light"] .country-filter {
    background: var(--bg-secondary) !important;
    border-color: var(--border-subtle) !important;
    color: var(--text-secondary) !important;
}

html[data-theme="light"] .filter-btn:hover,
html[data-theme="light"] .category-filter:hover {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

html[data-theme="light"] .filter-btn.active {
    background: var(--primary-cyan) !important;
    color: #ffffff !important;
    border-color: var(--primary-cyan) !important;
}

/* Light Mode - Active Filters Container */
html[data-theme="light"] .active-filters {
    background: var(--bg-secondary) !important;
    border-color: var(--accent-orange) !important;
    box-shadow: 0 4px 12px rgba(212, 104, 0, 0.2) !important;
}

/* Light Mode - Headers and Text Elements */
html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] h3,
html[data-theme="light"] h4,
html[data-theme="light"] h5,
html[data-theme="light"] h6 {
    color: var(--text-primary) !important;
}

html[data-theme="light"] p,
html[data-theme="light"] span,
html[data-theme="light"] li,
html[data-theme="light"] td,
html[data-theme="light"] th {
    color: var(--text-secondary) !important;
}

/* Light Mode - Links */
html[data-theme="light"] a {
    color: var(--primary-cyan) !important;
}

html[data-theme="light"] a:hover {
    color: var(--primary-blue) !important;
}

/* Light Mode - Navigation */
html[data-theme="light"] nav,
html[data-theme="light"] header,
html[data-theme="light"] .navbar {
    background: var(--bg-secondary) !important;
    border-bottom-color: var(--border-subtle) !important;
    color: var(--text-primary) !important;
}

/* Light Mode - Tables */
html[data-theme="light"] table {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

html[data-theme="light"] thead {
    background: var(--bg-secondary) !important;
}

html[data-theme="light"] tbody tr:nth-child(even) {
    background: var(--bg-secondary) !important;
}

html[data-theme="light"] tbody tr:hover {
    background: var(--bg-tertiary) !important;
}

/* Light Mode - Buttons */
html[data-theme="light"] button:not(.theme-toggle-btn) {
    color: var(--text-primary) !important;
}

html[data-theme="light"] .btn-primary {
    background: var(--primary-cyan) !important;
    color: #ffffff !important;
}

/* Light Mode - Modals and Overlays */
html[data-theme="light"] .modal,
html[data-theme="light"] .overlay,
html[data-theme="light"] .dropdown-menu {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-subtle) !important;
}

/* Light Mode - Comparison Page Specific */
html[data-theme="light"] .comparison-grid,
html[data-theme="light"] .comparison-table,
html[data-theme="light"] .comparison-header {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

/* Light Mode - Advanced Search Specific */
html[data-theme="light"] .search-filters,
html[data-theme="light"] .search-results,
html[data-theme="light"] .filter-panel {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

/* Light Mode - Map/Chart containers */
html[data-theme="light"] .map-container,
html[data-theme="light"] .chart-container,
html[data-theme="light"] .visualization {
    background: var(--bg-primary) !important;
}

/* ============================================
   ENSURE BODY USES THEME COLORS
   ============================================ */

/* Ensure base body element uses theme colors */
body {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    transition: background 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   THEME TOGGLE BUTTON STYLES
   ============================================ */

.theme-toggle-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9998;
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.theme-toggle-btn {
    /* Size & Shape */
    width: 56px;
    height: 56px;
    border-radius: 50%;

    /* Layout */
    display: flex;
    align-items: center;
    justify-content: center;

    /* Styling */
    background: var(--glass-medium);
    border: 2px solid var(--border-medium);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);

    /* Interaction */
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Remove default button styles */
    padding: 0;
    outline: none;
}

.theme-toggle-btn:hover {
    transform: scale(1.05) rotate(15deg);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-orange);
    background: var(--glass-medium);
}

.theme-toggle-btn:active {
    transform: scale(0.95) rotate(-15deg);
}

/* Focus state for accessibility */
.theme-toggle-btn:focus-visible {
    outline: 3px solid var(--accent-orange) !important;
    outline-offset: 3px;
}

/* Theme Toggle Icon Container */
.theme-icon {
    width: 28px;
    height: 28px;
    position: relative;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle-btn:hover .theme-icon {
    transform: rotate(180deg);
}

/* Sun Icon (shown in dark mode) */
.sun-icon {
    display: block;
    stroke: var(--accent-orange);
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

:root[data-theme="light"] .sun-icon {
    display: none;
}

/* Moon Icon (shown in light mode) */
.moon-icon {
    display: none;
    stroke: var(--primary-blue);
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

:root[data-theme="light"] .moon-icon {
    display: block;
}

/* Tooltip */
.theme-toggle-tooltip {
    position: absolute;
    bottom: -45px;
    right: 0;
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-md);
}

.theme-toggle-container:hover .theme-toggle-tooltip {
    opacity: 1;
    visibility: visible;
    bottom: -40px;
}

/* Tooltip arrow */
.theme-toggle-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-subtle);
    border-top: 1px solid var(--border-subtle);
    transform: rotate(45deg);
}

/* ============================================
   THEME TRANSITION ANIMATIONS
   ============================================ */

/* Smooth color transitions for theme switching */
body,
.company-card,
.stat-card,
input,
select,
.filter-btn,
.breadcrumb a,
.footer-link {
    transition:
        background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .theme-toggle-container {
        animation: none;
    }

    .theme-toggle-btn,
    .theme-icon,
    .theme-toggle-tooltip,
    body,
    .company-card,
    .stat-card,
    input,
    select,
    .filter-btn {
        transition-duration: 0.01ms !important;
    }

    .theme-toggle-btn:hover {
        transform: none;
    }
}

/* ============================================
   MOBILE RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .theme-toggle-container {
        top: 15px;
        right: 15px;
    }

    .theme-toggle-btn {
        width: 48px;
        height: 48px;
    }

    .theme-icon {
        width: 24px;
        height: 24px;
    }

    .theme-toggle-tooltip {
        font-size: 0.75rem;
        padding: 6px 10px;
    }
}

/* Ensure toggle doesn't overlap with cookie consent */
body:has(#cookieConsent[style*="display: block"]) .theme-toggle-container {
    top: 80px;
}

/* ============================================
   HIGH CONTRAST MODE SUPPORT
   ============================================ */

@media (prefers-contrast: high) {
    :root[data-theme="light"] {
        --text-primary: #000000;
        --bg-primary: #ffffff;
        --border-medium: rgba(0, 0, 0, 0.8);
    }

    .theme-toggle-btn {
        border-width: 3px;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .theme-toggle-container {
        display: none;
    }

    /* Force light mode for printing */
    :root {
        --bg-primary: #ffffff;
        --text-primary: #000000;
    }
}

/* ============================================
   COLOR SCHEME META TAG SUPPORT
   ============================================ */

/* Browser UI color scheme hint */
:root {
    color-scheme: dark light;
}

:root[data-theme="dark"] {
    color-scheme: dark;
}

:root[data-theme="light"] {
    color-scheme: light;
}

/* ============================================
   TECH-STACK PAGE THEME OVERRIDES
   Fix hardcoded dark colors in tech-stack.css
   ============================================ */

/* Tech-Stack Container - Light Mode */
html[data-theme="light"] .tech-stack-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 50%, #dee2e6 100%) !important;
    color: var(--text-primary) !important;
}

/* Tech-Stack Header - Light Mode */
html[data-theme="light"] .tech-stack-header h1 a {
    color: var(--primary-cyan) !important;
}

html[data-theme="light"] .page-title h2 {
    background: linear-gradient(90deg, #0077cc, #d46800) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

html[data-theme="light"] .subtitle {
    color: var(--text-secondary) !important;
}

html[data-theme="light"] .breadcrumb {
    color: var(--text-muted) !important;
}

html[data-theme="light"] .breadcrumb a {
    color: var(--primary-cyan) !important;
}

/* Tech Info Panel - Light Mode */
html[data-theme="light"] .tech-info-panel {
    background: rgba(0, 0, 0, 0.02) !important;
    border: 2px solid rgba(0, 119, 204, 0.3) !important;
}

html[data-theme="light"] .tech-info-panel h3 {
    color: var(--primary-cyan) !important;
}

html[data-theme="light"] .tech-card {
    background: rgba(0, 0, 0, 0.01) !important;
    border: 1px solid rgba(0, 119, 204, 0.2) !important;
    color: var(--text-primary) !important;
}

html[data-theme="light"] .tech-card:hover {
    border-color: var(--primary-cyan) !important;
    box-shadow: 0 10px 30px rgba(0, 119, 204, 0.2) !important;
}

html[data-theme="light"] .tech-card h4 {
    color: var(--primary-cyan) !important;
}

html[data-theme="light"] .tech-card p {
    color: var(--text-secondary) !important;
}

/* Controls - Light Mode */
html[data-theme="light"] .controls {
    background: rgba(0, 0, 0, 0.02) !important;
}

html[data-theme="light"] .control-group label {
    color: var(--primary-cyan) !important;
}

html[data-theme="light"] .controls select,
html[data-theme="light"] .controls button {
    background: var(--input-bg) !important;
    border: 1px solid var(--input-border) !important;
    color: var(--text-primary) !important;
}

html[data-theme="light"] .controls select:hover,
html[data-theme="light"] .controls button:hover {
    background: rgba(0, 119, 204, 0.05) !important;
    box-shadow: 0 4px 12px rgba(0, 119, 204, 0.15) !important;
}

html[data-theme="light"] .controls select:focus {
    border-color: var(--accent-orange) !important;
    box-shadow: 0 0 0 3px var(--accent-orange-glow) !important;
}

html[data-theme="light"] .reset-btn {
    background: linear-gradient(135deg, #dc3545, #d46800) !important;
}

html[data-theme="light"] .reset-btn:hover {
    background: linear-gradient(135deg, #d46800, #dc3545) !important;
}

/* Visualization Container - Light Mode */
html[data-theme="light"] .visualization-container {
    background: rgba(0, 0, 0, 0.03) !important;
    border: 2px solid rgba(0, 119, 204, 0.3) !important;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.1) !important;
}

html[data-theme="light"] .spinner {
    border: 4px solid rgba(0, 119, 204, 0.2) !important;
    border-top-color: var(--primary-cyan) !important;
}

/* Statistics Dashboard - Light Mode */
html[data-theme="light"] .stat-card {
    background: linear-gradient(135deg, rgba(0, 119, 204, 0.05), rgba(212, 104, 0, 0.05)) !important;
    border: 2px solid rgba(0, 119, 204, 0.3) !important;
}

html[data-theme="light"] .stat-card:hover {
    border-color: var(--primary-cyan) !important;
    box-shadow: 0 10px 30px rgba(0, 119, 204, 0.2) !important;
}

html[data-theme="light"] .stat-number {
    background: linear-gradient(90deg, #0077cc, #d46800) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

html[data-theme="light"] .stat-label {
    color: var(--text-secondary) !important;
}

/* Legend - Light Mode */
html[data-theme="light"] .legend-section {
    background: rgba(0, 0, 0, 0.02) !important;
    border: 1px solid rgba(0, 119, 204, 0.2) !important;
}

html[data-theme="light"] .legend-section h3 {
    color: var(--primary-cyan) !important;
}

html[data-theme="light"] .legend-item {
    color: var(--text-primary) !important;
}

html[data-theme="light"] .legend-item:hover {
    background: rgba(0, 119, 204, 0.05) !important;
}

html[data-theme="light"] .legend-label {
    color: var(--text-primary) !important;
}

html[data-theme="light"] .legend-count {
    color: var(--text-muted) !important;
}

html[data-theme="light"] .size-circle {
    border: 2px solid var(--primary-cyan) !important;
    background: rgba(0, 119, 204, 0.1) !important;
}

/* Info Panel - Light Mode */
html[data-theme="light"] .info-panel {
    background: rgba(255, 255, 255, 0.98) !important;
    border: 2px solid var(--primary-cyan) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15) !important;
    color: var(--text-primary) !important;
}

html[data-theme="light"] .info-panel h3 {
    color: var(--primary-cyan) !important;
}

html[data-theme="light"] .info-panel #companyDetails {
    color: var(--text-secondary) !important;
}

html[data-theme="light"] .info-panel #companyDetails strong {
    color: var(--primary-cyan) !important;
}

html[data-theme="light"] .close-btn {
    background: rgba(220, 53, 69, 0.1) !important;
    color: #dc3545 !important;
}

html[data-theme="light"] .close-btn:hover {
    background: #dc3545 !important;
    color: white !important;
}

html[data-theme="light"] .view-profile-btn {
    background: linear-gradient(135deg, #0077cc, #d46800) !important;
}

/* Tech Deep Dive - Light Mode */
html[data-theme="light"] .tech-deep-dive {
    background: rgba(0, 0, 0, 0.01) !important;
}

html[data-theme="light"] .tech-deep-dive h2 {
    background: linear-gradient(90deg, #0077cc, #d46800) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

html[data-theme="light"] .deep-dive-card {
    background: rgba(0, 0, 0, 0.02) !important;
    border: 2px solid rgba(0, 119, 204, 0.2) !important;
}

html[data-theme="light"] .deep-dive-card:hover {
    border-color: var(--primary-cyan) !important;
    box-shadow: 0 10px 30px rgba(0, 119, 204, 0.15) !important;
}

html[data-theme="light"] .deep-dive-card h3 {
    color: var(--primary-cyan) !important;
}

html[data-theme="light"] .deep-dive-card li {
    color: var(--text-secondary) !important;
}

html[data-theme="light"] .deep-dive-card li::before {
    color: var(--accent-orange) !important;
}

html[data-theme="light"] .deep-dive-card strong {
    color: var(--primary-cyan) !important;
}

/* Footer - Light Mode */
html[data-theme="light"] .tech-stack-footer {
    border-top: 2px solid rgba(0, 119, 204, 0.2) !important;
    color: var(--text-muted) !important;
}

html[data-theme="light"] .tech-stack-footer a {
    color: var(--primary-cyan) !important;
}

html[data-theme="light"] .tech-stack-footer a:hover {
    color: var(--accent-orange) !important;
}

/* SVG Elements - Light Mode */
html[data-theme="light"] .company-label {
    fill: var(--text-primary) !important;
    text-shadow:
        1px 1px 2px rgba(255, 255, 255, 0.9),
        -1px -1px 2px rgba(255, 255, 255, 0.9),
        1px -1px 2px rgba(255, 255, 255, 0.9),
        -1px 1px 2px rgba(255, 255, 255, 0.9) !important;
}

/* ============================================
   ADVANCED SEARCH PAGE - LIGHT MODE OVERRIDES
   ============================================ */

/* Main Container */
html[data-theme="light"] .search-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
}

/* Hero Section */
html[data-theme="light"] .search-hero {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
    border-bottom: 2px solid var(--accent-orange) !important;
}

html[data-theme="light"] .search-hero h1 {
    color: var(--accent-orange) !important;
}

html[data-theme="light"] .search-description {
    color: var(--text-primary) !important;
}

html[data-theme="light"] .search-description h1 {
    color: var(--text-primary) !important;
}

html[data-theme="light"] .search-description h2 {
    color: var(--accent-orange) !important;
}

/* Search Input */
html[data-theme="light"] .search-input {
    background: #ffffff !important;
    border: 2px solid #dee2e6 !important;
    color: var(--text-primary) !important;
}

html[data-theme="light"] .search-input:focus {
    border-color: var(--accent-orange) !important;
    box-shadow: 0 0 0 3px var(--accent-orange-glow) !important;
}

html[data-theme="light"] .search-input::placeholder {
    color: #6c757d !important;
}

html[data-theme="light"] .search-icon {
    color: var(--accent-orange) !important;
}

/* Filter Panel */
html[data-theme="light"] .filter-panel {
    background: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

html[data-theme="light"] .filter-header h3 {
    color: var(--accent-orange) !important;
}

html[data-theme="light"] .filter-label {
    color: var(--text-primary) !important;
}

/* Filter Selects */
html[data-theme="light"] .filter-select {
    background: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    color: var(--text-primary) !important;
}

html[data-theme="light"] .filter-select:focus {
    border-color: var(--accent-orange) !important;
    box-shadow: 0 0 0 3px var(--accent-orange-glow) !important;
}

html[data-theme="light"] .filter-select option {
    background: #ffffff !important;
    color: var(--text-primary) !important;
}

html[data-theme="light"] .filter-select option:checked {
    background: var(--accent-orange) !important;
    color: #ffffff !important;
}

html[data-theme="light"] .filter-hint {
    color: #6c757d !important;
}

/* Year Range Inputs */
html[data-theme="light"] .year-input {
    background: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    color: var(--text-primary) !important;
}

html[data-theme="light"] .year-input:focus {
    border-color: var(--accent-orange) !important;
    box-shadow: 0 0 0 3px var(--accent-orange-glow) !important;
}

html[data-theme="light"] .year-range span {
    color: #6c757d !important;
}

/* Active Filters */
html[data-theme="light"] .active-filters {
    border-top: 1px solid #dee2e6 !important;
}

html[data-theme="light"] .active-filters-header {
    color: var(--accent-orange) !important;
}

html[data-theme="light"] .active-filter-tag {
    background: #e9ecef !important;
    border: 1px solid #dee2e6 !important;
}

html[data-theme="light"] .filter-tag-label {
    color: var(--accent-orange) !important;
}

html[data-theme="light"] .filter-tag-value {
    color: var(--text-primary) !important;
}

html[data-theme="light"] .filter-tag-remove {
    color: #dc3545 !important;
}

html[data-theme="light"] .filter-tag-remove:hover {
    background: rgba(220, 53, 69, 0.1) !important;
}

/* Results Summary */
html[data-theme="light"] .results-count {
    color: var(--text-primary) !important;
}

html[data-theme="light"] .results-count span {
    color: var(--accent-orange) !important;
}

/* Buttons */
html[data-theme="light"] .btn-secondary {
    background: #e9ecef !important;
    color: var(--text-primary) !important;
    border: 1px solid #dee2e6 !important;
}

html[data-theme="light"] .btn-secondary:hover {
    background: #dee2e6 !important;
}

html[data-theme="light"] .btn-export {
    background: linear-gradient(135deg, var(--accent-orange), #d46800) !important;
    color: #ffffff !important;
}

html[data-theme="light"] .btn-export:hover {
    box-shadow: 0 4px 12px rgba(255, 123, 13, 0.3) !important;
}

/* Company Cards */
html[data-theme="light"] .company-card {
    background: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}

html[data-theme="light"] .company-card:hover {
    border-color: var(--accent-orange) !important;
    box-shadow: 0 8px 24px rgba(255, 123, 13, 0.15) !important;
}

html[data-theme="light"] .company-name a {
    color: var(--accent-orange) !important;
}

html[data-theme="light"] .company-name a:hover {
    color: #d46800 !important;
}

html[data-theme="light"] .meta-item {
    color: #6c757d !important;
}

html[data-theme="light"] .company-description {
    color: var(--text-secondary) !important;
}

/* Category Badges */
html[data-theme="light"] .category-badge {
    background: #e9ecef !important;
    color: var(--accent-orange) !important;
    border: 1px solid #dee2e6 !important;
}

html[data-theme="light"] .category-more {
    color: #6c757d !important;
}

html[data-theme="light"] .company-card-footer {
    border-top: 1px solid #dee2e6 !important;
}

html[data-theme="light"] .btn-link {
    color: var(--accent-orange) !important;
}

html[data-theme="light"] .btn-link:hover {
    color: #d46800 !important;
}

/* Loading State */
html[data-theme="light"] .loading-state {
    color: #6c757d !important;
}

html[data-theme="light"] .spinner {
    border: 3px solid #dee2e6 !important;
    border-top: 3px solid var(--accent-orange) !important;
}

/* No Results State */
html[data-theme="light"] .no-results h3 {
    color: var(--text-primary) !important;
}

html[data-theme="light"] .no-results p {
    color: #6c757d !important;
}

/* Error State */
html[data-theme="light"] .error-state {
    color: #dc3545 !important;
}

/* ============================================
   COMPARISON TOOL - LIGHT MODE OVERRIDES
   ============================================ */

/* Base Page */
html[data-theme="light"] .comparison-page {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    color: var(--text-primary) !important;
}

/* Header */
html[data-theme="light"] .comparison-header {
    background: rgba(255, 255, 255, 0.95) !important;
    border-bottom: 1px solid rgba(255, 123, 13, 0.2) !important;
}

html[data-theme="light"] .nav-home {
    color: var(--accent-orange) !important;
}

html[data-theme="light"] .nav-home:hover {
    color: #d46800 !important;
}

html[data-theme="light"] .nav-link {
    color: var(--text-secondary) !important;
}

html[data-theme="light"] .nav-link:hover,
html[data-theme="light"] .nav-link.active {
    color: var(--accent-orange) !important;
}

html[data-theme="light"] .nav-link.active::after {
    background: var(--accent-orange) !important;
}

/* Hero Section */
html[data-theme="light"] .comparison-hero {
    background: linear-gradient(135deg, rgba(255, 123, 13, 0.05) 0%, rgba(255, 123, 13, 0.02) 100%) !important;
    border-bottom: 1px solid rgba(255, 123, 13, 0.2) !important;
}

html[data-theme="light"] .hero-title {
    background: linear-gradient(135deg, var(--accent-orange) 0%, #d46800 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

html[data-theme="light"] .hero-description {
    color: var(--text-secondary) !important;
}

/* Company Selector */
html[data-theme="light"] .company-selector {
    background: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

html[data-theme="light"] .selector-header {
    border-bottom: 1px solid #dee2e6 !important;
}

html[data-theme="light"] .selector-title {
    color: var(--text-primary) !important;
}

html[data-theme="light"] .search-box {
    background: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    color: var(--text-primary) !important;
}

html[data-theme="light"] .search-box:focus {
    border-color: var(--accent-orange) !important;
    box-shadow: 0 0 0 3px var(--accent-orange-glow) !important;
}

html[data-theme="light"] .search-box::placeholder {
    color: #6c757d !important;
}

html[data-theme="light"] .company-list-item {
    border-bottom: 1px solid #f8f9fa !important;
    color: var(--text-primary) !important;
}

html[data-theme="light"] .company-list-item:hover {
    background: #f8f9fa !important;
}

html[data-theme="light"] .company-info h4 {
    color: var(--text-primary) !important;
}

html[data-theme="light"] .company-meta {
    color: #6c757d !important;
}

html[data-theme="light"] .add-btn {
    background: var(--accent-orange) !important;
    color: #ffffff !important;
}

html[data-theme="light"] .add-btn:hover {
    background: #d46800 !important;
}

/* Comparison Table */
html[data-theme="light"] .comparison-container {
    background: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

html[data-theme="light"] .comparison-table {
    background: #ffffff !important;
}

html[data-theme="light"] .comparison-table th {
    background: #f8f9fa !important;
    color: var(--text-primary) !important;
    border-bottom: 2px solid var(--accent-orange) !important;
}

html[data-theme="light"] .comparison-table td {
    border-bottom: 1px solid #f8f9fa !important;
    color: var(--text-primary) !important;
}

html[data-theme="light"] .comparison-table tr:hover {
    background: #f8f9fa !important;
}

html[data-theme="light"] .company-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border-bottom: 3px solid var(--accent-orange) !important;
}

html[data-theme="light"] .company-name-cell {
    color: var(--accent-orange) !important;
}

html[data-theme="light"] .company-name-cell:hover {
    color: #d46800 !important;
}

html[data-theme="light"] .remove-company-btn {
    background: #e9ecef !important;
    color: #6c757d !important;
}

html[data-theme="light"] .remove-company-btn:hover {
    background: #dc3545 !important;
    color: #ffffff !important;
}

html[data-theme="light"] .category-cell .category-badge {
    background: #e9ecef !important;
    color: var(--accent-orange) !important;
    border: 1px solid #dee2e6 !important;
}

html[data-theme="light"] .rating-stars .star {
    color: var(--accent-orange) !important;
}

html[data-theme="light"] .rating-stars .star.empty {
    color: #dee2e6 !important;
}

/* Charts and Visualizations */
html[data-theme="light"] .comparison-chart {
    background: #ffffff !important;
    border: 1px solid #dee2e6 !important;
}

html[data-theme="light"] .chart-title {
    color: var(--text-primary) !important;
}

html[data-theme="light"] .chart-legend-item {
    color: var(--text-primary) !important;
}

/* Action Buttons */
html[data-theme="light"] .comparison-actions {
    background: #f8f9fa !important;
    border-top: 1px solid #dee2e6 !important;
}

html[data-theme="light"] .action-btn {
    background: var(--accent-orange) !important;
    color: #ffffff !important;
}

html[data-theme="light"] .action-btn:hover {
    background: #d46800 !important;
}

html[data-theme="light"] .action-btn-secondary {
    background: #e9ecef !important;
    color: var(--text-primary) !important;
    border: 1px solid #dee2e6 !important;
}

html[data-theme="light"] .action-btn-secondary:hover {
    background: #dee2e6 !important;
}

/* Tooltips */
html[data-theme="light"] .comparison-tooltip {
    background: #ffffff !important;
    color: var(--text-primary) !important;
    border: 1px solid #dee2e6 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

html[data-theme="light"] .tooltip-arrow {
    border-top-color: #ffffff !important;
}

/* Loading State */
html[data-theme="light"] .loading-overlay {
    background: rgba(255, 255, 255, 0.9) !important;
}

html[data-theme="light"] .loading-spinner {
    border: 3px solid #dee2e6 !important;
    border-top: 3px solid var(--accent-orange) !important;
}

html[data-theme="light"] .loading-text {
    color: var(--text-primary) !important;
}

/* Empty State */
html[data-theme="light"] .empty-comparison {
    color: #6c757d !important;
}

html[data-theme="light"] .empty-comparison-icon {
    color: #dee2e6 !important;
}

html[data-theme="light"] .empty-comparison h3 {
    color: var(--text-primary) !important;
}

/* Badges and Tags */
html[data-theme="light"] .badge {
    background: #e9ecef !important;
    color: var(--accent-orange) !important;
}

html[data-theme="light"] .badge-success {
    background: #d4edda !important;
    color: #155724 !important;
}

html[data-theme="light"] .badge-warning {
    background: #fff3cd !important;
    color: #856404 !important;
}

html[data-theme="light"] .badge-danger {
    background: #f8d7da !important;
    color: #721c24 !important;
}

/* Diff Indicators */
html[data-theme="light"] .diff-higher {
    color: #28a745 !important;
}

html[data-theme="light"] .diff-lower {
    color: #dc3545 !important;
}

html[data-theme="light"] .diff-equal {
    color: #6c757d !important;
}

/* ============================================
   INVESTMENT TRACKING - LIGHT MODE OVERRIDES
   ============================================ */

/* Base Investment Page */
html[data-theme="light"] .investment-page {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    color: var(--text-primary) !important;
}

/* Header */
html[data-theme="light"] .investment-header {
    background: rgba(255, 255, 255, 0.95) !important;
    border-bottom: 1px solid rgba(255, 123, 13, 0.2) !important;
}

html[data-theme="light"] .investment-title {
    color: var(--accent-orange) !important;
}

html[data-theme="light"] .investment-subtitle {
    color: var(--text-secondary) !important;
}

/* Stats Overview */
html[data-theme="light"] .stats-grid {
    background: transparent !important;
}

html[data-theme="light"] .stat-card {
    background: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}

html[data-theme="light"] .stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    border-color: var(--accent-orange) !important;
}

html[data-theme="light"] .stat-label {
    color: #6c757d !important;
}

html[data-theme="light"] .stat-value {
    color: var(--accent-orange) !important;
}

html[data-theme="light"] .stat-change {
    color: var(--text-secondary) !important;
}

html[data-theme="light"] .stat-change.positive {
    color: #28a745 !important;
}

html[data-theme="light"] .stat-change.negative {
    color: #dc3545 !important;
}

html[data-theme="light"] .stat-icon {
    color: var(--accent-orange) !important;
}

/* Investment Table */
html[data-theme="light"] .investment-table-container {
    background: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

html[data-theme="light"] .table-header {
    background: #f8f9fa !important;
    border-bottom: 2px solid var(--accent-orange) !important;
}

html[data-theme="light"] .table-header h3 {
    color: var(--text-primary) !important;
}

html[data-theme="light"] .table-filters {
    background: #f8f9fa !important;
    border-bottom: 1px solid #dee2e6 !important;
}

html[data-theme="light"] .filter-input,
html[data-theme="light"] .filter-select {
    background: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    color: var(--text-primary) !important;
}

html[data-theme="light"] .filter-input:focus,
html[data-theme="light"] .filter-select:focus {
    border-color: var(--accent-orange) !important;
    box-shadow: 0 0 0 3px var(--accent-orange-glow) !important;
}

html[data-theme="light"] .investment-table {
    background: #ffffff !important;
}

html[data-theme="light"] .investment-table th {
    background: #f8f9fa !important;
    color: var(--text-primary) !important;
    border-bottom: 2px solid #dee2e6 !important;
}

html[data-theme="light"] .investment-table td {
    border-bottom: 1px solid #f8f9fa !important;
    color: var(--text-primary) !important;
}

html[data-theme="light"] .investment-table tr:hover {
    background: #f8f9fa !important;
}

html[data-theme="light"] .company-link {
    color: var(--accent-orange) !important;
}

html[data-theme="light"] .company-link:hover {
    color: #d46800 !important;
}

/* Investment Amount Badges */
html[data-theme="light"] .amount-badge {
    background: #e9ecef !important;
    color: var(--accent-orange) !important;
}

html[data-theme="light"] .amount-large {
    background: #d4edda !important;
    color: #155724 !important;
}

html[data-theme="light"] .amount-medium {
    background: #fff3cd !important;
    color: #856404 !important;
}

html[data-theme="light"] .amount-small {
    background: #e9ecef !important;
    color: #6c757d !important;
}

/* Investment Charts */
html[data-theme="light"] .investment-chart {
    background: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}

html[data-theme="light"] .chart-header {
    border-bottom: 1px solid #dee2e6 !important;
}

html[data-theme="light"] .chart-title {
    color: var(--text-primary) !important;
}

html[data-theme="light"] .chart-legend {
    background: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
}

html[data-theme="light"] .legend-item {
    color: var(--text-primary) !important;
}

html[data-theme="light"] .legend-color {
    border: 1px solid #dee2e6 !important;
}

/* Funding Rounds */
html[data-theme="light"] .funding-round-card {
    background: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}

html[data-theme="light"] .funding-round-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    border-color: var(--accent-orange) !important;
}

html[data-theme="light"] .round-header {
    background: #f8f9fa !important;
    border-bottom: 1px solid #dee2e6 !important;
}

html[data-theme="light"] .round-type {
    color: var(--accent-orange) !important;
}

html[data-theme="light"] .round-date {
    color: #6c757d !important;
}

html[data-theme="light"] .round-amount {
    color: var(--text-primary) !important;
}

html[data-theme="light"] .investor-list {
    background: #f8f9fa !important;
}

html[data-theme="light"] .investor-chip {
    background: #e9ecef !important;
    color: var(--text-primary) !important;
    border: 1px solid #dee2e6 !important;
}

html[data-theme="light"] .investor-chip:hover {
    background: #dee2e6 !important;
}

/* Timeline View */
html[data-theme="light"] .investment-timeline {
    background: #ffffff !important;
    border: 1px solid #dee2e6 !important;
}

html[data-theme="light"] .timeline-item {
    border-left: 2px solid var(--accent-orange) !important;
}

html[data-theme="light"] .timeline-marker {
    background: var(--accent-orange) !important;
    border: 3px solid #ffffff !important;
    box-shadow: 0 0 0 2px var(--accent-orange) !important;
}

html[data-theme="light"] .timeline-content {
    background: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
}

html[data-theme="light"] .timeline-date {
    color: #6c757d !important;
}

html[data-theme="light"] .timeline-title {
    color: var(--text-primary) !important;
}

/* Investor Profiles */
html[data-theme="light"] .investor-card {
    background: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}

html[data-theme="light"] .investor-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    border-color: var(--accent-orange) !important;
}

html[data-theme="light"] .investor-name {
    color: var(--accent-orange) !important;
}

html[data-theme="light"] .investor-type {
    background: #e9ecef !important;
    color: #6c757d !important;
}

html[data-theme="light"] .investment-count {
    color: var(--text-primary) !important;
}

/* Filters and Controls */
html[data-theme="light"] .filter-panel {
    background: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}

html[data-theme="light"] .filter-group-title {
    color: var(--accent-orange) !important;
}

html[data-theme="light"] .filter-checkbox {
    border: 1px solid #dee2e6 !important;
}

html[data-theme="light"] .filter-checkbox:checked {
    background: var(--accent-orange) !important;
    border-color: var(--accent-orange) !important;
}

html[data-theme="light"] .filter-label {
    color: var(--text-primary) !important;
}

html[data-theme="light"] .clear-filters-btn {
    background: #e9ecef !important;
    color: var(--text-primary) !important;
}

html[data-theme="light"] .clear-filters-btn:hover {
    background: #dee2e6 !important;
}

/* Export and Actions */
html[data-theme="light"] .action-bar {
    background: #f8f9fa !important;
    border-top: 1px solid #dee2e6 !important;
}

html[data-theme="light"] .export-btn {
    background: var(--accent-orange) !important;
    color: #ffffff !important;
}

html[data-theme="light"] .export-btn:hover {
    background: #d46800 !important;
}

/* Loading and Empty States */
html[data-theme="light"] .loading-investment {
    color: #6c757d !important;
}

html[data-theme="light"] .empty-investment {
    color: #6c757d !important;
}

html[data-theme="light"] .empty-icon {
    color: #dee2e6 !important;
}

/* Tooltips */
html[data-theme="light"] .investment-tooltip {
    background: #ffffff !important;
    color: var(--text-primary) !important;
    border: 1px solid #dee2e6 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Pagination */
html[data-theme="light"] .pagination {
    background: #f8f9fa !important;
}

html[data-theme="light"] .page-btn {
    background: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    color: var(--text-primary) !important;
}

html[data-theme="light"] .page-btn:hover {
    background: #e9ecef !important;
}

html[data-theme="light"] .page-btn.active {
    background: var(--accent-orange) !important;
    color: #ffffff !important;
    border-color: var(--accent-orange) !important;
}
