/* WhatAreTheBest.com - Main Stylesheet */
/* Modern, responsive design with black/white theme and blue accents */

/* Admin Page Fixes - Ensure proper styling */
.admin-section,
.admin-table,
.admin-table th,
.admin-table td {
    background: #ffffff !important;
    color: #333333 !important;
}

/* Admin container styling - exclude header */
.admin-container:not(.admin-header) {
    background: #ffffff !important;
    color: #333333 !important;
}

/* Override for admin header container */
.admin-header .admin-container {
    background: transparent !important;
    color: white !important;
}

.admin-table th,
.admin-table td {
    border-color: #dee2e6 !important;
}

:root {
    --primary-color: #1e3a8a;
    --primary-light: #3b82f6;
    --primary-dark: #1e40af;
    --secondary-color: #64748b;
    --accent-color: #06b6d4;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-dark: #111827;
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --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);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

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

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

/* Layout */
.container {
    max-width: 80%;
    width: 80%;
    margin: 0 auto;
    padding: 0 1rem;
}

.container-fluid {
    width: 100%;
    padding: 0 1rem;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    padding: 0.5rem 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    position: relative;
    overflow: visible;
}

.header-content .logo {
    flex-shrink: 0;
}

.header-content .nav {
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.logo:hover {
    text-decoration: none;
    color: white;
}

.logo img {
    height: 60px;
    width: auto;
    background: transparent;
}

.site-title {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    text-align: center;
}

.site-title h1 {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: -0.025em;
}

/* Navigation */
.nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    position: relative;
}

.nav-menu {
    position: relative;
}

.nav-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: opacity 0.2s ease;
    /* iOS touch fixes */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.nav-toggle:hover {
    opacity: 0.8;
}

.nav-toggle-label {
    font-size: 0.875rem;
    font-weight: 500;
}

.nav-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) translateX(0);
    transition: all 0.3s ease;
    z-index: 1000;
    border: 1px solid var(--border-color);
    display: none;
    /* iOS touch fixes */
    -webkit-overflow-scrolling: touch;
    -webkit-transform: translateY(-10px) translateX(0);
    -webkit-transition: all 0.3s ease;
}

.nav-dropdown.active {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) translateX(0) !important;
    -webkit-transform: translateY(0) translateX(0) !important;
    display: block !important;
    position: fixed !important; /* Use fixed positioning */
    z-index: 9999 !important; /* Ensure it's on top */
    background: white !important;
    border: 1px solid #e5e7eb !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
    min-width: 200px !important;
    border-radius: 8px !important;
}

.nav-dropdown a {
    display: block;
    padding: 0.75rem 1rem;
    color: #1f2937;
    border-bottom: 1px solid var(--border-light);
    font-weight: 500;
    transition: all 0.2s ease;
    background-color: white;
}

.nav-dropdown a:last-child {
    border-bottom: none;
}

.nav-dropdown a:hover {
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
}

/* Breadcrumb */
.breadcrumb {
    background: var(--bg-secondary);
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 80px;
    z-index: 90;
    overflow-x: auto;
    white-space: nowrap;
}

.breadcrumb-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}


.breadcrumb-item a {
    color: white !important;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--accent-color) !important;
    text-decoration: underline;
}

.breadcrumb-item.current {
    color: white !important;
    font-weight: 500;
}

/* Refined options */
.refined-options {
    background: var(--bg-primary);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.refined-options h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 0.5rem;
}

.refined-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.refined-links a {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.refined-links a:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    text-decoration: none;
}

/* Main content */
.main {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

/* Category grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Call to Action Section */
.cta-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    padding: 4rem 2rem;
    border-radius: var(--radius-lg);
    margin: 2rem 0;
    text-align: center;
}

.cta-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: white;
}

.cta-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.9);
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-buttons .btn {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
}

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

.cta-buttons .btn-outline:hover {
    background: white;
    color: var(--primary-color);
}

.category-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

