/* =============================================================================
   CLEAN PROFESSIONAL THEME
   Timeless, trustworthy SaaS design with light backgrounds and soft colors
   ============================================================================= */

/* =============================================================================
   COLOR PALETTE
   ============================================================================= */
:root {
    /* Light backgrounds */
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-hover: #e2e8f0;

    /* Ocean blue-green brand colors */
    --primary-color: #0891b2;
    --primary-hover: #0e7490;
    --primary-light: #cffafe;

    /* Accent colors */
    --accent-green: #10b981;
    --accent-amber: #f59e0b;
    --accent-red: #ef4444;
    --accent-blue: #3b82f6;

    /* Semantic colors */
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;

    /* Text colors */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;  /* Changed from #94a3b8 for better contrast (WCAG AA) */

    /* Borders */
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.10);
    --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.12);

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    /* Responsive breakpoints (for reference in media queries) */
    --breakpoint-mobile: 480px;
    --breakpoint-tablet: 768px;
    --breakpoint-desktop: 1024px;
}

/* =============================================================================
   ACCESSIBILITY UTILITIES
   ============================================================================= */

/* Screen reader only - visually hidden but accessible to assistive technology */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip link visible on focus (already in base.html, but ensure style exists) */
.skip-link:focus {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 10000;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    outline: 3px solid var(--accent-amber);
    clip: auto;
    width: auto;
    height: auto;
}

/* =============================================================================
   GLOBAL STYLES
   ============================================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    background: linear-gradient(180deg, #f8fafc 0%, #e0f2fe 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Lists - Restore spacing after CSS reset */
ul, ol {
    margin-left: 20px;
    margin-top: 10px;
    margin-bottom: 15px;
    padding-left: 20px;
    list-style-position: outside;
}

ul {
    list-style-type: disc;
}

ol {
    list-style-type: decimal;
}

li {
    margin-bottom: 8px;
    line-height: 1.6;
    display: list-item;
}

/* Nested lists get extra indentation */
ul ul, ol ul, ul ol, ol ol {
    margin-top: 8px;
    margin-bottom: 8px;
    margin-left: 10px;
}

/* Spacing between paragraph and list */
p + ul, p + ol {
    margin-top: 12px;
}

/* Colored list markers */
ul li::marker {
    color: var(--primary-color);
}

ol li::marker {
    color: var(--primary-color);
    font-weight: 600;
}

/* Spinner animation - used by upload and review pages */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =============================================================================
   NAVIGATION BAR
   ============================================================================= */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-sm) 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.navbar-menu {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover {
    background: var(--bg-hover);
    color: var(--primary-color);
}

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

/* =============================================================================
   BUTTONS
   ============================================================================= */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-green));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

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

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-md);
}

/* =============================================================================
   CONTAINER & CARDS
   ============================================================================= */
.container {
    max-width: 1200px;
    margin: var(--spacing-xl) auto;
    padding: 0 var(--spacing-md);
}

.card {
    background: #ffffff;  /* Pure white */
    border-radius: var(--radius-lg);
    border: 2px solid #cbd5e1;  /* Stronger border */
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);  /* Much stronger shadow */
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);  /* Stronger on hover */
    border-color: #94a3b8;
}

/* =============================================================================
   FLASH MESSAGES
   ============================================================================= */
.flash-messages {
    position: fixed;
    top: 80px;
    right: var(--spacing-md);
    z-index: 1000;
    max-width: 400px;
}

.alert {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left: 6px solid;
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.5;
}

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

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-color: var(--accent-green);
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-color: var(--accent-amber);
    font-weight: 600;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border-color: var(--accent-red);
    border-width: 0 0 0 6px;
    border-style: solid;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.25);
}

.alert-info {
    background: #cffafe;  /* Teal instead of blue */
    color: #0e7490;      /* Darker teal text */
    border-color: var(--primary-color);  /* Use primary teal color */
}

.alert-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
}

.alert-close:hover {
    opacity: 1;
}

