/* ===== CSS VARIABLES ===== */
:root {
    /* Light Theme Colors - Matching reference image exactly */
    --primary-color: #ff07bc;      /* Pink for buttons and highlights */
    --primary-hover: #e605a8;
    --primary-light: #ffe0f7;
    --primary-dark: #cc0595;
    
    --secondary-color: #64748b;
    --secondary-light: #f1f5f9;
    --secondary-dark: #334155;
    
    /* Accent colors matching the reference image exactly */
    --accent-red: #ef4444;         /* Red/orange for home icon */
    --accent-purple: #8b5cf6;      /* Purple for search icons and badge */
    --accent-blue: #3b82f6;        /* Blue for cube icon */
    
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    
    /* Background Colors - White background like reference */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-elevated: #ffffff;
    --bg-overlay: rgba(0, 0, 0, 0.5);
    
    /* Text Colors - Dark gray like reference */
    --text-primary: #1f2937;       /* Dark gray for main text */
    --text-secondary: #4b5563;     /* Medium gray for secondary text */
    --text-muted: #4b5563;         /* Improved visibility - same as secondary */
    --text-inverse: #ffffff;
    
    /* Border Colors */
    --border-color: #e5e7eb;
    --border-hover: #d1d5db;
    --border-focus: #ff07bc;
    
    /* Shadow */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --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);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
    
    /* Layout */
    --navbar-height: 80px;         /* Increased height like reference */
    --sidebar-width: 300px;        /* Slightly wider sidebar */
    --sidebar-collapsed-width: 64px;
    --content-max-width: 1200px;
}

/* Dark Theme Colors - Matching the reference image */
[data-theme="dark"] {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #1a1a1a;
    --bg-elevated: #0f0f0f;
    --bg-overlay: rgba(0, 0, 0, 0.8);
    
    /* Dark theme logo */
    .brand-icon {
        background: url('/static/images/darktheme.png') no-repeat center center;
        background-size: contain;
    }
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #cbd5e1;         /* Improved visibility - same as secondary */
    
    --border-color: #334155;
    --border-hover: #475569;
    --border-focus: #ff07bc;
}

/* System Theme Detection */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --bg-primary: #000000;
        --bg-secondary: #0a0a0a;
        --bg-tertiary: #1a1a1a;
        --bg-elevated: #1e293b;
        --bg-overlay: rgba(0, 0, 0, 0.7);
        
            --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #cbd5e1;         /* Improved visibility - same as secondary */
        
        --border-color: #334155;
        --border-hover: #475569;
        --border-focus: #ff07bc;
    }
}

/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Improved alignment and spacing - Matching reference image */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
    text-align: left;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-weight: 400;
    letter-spacing: -0.01em;
}

/* Consistent container alignment */
.container, .nav-container, .content-wrapper {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

/* Improved grid alignment */
.grid, .stats-grid, .features-grid, .documents-grid {
    display: grid;
    gap: var(--space-6);
    align-items: start;
}

/* Better card alignment */
.card, .stat-card, .feature-card, .document-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    transition: background-color var(--transition-normal), color var(--transition-normal);
    overflow-x: hidden;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: var(--space-4);
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; font-weight: 700; }
h2 { font-size: 2rem; font-weight: 600; }
h3 { font-size: 1.5rem; font-weight: 600; }
h4 { font-size: 1.25rem; font-weight: 500; }
h5 { font-size: 1.125rem; font-weight: 500; }
h6 { font-size: 1rem; font-weight: 500; }

p {
    margin-bottom: var(--space-4);
    color: var(--text-secondary);
    line-height: 1.7;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
}

/* ===== TOP NAVBAR ===== */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    backdrop-filter: blur(10px);
    transition: all var(--transition-normal);
}

.nav-container {
    max-width: var(--content-max-width);
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-6);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

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

.nav-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    cursor: pointer;
}

.brand-icon {
    width: 200px;
    height: 60px;
    background: url('/static/images/lighttheme.png') no-repeat center center;
    background-size: contain;
    border: none;
    border-radius: 0;
    display: block;
}

/* Light theme logo (default) */
[data-theme="light"] .brand-icon {
    background: url('/static/images/lighttheme.png') no-repeat center center;
    background-size: contain;
}