/* Vibrant alternating gradients for randomized tiles */
.category-grid .category-card:nth-child(8n+1) { background: linear-gradient(135deg, #dbeafe, #eaf2ff) !important; border-color: transparent !important; color: #111827 !important; }
.category-grid .category-card:nth-child(8n+2) { background: linear-gradient(135deg, #ccfbf1, #d1fae5) !important; border-color: transparent !important; color: #111827 !important; }
.category-grid .category-card:nth-child(8n+3) { background: linear-gradient(135deg, #ede9fe, #ddd6fe) !important; border-color: transparent !important; color: #111827 !important; }
.category-grid .category-card:nth-child(8n+4) { background: linear-gradient(135deg, #fee2e2, #fecaca) !important; border-color: transparent !important; color: #111827 !important; }
.category-grid .category-card:nth-child(8n+5) { background: linear-gradient(135deg, #d1fae5, #a7f3d0) !important; border-color: transparent !important; color: #111827 !important; }
.category-grid .category-card:nth-child(8n+6) { background: linear-gradient(135deg, #e0f2fe, #bfdbfe) !important; border-color: transparent !important; color: #111827 !important; }
.category-grid .category-card:nth-child(8n+7) { background: linear-gradient(135deg, #fef3c7, #fde68a) !important; border-color: transparent !important; color: #111827 !important; }
.category-grid .category-card:nth-child(8n+8) { background: linear-gradient(135deg, #e0e7ff, #c7d2fe) !important; border-color: transparent !important; color: #111827 !important; }

.category-grid .category-card:nth-child(n) .category-title,
.category-grid .category-card:nth-child(n) .category-description { color: #111827 !important; }
.category-grid .category-card:nth-child(n) .category-icon { background: rgba(255,255,255,0.75) !important; color: #1f2937 !important; }

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
    color: inherit;
}

/* Colored category cards when a color is provided */
.category-card[data-color] {
    background: var(--category-color);
    border-color: transparent;
    color: #ffffff;
}

.category-card[data-color] .category-title,
.category-card[data-color] .category-description {
    color: #ffffff;
}

.category-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.category-card[data-color] .category-icon {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.category-card[data-color]:hover {
    filter: brightness(0.92);
}

.category-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

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

/* Product list */
.product-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.product-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.product-card:hover {
    box-shadow: var(--shadow-md);
}

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

.product-rank {
    background: var(--primary-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.product-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.product-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.product-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.pros-cons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pros-cons h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.pros {
    color: var(--success-color);
}

.cons {
    color: var(--error-color);
}

.pros-cons ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pros-cons li {
    font-size: 0.875rem;
    padding: 0.25rem 0;
    position: relative;
    padding-left: 1rem;
}

.pros-cons li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: inherit;
}

.product-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
    text-decoration: none;
}

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

.btn-secondary:hover {
    background: var(--border-color);
    color: var(--text-primary);
    text-decoration: none;
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
    text-decoration: none;
}

/* Comments section */
.comments-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

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

.comment-form {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1f2937;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.captcha-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment-item {
    background: white;
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.comment-text {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-light);
}

.comment-actions {
    display: flex;
    gap: 0.5rem;
}

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

.flag-btn:hover {
    color: var(--error-color);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.pagination a:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    text-decoration: none;
}

.pagination .current {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Footer */
.footer {
    background: var(--bg-dark);
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: white;
    margin-bottom: 1rem;
}

.footer-section a {
    color: var(--text-light);
    text-decoration: none;
    display: block;
    padding: 0.25rem 0;
}

.footer-section a:hover {
    color: white;
    text-decoration: underline;
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 1rem;
    text-align: center;
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Utility classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.hidden { display: none; }
.visible { display: block; }

/* Responsive design */
@media (max-width: 768px) {
    .container {
        max-width: 100%;
        width: 100%;
        padding: 0 0.75rem;
    }
    
    .header {
        padding: 0.4rem 0;
    }
    
    .header-content {
        flex-wrap: nowrap;
        gap: 0.5rem;
    }
    
    .search-container {
        margin: 0 0.5rem;
        max-width: 300px;
    }
    
    .logo img {
        height: 50px;
        background: transparent;
    }
    
    .site-title {
        flex: 1;
        text-align: center;
    }
    
    .site-title h1 {
        font-size: 1.25rem;
        font-weight: 700;
    }
    
    
    .nav {
        order: 3;
        flex-shrink: 0;
    }
    
    .nav-toggle {
        display: flex;
        padding: 0.25rem;
    }
    
    .nav-toggle-label {
        display: none;
    }
    
    .nav-dropdown {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 0 0 12px 12px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
        min-width: auto;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.3s ease;
        z-index: 1000;
        padding: 0.5rem;
    }
    
    .nav-dropdown.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .nav-dropdown a {
        color: white;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        font-weight: 500;
        background-color: transparent;
        text-align: center;
        padding: 0.75rem 1rem;
        border-radius: 6px;
        margin-bottom: 0.25rem;
        transition: all 0.3s ease;
    }
    
    .nav-dropdown a:last-child {
        border-bottom: none;
        margin-bottom: 0;
    }
    
    .nav-dropdown a:hover {
        background-color: rgba(255, 255, 255, 0.2);
        color: white;
        transform: none;
    }
    
    .breadcrumb {
        position: static;
    }
    
    .breadcrumb-content {
        font-size: 0.75rem;
    }
    
    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .product-details {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .product-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn {
        justify-content: center;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.25rem; }
}

@media (max-width: 480px) {
    .header {
        padding: 0.3rem 0;
    }
    
    .logo img {
        height: 45px;
        background: transparent;
    }
    
    .site-title h1 {
        font-size: 1.1rem;
    }
    
    .nav-dropdown {
        min-width: auto;
        right: 0;
        left: 0;
        padding: 0.25rem;
    }
    
    .nav-dropdown a {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .category-card {
        padding: 1rem;
    }
    
    .product-card {
        padding: 1rem;
    }
    
    .product-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .product-rank {
        align-self: flex-start;
    }
}

/* Print styles */
@media print {
    .header,
    .breadcrumb,
    .refined-options,
    .comments-section,
    .footer {
        display: none;
    }
    
    .main {
        padding: 0;
    }
    
    .product-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Admin Styles */
.admin-container {
    max-width: 90%;
    width: 90%;
    margin: 0 auto;
    padding: 2rem;
}

.admin-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    color: white;
    padding: 0;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 1rem;
    position: relative;
}

.admin-nav-brand h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #60a5fa 0%, #93c5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.025em;
}

.admin-nav-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.admin-nav-links a {
    color: #cbd5e1;
    text-decoration: none;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

.admin-nav-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1) 0%, rgba(147, 197, 253, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 8px;
}

.admin-nav-links a:hover {
    color: #ffffff;
    background: rgba(96, 165, 250, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.2);
    text-decoration: none;
}

.admin-nav-links a:hover::before {
    opacity: 1;
}

.admin-nav-links a.active {
    color: #ffffff;
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

.admin-nav-links a.active::before {
    opacity: 0;
}

.admin-nav-links .logout {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    color: white;
    margin-left: 1rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.admin-nav-links .logout:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.admin-nav-links .logout::before {
    display: none;
}

/* Admin Mobile Navigation Toggle */
.admin-nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background 0.3s ease;
    align-items: center;
    gap: 0.5rem;
}

.admin-nav-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.admin-nav-toggle svg {
    width: 24px;
    height: 24px;
}

.admin-nav-toggle-label {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Login Styles */
body.login-page {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-container {
    max-width: 400px;
    width: 100%;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    animation: slideUp 0.6s ease-out;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: var(--radius-lg);
    pointer-events: none;
}

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

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 2rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.login-header p {
    color: #374151;
    font-size: 1rem;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.login-header::before {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    margin: 0 auto 1rem;
    border-radius: 2px;
}

.error-message {
    background: #fef2f2;
    color: #dc2626;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    border: 1px solid #fecaca;
    font-weight: 500;
}

.back-link {
    text-align: center;
    margin-top: 1rem;
}

.back-link a {
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

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

/* Admin Dashboard Styles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.stat-card h3 {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-card .stat-change {
    font-size: 0.875rem;
    color: var(--success-color);
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.admin-section {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.admin-section h2 {
  margin-bottom: 1rem;
  color: #000000;
}

.recent-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
}

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

.recent-item-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.recent-item-meta {
    font-size: 0.875rem;
    color: var(--text-light);
}

.btn-danger {
    background: var(--error-color);
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #dc2626;
    color: white;
}

.error-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-light);
}

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

.error-message-text {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    background: var(--bg-secondary);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    margin-top: 0.5rem;
}

/* Admin Table Styles */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.admin-table th,
.admin-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.admin-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
}

.admin-table tr:hover {
    background: var(--bg-secondary);
}

/* Admin Button Styles */
.btn-add {
    background: var(--success-color);
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.btn-add:hover {
    background: #059669;
    color: white;
    text-decoration: none;
}

.btn-edit {
    background: var(--warning-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border: none;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.875rem;
    transition: background-color 0.2s ease;
}

.btn-edit:hover {
    background: #d97706;
    color: white;
    text-decoration: none;
}

.btn-delete {
    background: var(--error-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border: none;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.875rem;
    transition: background-color 0.2s ease;
}

.btn-delete:hover {
    background: #dc2626;
    color: white;
}

.btn-view {
    background: var(--secondary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border: none;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.875rem;
    transition: background-color 0.2s ease;
}

.btn-view:hover {
    background: #475569;
    color: white;
    text-decoration: none;
}

.status-active {
    color: var(--success-color);
    font-weight: 500;
}

.status-inactive {
    color: var(--text-light);
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fef2f2;
    color: #dc2626;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    border: 1px solid #fecaca;
}

/* Directory Generator Styles */
.status-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.status-success {
    background: #f0fdf4;
    border-color: #22c55e;
    color: #166534;
}

.status-error {
    background: #fef2f2;
    border-color: #ef4444;
    color: #dc2626;
}

.directory-list {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.directory-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
    font-family: var(--font-mono);
    font-size: 0.875rem;
}

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

.directory-level-1 {
    font-weight: 600;
    color: var(--primary-color);
}

.directory-level-2 {
    padding-left: 1rem;
    color: var(--text-secondary);
}

.directory-level-3 {
    padding-left: 2rem;
    color: var(--text-light);
}


.btn-generate:disabled {
    background: var(--text-light);
    cursor: not-allowed;
}

.btn-generate {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-generate:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    color: white;
    text-decoration: none;
}

.status-success {
    color: #059669;
    font-weight: 600;
    background: rgba(16, 185, 129, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #1e40af;
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
}

.generation-controls {
    margin: 1rem 0;
}

.debug-info {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
}

.debug-info h3 {
    margin-top: 0;
    color: #475569;
}

.debug-info p {
    margin: 0.5rem 0;
    color: #64748b;
}

.category-hierarchy {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
}

.category-hierarchy h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #374151;
    font-size: 1rem;
    font-weight: 600;
}

#category-path {
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 12px;
    width: 95%;
    max-width: 1200px;
    height: 90vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    padding: 20px 25px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.copy-all-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.copy-all-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.4);
}

.copy-all-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.copy-all-btn .copy-icon {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.copy-all-btn .copy-text {
    transition: all 0.3s ease;
}

/* Copy All Success Animation */
.copy-all-btn.copy-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    animation: copyAllSuccessPulse 0.6s ease-out;
}

.copy-all-btn.copy-success .copy-icon {
    transform: scale(1.2) rotate(360deg);
}

.copy-all-btn.copy-success .copy-text {
    font-weight: 600;
}

/* Copy All Error Animation */
.copy-all-btn.copy-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    animation: copyAllErrorShake 0.6s ease-out;
}

.copy-all-btn.copy-error .copy-icon {
    transform: scale(1.1);
}

.copy-all-btn.copy-error .copy-text {
    font-weight: 600;
}

/* Copy All Keyframe Animations */
@keyframes copyAllSuccessPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 12px rgba(16, 185, 129, 0.5);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
    }
}

@keyframes copyAllErrorShake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-2px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(2px);
    }
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.close:hover {
    opacity: 1;
}

.modal-body {
    padding: 25px;
    flex: 1;
    overflow-y: auto;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #f9fafb;
    border-radius: 0 0 12px 12px;
    flex-shrink: 0;
}

.modal-footer button {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* JSON Display Styles */
.json-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    height: 100%;
    min-height: 500px;
}

.json-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.json-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.json-section h4 {
    margin: 0;
    color: #1e40af;
    font-size: 1.1rem;
    font-weight: 600;
}

.copy-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.copy-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
}

.copy-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.copy-icon {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.copy-text {
    transition: all 0.3s ease;
}

/* Copy Success Animation */
.copy-btn.copy-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    animation: copySuccessPulse 0.6s ease-out;
}

.copy-btn.copy-success .copy-icon {
    transform: scale(1.2) rotate(360deg);
}

.copy-btn.copy-success .copy-text {
    font-weight: 600;
}

/* Copy Error Animation */
.copy-btn.copy-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    animation: copyErrorShake 0.6s ease-out;
}

.copy-btn.copy-error .copy-icon {
    transform: scale(1.1);
}

.copy-btn.copy-error .copy-text {
    font-weight: 600;
}

/* Keyframe Animations */
@keyframes copySuccessPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 12px rgba(16, 185, 129, 0.5);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
    }
}

@keyframes copyErrorShake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-2px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(2px);
    }
}

.json-code {
    background: #1e293b;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    overflow: auto;
    flex: 1;
    white-space: pre-wrap;
    word-wrap: break-word;
    border: 1px solid #334155;
}

.json-code::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.json-code::-webkit-scrollbar-track {
    background: #334155;
    border-radius: 4px;
}

.json-code::-webkit-scrollbar-thumb {
    background: #64748b;
    border-radius: 4px;
}

.json-code::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 98%;
        height: 95vh;
        margin: 1% auto;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 15px 20px;
    }
    
    .json-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .json-code {
        font-size: 12px;
        padding: 12px;
    }
}

/* Responsive Admin Styles */
@media (max-width: 768px) {
    .admin-nav {
        flex-direction: row;
        align-items: center;
        padding: 0.5rem;
        gap: 1rem;
        justify-content: space-between;
    }
    
    .admin-nav-toggle {
        display: flex;
    }
    
    .admin-nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
        flex-direction: column;
        gap: 0.25rem;
        width: 100%;
        padding: 0.5rem;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
        border-radius: 0 0 12px 12px;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.3s ease;
        z-index: 9999;
        display: flex;
    }
    
    .admin-nav-links.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .admin-nav-links a {
        padding: 0.75rem;
        font-size: 0.9rem;
        text-align: center;
        border-radius: 6px;
        background: rgba(255, 255, 255, 0.1);
        margin-bottom: 0.25rem;
        color: white;
    }

    .admin-nav-brand h1 {
        font-size: 1.25rem;
        text-align: left;
        margin-bottom: 0;
    }
    
    .admin-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .admin-container {
        max-width: 100%;
        width: 100%;
        padding: 0.5rem;
        margin: 0;
    }
    
    .admin-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .admin-section h2 {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }
    
    .admin-table {
        font-size: 0.8rem;
        overflow-x: auto;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 0.5rem 0.25rem;
        white-space: nowrap;
    }
    
    .admin-table th {
        font-size: 0.75rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        margin: 0.25rem;
    }
    
    .btn-small {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-input,
    .form-textarea,
    .form-select {
        padding: 0.75rem;
        font-size: 1rem;
    }
    
    .login-container {
        margin: 0.5rem;
        padding: 1rem;
        width: calc(100% - 1rem);
    }
    
    body.login-page {
        padding: 0.5rem;
    }
    
    /* Specific admin page improvements */
    .admin-page-header {
        padding: 1rem 0.5rem;
        text-align: center;
    }
    
    .admin-page-title {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .admin-page-description {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    /* Table responsive improvements */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table-responsive table {
        min-width: 600px;
    }
    
    /* Modal improvements */
    .modal-content {
        margin: 1rem;
        width: calc(100% - 2rem);
        max-height: calc(100vh - 2rem);
    }
    
    /* Search and filter improvements */
    .search-container {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .search-input {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .filter-buttons {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .filter-btn {
        flex: 1;
        min-width: calc(50% - 0.125rem);
        text-align: center;
    }
}

/* Additional mobile improvements for very small screens */
@media (max-width: 480px) {
    .admin-container {
        padding: 0.25rem;
    }
    
    .admin-nav-links a {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    .admin-table {
        font-size: 0.7rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 0.25rem;
    }
    
    .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .admin-page-title {
        font-size: 1.25rem;
    }
    
    .admin-section h2 {
        font-size: 1.1rem;
    }
    
    .modal-content {
        margin: 0.5rem;
        width: calc(100% - 1rem);
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
        --text-light: #9ca3af;
        --bg-primary: #111827;
        --bg-secondary: #1f2937;
        --border-color: #374151;
        --border-light: #4b5563;
    }
    
    .category-card,
    .product-card,
    .comment-item {
        background: var(--bg-secondary);
        border-color: var(--border-color);
    }
    
    .form-input,
    .form-textarea {
        background: var(--bg-secondary);
        border-color: var(--border-color);
        color: var(--text-primary);
    }
    
    .admin-section,
    .stat-card,
    .directory-list {
        background: var(--bg-secondary);
        border-color: var(--border-color);
    }
}

/* New OpenAI Logs Table Styles */
.search-container {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 400px;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-icon {
    position: absolute;
    left: 12px;
    color: #6b7280;
    font-size: 1.2rem;
    pointer-events: none;
}

.logs-table-container {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.logs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.logs-table thead {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

.logs-table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.logs-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: top;
}

.logs-table tbody tr:hover {
    background: #f9fafb;
}

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

.category-cell {
    min-width: 200px;
}

.category-link {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    display: block;
    margin-bottom: 8px;
    transition: color 0.2s ease;
}

.category-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.log-status {
    margin-top: 8px;
}

.status-success {
    background: #d1fae5;
    color: #065f46;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

.status-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

.datetime-cell {
    min-width: 150px;
}

.datetime {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.9rem;
}

.time {
    color: #6b7280;
    font-size: 0.8rem;
    margin-top: 2px;
}

.processing-time {
    color: #059669;
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 4px;
}

.json-cell {
    min-width: 200px;
    position: relative;
}

.toggle-json-btn {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
}

.toggle-json-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.4);
}

.toggle-json-btn.active {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.btn-text {
    font-size: 0.8rem;
}

.btn-icon {
    font-size: 0.9rem;
}

.json-content {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1f2937;
    border-radius: 8px;
    padding: 16px;
    margin-top: 8px;
    z-index: 10;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
}

.json-code {
    background: transparent;
    color: #f9fafb;
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 0.75rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
    overflow-x: auto;
}

.no-response {
    color: #6b7280;
    font-style: italic;
    font-size: 0.9rem;
}

/* Responsive Design for Logs Table */
@media (max-width: 1200px) {
    .logs-table {
        font-size: 0.8rem;
    }
    
    .logs-table th,
    .logs-table td {
        padding: 12px 16px;
    }
    
    .category-cell,
    .json-cell {
        min-width: 150px;
    }
}

@media (max-width: 768px) {
    .logs-table-container {
        overflow-x: auto;
    }
    
    .logs-table {
        min-width: 600px;
    }
    
    .json-content {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90vw;
        height: 70vh;
        max-height: none;
    }
}

/* Category Management Styles */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.level-toggle-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.level-label {
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
}

.level-toggles {
    display: flex;
    gap: 0.5rem;
}

.level-toggle {
    padding: 8px 16px;
    border: 2px solid #d1d5db;
    background: white;
    color: #374151;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.level-toggle:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.level-toggle.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.level-section {
    margin-bottom: 2rem;
}

.level-section h3 {
    color: #1f2937;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.category-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

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

.category-header h4 {
    margin: 0;
    color: #1f2937;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
}

.level-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.level-badge.level-1 {
    background: #dbeafe;
    color: #1e40af;
}

.level-badge.level-2 {
    background: #dcfce7;
    color: #166534;
}

.level-badge.level-3 {
    background: #fef3c7;
    color: #92400e;
}

.category-info {
    margin-bottom: 1.5rem;
}

.category-slug {
    color: #6b7280;
    font-size: 0.9rem;
    font-family: 'Courier New', monospace;
    margin: 0.5rem 0;
    background: #f9fafb;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}

.parent-category {
    color: #6b7280;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.category-stats {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.stat {
    font-size: 0.85rem;
    color: #6b7280;
}

.stat strong {
    color: #374151;
    font-weight: 600;
}

.category-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.category-actions .btn {
    font-size: 0.8rem;
    padding: 6px 12px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.category-actions .btn-primary {
    background: #3b82f6;
    color: white;
}

.category-actions .btn-primary:hover {
    background: #2563eb;
}

.category-actions .btn-secondary {
    background: #6b7280;
    color: white;
}

.category-actions .btn-secondary:hover {
    background: #4b5563;
}

.category-actions .btn-generate {
    background: #10b981;
    color: white;
}

.category-actions .btn-generate:hover {
    background: #059669;
}

.category-actions .btn-danger {
    background: #ef4444;
    color: white;
}

.category-actions .btn-danger:hover {
    background: #dc2626;
}

/* Responsive Design for Category Cards */
@media (max-width: 1200px) {
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 1rem;
    }
}

/* iPhone Safari fixes: ensure 2 columns and dark text/icons on small screens */
@media (max-width: 480px) {
    /* Force two columns on small screens */
    .category-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Target iOS Safari specifically */
@supports (-webkit-touch-callout: none) {
    /* Force light gradients and dark text on iOS as well */
    .category-grid .category-card:nth-child(8n+1) { background: linear-gradient(135deg, #dbeafe, #eaf2ff) !important; color: #111827 !important; }
    .category-grid .category-card:nth-child(8n+2) { background: linear-gradient(135deg, #ccfbf1, #d1fae5) !important; color: #111827 !important; }
    .category-grid .category-card:nth-child(8n+3) { background: linear-gradient(135deg, #ede9fe, #ddd6fe) !important; color: #111827 !important; }
    .category-grid .category-card:nth-child(8n+4) { background: linear-gradient(135deg, #fee2e2, #fecaca) !important; color: #111827 !important; }
    .category-grid .category-card:nth-child(8n+5) { background: linear-gradient(135deg, #d1fae5, #a7f3d0) !important; color: #111827 !important; }
    .category-grid .category-card:nth-child(8n+6) { background: linear-gradient(135deg, #e0f2fe, #bfdbfe) !important; color: #111827 !important; }
    .category-grid .category-card:nth-child(8n+7) { background: linear-gradient(135deg, #fef3c7, #fde68a) !important; color: #111827 !important; }
    .category-grid .category-card:nth-child(8n+8) { background: linear-gradient(135deg, #e0e7ff, #c7d2fe) !important; color: #111827 !important; }
    .category-grid .category-card:nth-child(n) .category-title,
    .category-grid .category-card:nth-child(n) .category-description,
    .category-grid .category-card:nth-child(n) .category-icon { color: #1f2937 !important; }
    .category-grid .category-card:nth-child(n) .category-icon { background: rgba(255,255,255,0.75) !important; }
}


@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .level-toggle-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .level-toggles {
        flex-wrap: wrap;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .category-card {
        padding: 1rem;
    }
    
    .category-actions {
        flex-direction: column;
    }
    
    .category-actions .btn {
        width: 100%;
        text-align: center;
    }
}

/* Table Sorting Styles */
.sortable {
    position: relative;
    user-select: none;
}

.sort-indicator {
    font-size: 0.8rem;
    color: #6b7280;
    margin-left: 0.25rem;
    transition: color 0.2s ease;
}

.sortable:hover .sort-indicator {
    color: #3b82f6;
}

.sortable[data-direction="asc"] .sort-indicator,
.sortable[data-direction="desc"] .sort-indicator {
    color: #3b82f6;
    font-weight: bold;
}

/* Inline Loading Spinner */
.loading-spinner-inline {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f4f6;
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

.loading-text {
    color: #6b7280;
    font-size: 0.875rem;
    vertical-align: middle;
}

.status-error {
    color: #dc2626;
    font-weight: 500;
}

.product-count-link {
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
}

.product-count-link:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

.product-count-link:hover .status-success {
    background-color: #059669;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

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

/* Admin Page Header */
.admin-page-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.admin-page-header h1 {
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.admin-page-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Modern Task Tiles */
.tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.task-tile {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 0;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    height: 280px;
    display: flex;
    flex-direction: column;
}

.task-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.task-tile:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: var(--primary-color);
}

.task-tile:hover::before {
    transform: scaleX(1);
}

.category-tile {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

.product-tile {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.stats-tile {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.video-tile {
    background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
}

/* Charts Section */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 1rem 0;
}

.chart-container {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chart-container h3 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.chart-container canvas {
    max-height: 300px;
}

@media (max-width: 768px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

.tile-header {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.tile-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tile-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.tile-content {
    padding: 0 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.tile-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0 0 1rem 0;
}

.tile-badge {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    align-self: flex-start;
}

.category-tile .tile-badge {
    background: var(--primary-color);
}

.product-tile .tile-badge {
    background: var(--success-color);
}

.tile-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    border-top: 1px solid var(--border-light);
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    margin-top: auto;
}

.tile-action:hover {
    background: var(--primary-color);
    color: white;
    text-decoration: none;
}

.tile-action svg {
    transition: transform 0.2s ease;
}

.tile-action:hover svg {
    transform: translateX(2px);
}

/* Task Info Panel */
.task-info-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    margin-top: 3rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.info-section h3 {
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-section h3::before {
    content: 'ℹ️';
    font-size: 1.1rem;
}

.info-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-section li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
    position: relative;
    padding-left: 2rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.info-section li:last-child {
    border-bottom: none;
}

.info-section li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.1rem;
}

/* ========================================
   SEARCH FUNCTIONALITY STYLES
   ======================================== */

/* Desktop Search Container */
.search-container {
    flex: 1;
    max-width: 400px;
    margin: 0 1rem;
    position: relative;
}

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

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%) !important;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.search-input-wrapper:focus-within {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%) !important;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.search-input-wrapper:focus-within .search-input {
    color: white !important;
    background: transparent !important;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: white !important;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    color: white !important;
}

.search-input:not(:placeholder-shown) {
    color: white !important;
}

.search-input[value]:not([value=""]) {
    color: white !important;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.8) !important;
}


.search-input-wrapper:focus-within .search-input::placeholder {
    color: rgba(255, 255, 255, 0.8) !important;
}

.search-button {
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: white !important;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-input-wrapper:focus-within .search-button {
    color: white !important;
}

.search-button:hover {
    color: var(--accent-color) !important;
}

/* Search Results Dropdown */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%) !important;
    border: 1px solid var(--primary-dark);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    margin-top: 0.25rem;
}

.search-results.show {
    display: block;
}

.search-result-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.search-result-item:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.search-result-item .result-icon {
    color: white !important;
    flex-shrink: 0;
}

.search-result-item .result-content {
    flex: 1;
}

.search-result-item .result-name {
    font-weight: 500;
    color: white !important;
    margin-bottom: 0.25rem;
}

.search-result-item .result-type {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8) !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-no-results {
    padding: 1rem;
    text-align: center;
    color: white !important;
    font-style: italic;
}

/* Mobile Search Toggle */
.search-toggle {
    display: none;
    padding: 0.5rem;
    border: none;
    background: transparent;
    color: white;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.search-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Mobile Search Modal */
.search-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.search-modal.show {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1rem;
}

.search-modal-content {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

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

.search-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.search-modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
}

.search-modal-close {
    padding: 0.5rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.search-modal-close:hover {
    background: var(--border-light);
    color: var(--text-primary);
}

.search-modal-form {
    padding: 1.5rem;
}

.search-modal-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.search-modal-input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.search-modal-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
}

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

.search-modal-button {
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-modal-button:hover {
    color: var(--primary-dark);
}

.search-modal-results {
    margin-top: 1rem;
    max-height: 300px;
    overflow-y: auto;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%) !important;
    border: 1px solid var(--primary-dark);
    border-radius: var(--radius-md);
    display: none;
}

.search-modal-results.show {
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .desktop-search {
        display: none;
    }
    
    .search-toggle {
        display: block;
    }
    
    .header-content {
        justify-content: space-between;
    }
    
    .header-content .nav {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .search-toggle {
        order: 1;
    }
    
    .nav-toggle {
        order: 2;
    }
    
    .search-modal.show {
        padding: 1rem;
    }
    
    .search-modal-content {
        max-height: 90vh;
    }
    
    .search-modal-header {
        padding: 1rem;
    }
    
    .search-modal-form {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .search-modal.show {
        padding: 0.5rem;
    }
    
    .search-modal-header h3 {
        font-size: 1.1rem;
    }
}