/* =============================================================================
   HERO SECTION
   ============================================================================= */
.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    letter-spacing: -1px;
}

.hero p {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
}

/* =============================================================================
   FEATURE CARDS
   ============================================================================= */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.feature-card {
    background: #f8fafc;  /* Subtle gray like upload page */
    border: 2px solid #cbd5e1;  /* Keep strong border */
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);  /* Strong shadow */
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    border-color: var(--primary-color);
    background: #ffffff;  /* Brighten on hover */
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-sm);
}

.feature-card h3 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
    font-weight: 700;
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* =============================================================================
   DASHBOARD STYLES
   ============================================================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.stat-card {
    background: #f8fafc;  /* Subtle gray like upload page */
    border: 2px solid #cbd5e1;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
    background: #ffffff;  /* Brighten on hover */
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-xs);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* =============================================================================
   FOOTER
   ============================================================================= */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-lg) 0;
    margin-top: var(--spacing-xl);
    text-align: center;
    color: var(--text-secondary);
}

/* =============================================================================
   RESPONSIVE UTILITY CLASSES
   ============================================================================= */
/* Hide on mobile (below 768px) */
@media (max-width: 767px) {
    .hide-mobile { display: none !important; }
}

/* Hide on desktop (768px and above) */
@media (min-width: 768px) {
    .hide-desktop { display: none !important; }
}

/* Hide on very small screens (below 480px) */
@media (max-width: 479px) {
    .hide-xs { display: none !important; }
}

/* =============================================================================
   HAMBURGER MENU
   ============================================================================= */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-primary);
    font-size: 1.5rem;
    line-height: 1;
    z-index: 1001;
}

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

/* Mobile nav styles */
@media (max-width: 767px) {
    /* Make navbar fixed on mobile for reliable sticky behavior */
    .navbar {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
    }

    /* Add padding to body to account for fixed navbar */
    body {
        padding-top: 60px; /* Approximate navbar height */
    }

    .hamburger-btn {
        display: block;
    }

    .navbar-container {
        position: relative;
    }

    .navbar-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: var(--spacing-sm);
        box-shadow: var(--shadow-lg);
        border-top: 1px solid var(--border-color);
        gap: 0;
        z-index: 1000;
    }

    .navbar-menu.open {
        display: flex;
    }

    .navbar-menu .nav-link {
        padding: var(--spacing-sm) var(--spacing-md);
        border-bottom: 1px solid var(--border-color);
        width: 100%;
        text-align: center;
    }

    .navbar-menu .nav-link:last-of-type {
        border-bottom: none;
    }

    .navbar-menu .user-email {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.85rem;
        color: var(--text-muted);
        border-top: 1px solid var(--border-color);
        width: 100%;
        text-align: center;
    }

    .navbar-menu .btn {
        margin: var(--spacing-sm);
        text-align: center;
    }

    .navbar-menu .btn-outline {
        width: calc(100% - 2rem);
    }
}

/* =============================================================================
   RESPONSIVE DESIGN
   ============================================================================= */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .card {
        padding: var(--spacing-md);
    }

    .flash-messages {
        left: var(--spacing-sm);
        right: var(--spacing-sm);
        max-width: none;
    }

    .container {
        padding: 0 var(--spacing-sm);
        margin: var(--spacing-lg) auto;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.75rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .card {
        padding: var(--spacing-sm);
    }

    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.9rem;
    }
}

/* =============================================================================
   UPLOAD SECTION STYLES
   ============================================================================= */
.upload-section {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.upload-section h3 {
    color: #0891b2;
    margin-top: 0;
}

.upload-help {
    color: #666;
    margin-bottom: 1.5rem;
}

.upload-form {
    max-width: 500px;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.form-group select,
.form-group input[type="file"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group select:focus,
.form-group input[type="file"]:focus {
    outline: none;
    border-color: #0891b2;
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: #666;
    font-size: 0.875rem;
}

.btn-primary {
    background: #0891b2;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #0e7490;
}