.brand-text {
    display: none; /* Hide text since we're using logo image */
}

.brand-title {
    display: none; /* Hide text since we're using logo image */
}

.brand-subtitle {
    display: none; /* Hide text since we're using logo image */
}

.nav-center {
    flex: 1;
    max-width: 600px;
    margin: 0 var(--space-8);
}

.search-container {
    position: relative;
    width: 100%;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: var(--space-4);
    color: var(--text-muted);
    font-size: 1rem;
}

.search-input {
    width: 100%;
    padding: var(--space-3) var(--space-4) var(--space-3) var(--space-12);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: all var(--transition-fast);
    font-weight: 400;
}

.search-input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgb(99 102 241 / 0.1);
    background: var(--bg-primary);
}

.search-shortcut {
    position: absolute;
    right: var(--space-4);
    background: var(--bg-tertiary);
    color: var(--text-muted);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

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

.user-menu {
    position: relative;
}

.user-menu-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.user-menu-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 240px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-normal);
    z-index: 1001;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: var(--space-4);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.dropdown-header i {
    color: var(--primary-color);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: var(--space-2) 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* ===== MAIN CONTAINER ===== */
.main-container {
    display: flex;
    margin-top: var(--navbar-height);
    min-height: calc(100vh - var(--navbar-height));
}

/* ===== SIDEBAR LOGO ===== */
.sidebar-logo {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    width: var(--sidebar-width);
    padding: var(--space-6) var(--space-4);
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    z-index: 1000;
}

.sidebar-logo .brand-icon {
    width: 180px;
    height: 54px;
    margin: 0 auto;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: calc(var(--navbar-height)); /* Position below the logo */
    left: 0;
    height: calc(100vh - var(--navbar-height)); /* Adjust height for logo */
    overflow-y: auto;
    transition: transform var(--transition-normal);
    z-index: 999;
    /* Ensure sidebar is visible by default on desktop */
    transform: translateX(0);
}

.sidebar-header {
    padding: var(--space-6) var(--space-4);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-title {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.125rem;
}

.sidebar-close {
    display: none; /* Hide close button by default on desktop */
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.sidebar-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar-content {
    padding: var(--space-4);
}

.sidebar-section {
    margin-bottom: var(--space-8);
}

.section-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
    font-weight: 600;
}

.section-header::before {
    content: '';
    width: 3px;
    height: 16px;
    background: var(--accent-blue);
    border-radius: var(--radius-sm);
}

.section-header i {
    color: var(--accent-blue);
    font-size: 1rem;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: var(--space-1);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
}

.sidebar-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
}

.sidebar-link.active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar-link i {
    width: 16px;
    height: 16px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Clean icons without backgrounds - matching reference image */
.sidebar-link i {
    color: var(--text-secondary);
}

/* Feature card icons - clean without backgrounds */
.feature-card .feature-icon i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.sidebar-footer {
    padding: var(--space-4);
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.sidebar-version {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ===== CONTENT AREA ===== */
.content-area {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition-normal);
}

.content-wrapper {
    max-width: 100%; /* Changed to 100% to use full available width */
    margin: 0; /* Remove auto margins */
    padding: var(--space-6);
}

/* ===== HERO SECTION ===== */
.hero-section {
    display: flex;
    align-items: center;
    gap: var(--space-16);
    padding: var(--space-16) 0;
    margin-bottom: var(--space-16);
    max-width: 800px;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.hero-content {
    flex: 1; /* Take up available space */
    max-width: 600px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    background: var(--primary-light);
    color: var(--accent-purple);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: var(--space-6);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: var(--space-6);
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.hero-description {
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: var(--space-8);
    font-weight: 400;
    letter-spacing: -0.01em;
}

.hero-actions {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 300px;
    flex-shrink: 0; /* Prevent icons from shrinking */
    flex-basis: auto; /* Allow flexible sizing */
}

.hero-graphic {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.graphic-element {
    position: absolute;
    width: 80px;
    height: 80px;
    background: var(--primary-light);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary-color);
    animation: float 6s ease-in-out infinite;
}

.graphic-1 {
    top: 20px;
    left: 50%; /* Center horizontally */
    transform: translateX(-50%); /* Center the element */
    animation-delay: 0s;
}

.graphic-2 {
    bottom: 60px;
    left: 20px; /* Position from left */
    animation-delay: 2s;
}

.graphic-3 {
    bottom: 20px;
    right: 20px; /* Position from right */
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* ===== STATS SECTION ===== */
.stats-section {
    margin-bottom: var(--space-16);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-6);
}

.stat-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    transition: all var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: none;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--primary-color);
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.01em;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: var(--space-1);
}

/* ===== SECTION HEADERS ===== */
.section-header-large {
    text-align: left;
    margin-bottom: var(--space-12);
}

.section-header-large h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--space-4);
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.section-header-large p {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: none;
    margin: 0;
    font-weight: 400;
    letter-spacing: -0.01em;
}

/* ===== DOCUMENTS SECTION ===== */
.documents-section {
    margin-bottom: var(--space-16);
}

.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--space-6);
}

.document-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.document-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.card-header {
    background: var(--primary-color);
    color: white;
    padding: var(--space-6);
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.card-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
}

.card-meta h3 {
    margin: 0;
    color: white;
    font-size: 1.25rem;
}

.card-type {
    font-size: 0.875rem;
    opacity: 0.8;
}

.card-body {
    padding: var(--space-6);
}

.card-description {
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
}

.card-tags {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.tag {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 500;
}

.card-footer {
    padding: var(--space-6);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.last-modified {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ===== FEATURES SECTION ===== */
.features-section {
    margin-bottom: var(--space-16);
}

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

.feature-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    text-align: left;
    transition: all var(--transition-normal);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: none;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary-color);
    margin: 0 0 var(--space-4) 0;
}

.feature-icon i {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
}

.feature-card h3 {
    margin-bottom: var(--space-3);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
    font-weight: 400;
    letter-spacing: -0.01em;
}

/* ===== CTA SECTION ===== */
.cta-section {
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-xl);
    padding: var(--space-12);
    text-align: center;
    margin-bottom: var(--space-16);
}

.cta-content h2 {
    color: white;
    font-size: 2rem;
    margin-bottom: var(--space-4);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.cta-content p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    margin-bottom: var(--space-8);
    font-weight: 400;
    letter-spacing: -0.01em;
}

.cta-actions {
    display: flex;
    gap: var(--space-4);
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
    letter-spacing: -0.01em;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    padding: var(--space-4) var(--space-8);
    font-size: 1rem;
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: white; /* Ensure text remains white on hover */
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
    color: var(--text-primary); /* Ensure text remains visible on hover */
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-outline:hover {
    background: white;
    color: var(--primary-color); /* Ensure text is visible on white background */
    transform: translateY(-2px);
}

.btn-large {
    padding: var(--space-4) var(--space-8);
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: var(--space-16) var(--space-8);
}

.empty-visual {
    position: relative;
    margin-bottom: var(--space-6);
}

.empty-icon {
    font-size: 6rem;
    color: var(--text-muted);
    margin-bottom: var(--space-4);
}

.empty-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    animation: ripple 2s infinite;
}

@keyframes ripple {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.2); opacity: 0; }
}

.empty-state h3 {
    margin-bottom: var(--space-3);
    font-size: 1.75rem;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: var(--space-6);
    font-size: 1.125rem;
}

.upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
}

.upload-area input[type="file"] {
    display: none;
}

.upload-hint {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ===== MODAL ===== */
.file-upload-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.file-upload-modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: var(--bg-elevated);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
    width: 90%;
    max-width: 500px;
    transition: transform var(--transition-normal);
}

.file-upload-modal.show .modal-content {
    transform: translate(-50%, -50%) scale(1);
}

.modal-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-6);
}

.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.upload-zone:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.upload-zone i {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: var(--space-4);
}

.upload-zone h4 {
    margin-bottom: var(--space-2);
    color: var(--text-primary);
}

.upload-zone p {
    color: var(--text-secondary);
    margin: 0;
}

.upload-zone input[type="file"] {
    display: none;
}

.upload-progress {
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--space-4);
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width var(--transition-fast);
}

.progress-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ===== SEARCH SUGGESTIONS ===== */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1002;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-normal);
}

.search-suggestions.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.suggestion-item {
    padding: var(--space-3) var(--space-4);
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color var(--transition-fast);
}

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

.suggestion-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.suggestion-text {
    font-weight: 500;
    color: var(--text-primary);
}

.suggestion-type {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    text-transform: capitalize;
}

.suggestion-context {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: var(--space-2) 0;
    padding: var(--space-2);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary-color);
    line-height: 1.4;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-section {
    font-size: 0.75rem;
    color: var(--primary-color);
    background: var(--primary-light);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

/* ===== MOBILE OVERLAY ===== */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-overlay);
    z-index: 998;
        opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    }

.mobile-overlay.show {
        opacity: 1;
    visibility: visible;
}

/* ===== LOADING SPINNER ===== */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
        opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    }

.loading-spinner.show {
        opacity: 1;
    visibility: visible;
}

.spinner-content {
    text-align: center;
}

.spinner-ring {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--space-4);
}

.spinner-text {
    color: var(--text-primary);
    font-weight: 500;
}

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

/* ===== RESPONSIVE DESIGN ===== */

/* Large screens and above */
@media (min-width: 1400px) {
    .hero-section {
        max-width: 1200px;
        margin: 0 auto var(--space-16);
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .hero-description {
        font-size: 1.5rem;
        max-width: 700px;
    }
    
    .content-wrapper {
        max-width: 1400px;
        margin: 0 auto;
    }
}

@media (max-width: 1024px) {
    .sidebar-logo {
        transform: translateX(-100%); /* Hide logo with sidebar on mobile */
    }
    
    .sidebar-logo.show {
        transform: translateX(0); /* Show logo when sidebar is shown */
    }
    
    .sidebar {
        transform: translateX(-100%); /* Hide sidebar on mobile by default */
    }
    
    .sidebar.show {
        transform: translateX(0); /* Show sidebar when toggled */
    }
    
    .sidebar-toggle {
        display: block; /* Show toggle button on mobile */
    }
    
    .sidebar-close {
        display: block; /* Show close button on mobile */
    }
    
    .content-area {
        margin-left: 0; /* Remove left margin on mobile */
    }
    
    .nav-center {
        margin: 0 var(--space-4);
    }
    
    /* Hero section improvements for tablets */
    .hero-section {
        flex-direction: column;
        text-align: center;
        gap: var(--space-8);
        padding: var(--space-12) 0;
        align-items: center;
        justify-content: center;
    }
    
    .hero-content {
        max-width: 100%;
        text-align: center;
        order: 1;
    }
    
    .hero-title {
        font-size: 2.5rem;
        margin-bottom: var(--space-4);
    }
    
    .hero-description {
        font-size: 1.125rem;
        max-width: 600px;
        margin: 0 auto var(--space-6);
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .hero-visual {
        min-width: 250px;
        order: 2;
        margin-bottom: var(--space-4);
    }
    
    .hero-graphic {
        width: 250px;
        height: 250px;
    }
    
    .graphic-element {
        width: 70px;
        height: 70px;
        font-size: 1.75rem;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0 var(--space-4);
    }
    
    .nav-center {
        display: none;
    }
    
    .brand-subtitle {
        display: none;
    }
    
    .content-wrapper {
        padding: var(--space-4);
    }
    
    .sidebar-logo {
        width: 100%;
    }
    
    .sidebar {
        width: 100%;
    }
    
    /* Enhanced mobile hero section */
    .hero-section {
        padding: var(--space-6) 0;
        gap: var(--space-6);
        flex-direction: column;
        text-align: center;
        align-items: center;
        justify-content: flex-start;
    }
    
    .hero-content {
        padding: 0 var(--space-4);
        order: 2;
        width: 100%;
    }
    
    .hero-badge {
        font-size: 0.75rem;
        padding: var(--space-2) var(--space-3);
        margin-bottom: var(--space-4);
    }
    
    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: var(--space-4);
    }
    
    .hero-description {
        font-size: 1rem;
        line-height: 1.5;
        margin-bottom: var(--space-6);
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
    
    .hero-actions .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .hero-visual {
        min-width: 200px;
        order: 1; /* Move visual above content on mobile */
        margin-bottom: var(--space-4);
    }
    
    .hero-graphic {
        width: 200px;
        height: 200px;
    }
    
    .graphic-element {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    /* Enhanced mobile stats */
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: var(--space-3);
    }
    
    .stat-card {
        padding: var(--space-3);
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .stat-number {
        font-size: 1.25rem;
    }
    
    .stat-label {
        font-size: 0.875rem;
    }
    
    /* Enhanced mobile grids */
    .documents-grid {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }
    
    .cta-actions {
        flex-direction: column;
        align-items: center;
        gap: var(--space-3);
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 var(--space-3);
    }
    
    .brand-title {
        font-size: 1.25rem;
    }
    
    .content-wrapper {
        padding: var(--space-3);
    }
    
    /* Ultra-mobile hero section */
    .hero-section {
        padding: var(--space-4) 0;
        gap: var(--space-4);
        flex-direction: column;
        text-align: center;
        align-items: center;
        justify-content: flex-start;
    }
    
    .hero-content {
        padding: 0 var(--space-3);
        order: 2;
        width: 100%;
    }
    
    .hero-badge {
        font-size: 0.75rem;
        padding: var(--space-1) var(--space-3);
        margin-bottom: var(--space-3);
    }
    
    .hero-title {
        font-size: 1.75rem;
        line-height: 1.1;
        margin-bottom: var(--space-3);
    }
    
    .hero-description {
        font-size: 0.875rem;
        line-height: 1.4;
        margin-bottom: var(--space-4);
    }
    
    .hero-actions .btn {
        max-width: 100%;
        padding: var(--space-3) var(--space-4);
        font-size: 1rem;
    }
    
    .hero-visual {
        min-width: 150px;
        order: 1;
        margin-bottom: var(--space-3);
    }
    
    .hero-graphic {
        width: 150px;
        height: 150px;
    }
    
    .graphic-element {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    /* Ultra-mobile stats */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--space-2);
    }
    
    .stat-card {
        padding: var(--space-3);
        text-align: center;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        margin: 0 auto var(--space-2);
    }
    
    .stat-number {
        font-size: 1.25rem;
        margin-bottom: var(--space-1);
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    /* Ultra-mobile navigation */
    .nav-container {
        padding: 0 var(--space-2);
    }
    
    .brand-icon {
        width: 100px;
        height: 30px;
    }
}

/* Very small mobile devices */
@media (max-width: 320px) {
    .hero-section {
        padding: var(--space-3) 0;
        gap: var(--space-3);
    }
    
    .hero-content {
        padding: 0 var(--space-2);
    }
    
    .hero-badge {
        font-size: 0.7rem;
        padding: var(--space-1) var(--space-2);
        margin-bottom: var(--space-2);
    }
    
    .hero-title {
        font-size: 1.5rem;
        line-height: 1.1;
        margin-bottom: var(--space-2);
    }
    
    .hero-description {
        font-size: 0.8rem;
        line-height: 1.3;
        margin-bottom: var(--space-3);
    }
    
    .hero-actions .btn {
        padding: var(--space-2) var(--space-3);
        font-size: 0.9rem;
    }
    
    .hero-visual {
        min-width: 120px;
    }
    
    .hero-graphic {
        width: 120px;
        height: 120px;
    }
    
    .graphic-element {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .content-wrapper {
        padding: var(--space-2);
    }
}

/* Additional mobile optimizations */
@media (max-width: 768px) {
    /* Improve touch targets */
    .btn, .sidebar-link, .nav-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Better spacing for mobile */
    .section-header {
        padding: var(--space-3) var(--space-4);
    }
    
    .sidebar-nav li {
        margin-bottom: var(--space-2);
    }
    
    .sidebar-link {
        padding: var(--space-3) var(--space-4);
    }
    
    /* Mobile-friendly search */
    .search-container {
        max-width: 100%;
        margin: 0 var(--space-4);
    }
    
    .search-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* Mobile-friendly cards */
    .stat-card, .document-card, .feature-card {
        margin-bottom: var(--space-3);
    }
}

/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }

.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }

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

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

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

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

.slide-in-left {
    animation: slideInLeft 0.3s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

/* ===== SCROLLBAR STYLING ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

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

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

/* ===== FOCUS VISIBLE ===== */
*:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

/* ===== SELECTION ===== */
::selection {
    background: var(--primary-light);
    color: var(--primary-dark);
}

::-moz-selection {
    background: var(--primary-light);
    color: var(--primary-dark);
} 

/* ===== CONTENT SPACING OPTIMIZATION ===== */

/* Reduce gaps between main sections */
.hero-section {
    padding: var(--space-12) 0; /* Reduced from var(--space-16) */
    margin-bottom: var(--space-12); /* Reduced from var(--space-16) */
}

.stats-section {
    margin-bottom: var(--space-12); /* Reduced from var(--space-16) */
}

.documents-section {
    margin-bottom: var(--space-12); /* Reduced from var(--space-16) */
}

.features-section {
    margin-bottom: var(--space-12); /* Reduced from var(--space-16) */
}

/* Make stats grid use more horizontal space */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Reduced minmax from 250px */
    gap: var(--space-6); /* Reduced from var(--space-8) */
    margin-bottom: var(--space-8);
}

/* Make documents grid use more horizontal space */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); /* Reduced minmax from 400px */
    gap: var(--space-6); /* Reduced from var(--space-8) */
}

/* Make features grid use more horizontal space */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Reduced minmax from 300px */
    gap: var(--space-6); /* Reduced from var(--space-8) */
} 

/* ===== DOCUMENT IMAGES ===== */
.image-container {
    margin: var(--space-4) 0;
    text-align: center;
    background: transparent; /* Ensure no background behind images */
}

.document-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    background: transparent; /* Ensure images maintain transparency */
    background-color: transparent; /* Force transparency */
}

.document-image:hover {
    transform: scale(1.02);
    transition: transform var(--transition-fast);
}

/* Responsive image handling */
@media (max-width: 768px) {
    .document-image {
        max-width: 100%;
        margin: 0 auto;
    }
}

/* Ensure all images maintain transparency */
.section-content img,
.document-image,
.image-container img {
    background: transparent !important;
    background-color: transparent !important;
}

/* Additional transparency rules for maximum compatibility */
img[class*="document-image"],
img[class*="image"],
.image-container img,
.section-content img {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
}

/* Ensure image containers don't add backgrounds */
.image-container {
    background: transparent !important;
    background-color: transparent !important;
}

/* Override any browser default image styles */
img {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
}

/* Ensure all buttons have proper text contrast on hover */
button:hover,
.btn:hover,
.nav-btn:hover,
.sidebar-link:hover,
.action-card:hover {
    color: inherit !important; /* Preserve text color on hover */
}

/* Force text visibility for primary buttons on hover */
.btn-primary:hover,
.nav-btn:hover,
.search-box button:hover {
    color: white !important; /* Ensure white text on dark backgrounds */
}

/* ===== THEME TOGGLE - Fixed for light theme visibility ===== */
.theme-toggle {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: var(--space-3);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    /* Force visibility in light theme */
    opacity: 1 !important;
    visibility: visible !important;
    /* Add shadow for better contrast */
    box-shadow: var(--shadow-sm);
    /* Ensure proper sizing */
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: var(--primary-light);
    color: var(--primary-color);
    transform: scale(1.05);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.theme-toggle:active {
    transform: scale(0.95);
}

/* Force theme toggle visibility in light mode */
[data-theme="light"] .theme-toggle {
    color: var(--text-primary) !important;
    background: var(--bg-primary) !important;
    border: 2px solid var(--border-color) !important;
    box-shadow: var(--shadow-sm) !important;
    /* Add stronger contrast */
    filter: contrast(1.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .theme-toggle:hover {
    background: var(--primary-light) !important;
    color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    box-shadow: var(--shadow-md) !important;
    filter: contrast(1.5);
}

/* Ensure theme toggle icon is always visible */
.theme-toggle i {
    opacity: 1 !important;
    visibility: visible !important;
    font-size: 1.25rem;
    /* Add text shadow for better contrast */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ===== THEME MENU - Fixed text visibility for all options ===== */
.theme-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-2);
    margin-top: var(--space-2);
    min-width: 120px;
    z-index: 1000;
    /* Force visibility */
    opacity: 1 !important;
    visibility: visible !important;
    display: block;
}

.theme-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-2) var(--space-3);
    color: var(--text-primary) !important;
    background: var(--bg-primary) !important;
    border: none !important;
    width: 100%;
    text-align: left;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    /* Force text visibility */
    opacity: 1 !important;
    visibility: visible !important;
    font-weight: 500;
    font-size: 0.875rem;
}

.theme-option:hover {
    background: var(--primary-light) !important;
    color: var(--primary-color) !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.theme-option.active {
    background: var(--primary-light) !important;
    color: var(--primary-color) !important;
    opacity: 1 !important;
    visibility: visible !important;
    font-weight: 600;
}

/* Specific styling for each theme option to ensure visibility */
.theme-option[data-theme="light"] {
    color: var(--text-primary) !important;
    background: var(--bg-primary) !important;
}

.theme-option[data-theme="light"]:hover {
    background: var(--primary-light) !important;
    color: var(--primary-color) !important;
}

.theme-option[data-theme="light"].active {
    background: var(--primary-light) !important;
    color: var(--primary-color) !important;
}

.theme-option[data-theme="dark"] {
    color: var(--text-primary) !important;
    background: var(--bg-primary) !important;
}

.theme-option[data-theme="dark"]:hover {
    background: var(--primary-light) !important;
    color: var(--primary-color) !important;
}

.theme-option[data-theme="dark"].active {
    background: var(--primary-light) !important;
    color: var(--primary-color) !important;
}

.theme-option[data-theme="system"] {
    color: var(--text-primary) !important;
    background: var(--bg-primary) !important;
}

.theme-option[data-theme="system"]:hover {
    background: var(--primary-light) !important;
    color: var(--primary-color) !important;
}

.theme-option[data-theme="system"].active {
    background: var(--primary-light) !important;
    color: var(--primary-color) !important;
}

/* Force all theme option text to be visible */
.theme-option span,
.theme-option .theme-name,
.theme-option .theme-label {
    color: inherit !important;
    opacity: 1 !important;
    visibility: visible !important;
    font-weight: inherit !important;
}

/* Theme option icons */
.theme-option i {
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-left: var(--space-2);
    opacity: 1 !important;
    visibility: visible !important;
}

.theme-option:hover i {
    color: var(--primary-color);
}

.theme-option.active i {
    color: var(--primary-color);
}

/* Additional visibility enforcement for theme options */
.theme-option * {
    color: inherit !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Ensure text contrast in all states */
.theme-option,
.theme-option:hover,
.theme-option:active,
.theme-option:focus {
    color: var(--text-primary) !important;
    background: var(--bg-primary) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.theme-option:hover {
    color: var(--primary-color) !important;
    background: var(--primary-light) !important;
    text-shadow: 0 1px 2px rgba(99, 102, 241, 0.2);
}

.theme-option.active {
    color: var(--primary-color) !important;
    background: var(--primary-light) !important;
    text-shadow: 0 1px 2px rgba(99, 102, 241, 0.3);
}

/* Force visibility for specific theme option text */
.theme-option[data-theme="dark"] {
    color: var(--text-primary) !important;
    background: var(--bg-primary) !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    font-weight: 600;
}

.theme-option[data-theme="dark"]:hover {
    color: var(--primary-color) !important;
    background: var(--primary-light) !important;
    text-shadow: 0 1px 3px rgba(99, 102, 241, 0.4);
}

.theme-option[data-theme="dark"].active {
    color: var(--primary-color) !important;
    background: var(--primary-light) !important;
    text-shadow: 0 1px 3px rgba(99, 102, 241, 0.5);
}

/* ===== SIDEBAR LINKS - Fixed hover text visibility ===== */
.sidebar-link {
    display: block;
    padding: var(--space-2) var(--space-3);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-1);
    transition: all 0.2s ease;
    /* Force visibility */
    opacity: 1 !important;
    visibility: visible !important;
    background: none;
    border: none;
}

.sidebar-link:hover {
    background: var(--primary-light);
    color: var(--primary-color) !important;
    transform: translateX(4px);
    border-left: 3px solid var(--primary-color);
    /* Force text visibility on hover */
    opacity: 1 !important;
    visibility: visible !important;
    /* Add shadow for better contrast */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.sidebar-link.active {
    background: var(--primary-light);
    color: var(--primary-color) !important;
    border-left: 3px solid var(--primary-color);
    /* Force text visibility */
    opacity: 1 !important;
    visibility: visible !important;
}

.sidebar-link i {
    margin-right: var(--space-2);
    /* Force icon visibility */
    opacity: 1 !important;
    visibility: visible !important;
}

/* ===== SEARCH RESULTS - Improved styling ===== */
.results-header {
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 2px solid var(--border-color);
}

.results-header h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--space-2);
    /* Force visibility */
    opacity: 1 !important;
    visibility: visible !important;
}

.results-header p {
    color: var(--text-secondary);
    font-size: 1rem;
    /* Force visibility */
    opacity: 1 !important;
    visibility: visible !important;
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.result-type {
    background: var(--accent-light);
    color: var(--accent-color);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.result-section {
    background: var(--primary-light);
    color: var(--primary-color);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.result-location {
    background: var(--success-light);
    color: var(--success-color);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

/* ===== NO RESULTS & SUGGESTED SECTIONS ===== */
.no-results {
    text-align: center;
    padding: var(--space-8);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

/* ===== ADVANCED SEARCH RESULTS ===== */
.search-results {
    margin-top: var(--space-8);
}

.search-result {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-4);
    transition: all var(--transition-fast);
}

.search-result:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(255, 7, 188, 0.1);
}

.result-header {
    margin-bottom: var(--space-4);
}

.result-title {
    margin: 0 0 var(--space-2) 0;
}

.result-title .result-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 600;
    transition: color var(--transition-fast);
}

.result-title .result-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.result-meta {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.result-meta span {
    background: var(--bg-tertiary);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.result-content {
    margin-bottom: var(--space-4);
}

.result-context {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.result-context mark {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 0 var(--space-1);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.result-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-color);
}

.result-url {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.result-url:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.result-relevance {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
}

/* Search Loading */
.search-loading {
    text-align: center;
    padding: var(--space-12);
}

.search-loading .loading-spinner {
    margin-bottom: var(--space-4);
}

.search-loading p {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

/* Search Error */
.search-error {
    text-align: center;
    padding: var(--space-12);
}

.search-error i {
    font-size: 3rem;
    color: var(--text-danger);
    margin-bottom: var(--space-4);
}

.search-error h3 {
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.search-error p {
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
}

.search-error button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.search-error button:hover {
    background: var(--primary-hover);
}

/* Search result error state */
.search-result.error {
    border-color: var(--text-danger);
    background: rgba(239, 68, 68, 0.05);
}

.search-result.error .result-title {
    color: var(--text-danger);
}

.no-results h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--space-3);
    /* Force visibility */
    opacity: 1 !important;
    visibility: visible !important;
}

.no-results p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: var(--space-6);
    /* Force visibility */
    opacity: 1 !important;
    visibility: visible !important;
}

.suggested-sections h4 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-4);
    /* Force visibility */
    opacity: 1 !important;
    visibility: visible !important;
}

.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-3);
    max-width: 600px;
    margin: 0 auto;
}

.section-grid .section-link {
    background: var(--bg-primary);
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
    /* Force visibility */
    opacity: 1 !important;
    visibility: visible !important;
}

.section-grid .section-link:hover {
    background: var(--primary-light);
    color: var(--primary-color) !important;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    /* Force text visibility on hover */
    opacity: 1 !important;
    visibility: visible !important;
}

/* ===== BUTTON SIZES ===== */
.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: 0.8rem;
}

.btn-lg {
    padding: var(--space-4) var(--space-6);
    font-size: 1.1rem;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .result-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-1);
    }
    
    .section-grid {
        grid-template-columns: 1fr;
        gap: var(--space-2);
    }
    
    .results-header h3 {
        font-size: 1.25rem;
    }
    
    .no-results {
        padding: var(--space-6);
    }
} 

 