/* ═══════════════════════════════════════════════════════════
   TrackTheSpraying.com - Main Stylesheet
   Dark atmospheric theme with sky/aviation aesthetics
   ═══════════════════════════════════════════════════════════ */

/* ─── CSS Variables ──────────────────────────────────────── */
:root {
    --bg-primary: #0a0f1a;
    --bg-secondary: #131b2e;
    --bg-tertiary: #1a2340;
    --bg-card: #151d32;
    --bg-input: #0d1220;

    --accent-primary: #3b82f6;
    --accent-hover: #2563eb;
    --accent-light: #60a5fa;
    --accent-glow: rgba(59, 130, 246, 0.15);

    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --border-color: #1e293b;
    --border-light: #2d3a52;

    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #22c55e;
    --success-hover: #16a34a;
    --warning: #f59e0b;
    --warning-hover: #d97706;
    --info: #3b82f6;

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);

    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', monospace;

    --header-height: 64px;
    --sidebar-width: 260px;
}

/* ─── Reset & Base ───────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

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

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

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

img {
    max-width: 100%;
    height: auto;
}

/* ─── Container ──────────────────────────────────────────── */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ─── Header ─────────────────────────────────────────────── */
.site-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.1rem;
}

.logo:hover {
    color: var(--text-primary);
}

.logo-img {
    height: 40px;
    width: auto;
}

.logo-text {
    white-space: nowrap;
}

/* ─── Navigation ─────────────────────────────────────────── */
.main-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link {
    color: var(--text-secondary);
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

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

.nav-link--cta {
    background: var(--accent-primary);
    color: #fff !important;
}

.nav-link--cta:hover {
    background: var(--accent-hover);
    color: #fff !important;
}

.nav-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

/* ─── Dropdown ───────────────────────────────────────────── */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    padding: 0.5rem 0;
    z-index: 1001;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: all 0.2s;
}

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

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

/* ─── Mobile Menu ────────────────────────────────────────── */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    position: relative;
    transition: 0.3s;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: 0.3s;
}

.hamburger::before { top: -7px; }
.hamburger::after { top: 7px; }

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border-color);
        flex-direction: column;
        padding: 1rem;
        gap: 0.5rem;
    }

    .main-nav.open {
        display: flex;
    }

    .nav-link {
        width: 100%;
        justify-content: center;
    }

    .nav-dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        background: var(--bg-tertiary);
        border-radius: var(--radius-md);
    }

    .logo-text {
        display: none;
    }
}

/* ─── Language Switcher ──────────────────────────────────── */
.lang-toggle {
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

/* ─── Flash Messages ─────────────────────────────────────── */
.flash-container {
    position: fixed;
    top: calc(var(--header-height) + 1rem);
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 400px;
}

.flash {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    box-shadow: var(--shadow-lg);
    animation: flashSlideIn 0.3s ease;
}

@keyframes flashSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.flash--success { background: #052e16; border: 1px solid var(--success); color: #bbf7d0; }
.flash--error   { background: #2a0a0a; border: 1px solid var(--danger);  color: #fecaca; }
.flash--warning { background: #2a1a00; border: 1px solid var(--warning); color: #fed7aa; }
.flash--info    { background: #0a1a3a; border: 1px solid var(--info);    color: #bfdbfe; }

.flash-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.7;
    margin-left: auto;
}

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

/* ─── Main Content ───────────────────────────────────────── */
.main-content {
    min-height: calc(100vh - var(--header-height) - 200px);
}

/* ─── Cards ──────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

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

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
}

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.4;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--accent-primary);
    color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; }

.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); }

.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover { background: var(--danger-hover); color: #fff; }

.btn-success {
    background: var(--success);
    color: #fff;
}
.btn-success:hover { background: var(--success-hover); color: #fff; }

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

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

/* ─── Forms ──────────────────────────────────────────────── */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

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

.form-error {
    font-size: 0.8rem;
    color: var(--danger);
    margin-top: 0.25rem;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.form-input.is-invalid,
.form-textarea.is-invalid {
    border-color: var(--danger);
}

/* ─── File Upload ────────────────────────────────────────── */
.file-upload {
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.file-upload:hover {
    border-color: var(--accent-primary);
    background: var(--accent-glow);
}

.file-upload-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.file-upload-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.file-upload-preview {
    max-width: 300px;
    margin: 1rem auto 0;
    border-radius: var(--radius-md);
    display: none;
}

.file-upload-preview.show {
    display: block;
}

/* ─── Auth Pages ─────────────────────────────────────────── */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    background-image: radial-gradient(ellipse at top, rgba(59, 130, 246, 0.08) 0%, transparent 60%);
}

.auth-container {
    width: 100%;
    max-width: 440px;
    padding: 2rem 1rem;
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo img {
    height: 80px;
    width: auto;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    text-align: center;
}

.auth-subtitle {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.btn-google {
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
    width: 100%;
    padding: 0.75rem;
    font-weight: 500;
}

.btn-google:hover {
    background: #f5f5f5;
    color: #333;
}

.btn-google svg {
    width: 20px;
    height: 20px;
}

.auth-links {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ─── Map Page ───────────────────────────────────────────── */
.map-page {
    display: flex;
    height: calc(100vh - var(--header-height));
    position: relative;
}

#map {
    flex: 1;
    height: 100%;
    z-index: 1;
}

/* ─── Map Filter Sidebar ─────────────────────────────────── */
.map-sidebar {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 320px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 999;
    max-height: calc(100% - 2rem);
    overflow-y: auto;
    transition: transform 0.3s;
}

.map-sidebar.collapsed {
    transform: translateX(calc(-100% - 1rem));
}

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

.map-sidebar-title {
    font-weight: 600;
    font-size: 1rem;
}

.map-sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
}

.map-sidebar-body {
    padding: 1rem;
}

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

.map-sidebar .form-label {
    font-size: 0.8rem;
}

.map-sidebar .form-input {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

.map-sidebar-actions {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.map-sidebar-actions .btn {
    flex: 1;
    font-size: 0.85rem;
}

.map-toggle-btn {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 998;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
    box-shadow: var(--shadow-md);
    display: none;
}

.map-sidebar.collapsed ~ .map-toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Map stats bar */
.map-stats {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    z-index: 998;
    box-shadow: var(--shadow-md);
}

/* Map submit CTA */
.map-cta {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 998;
}

.map-cta .btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.5);
    animation: ctaPulse 2s ease-in-out infinite;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.map-cta .btn svg {
    width: 20px;
    height: 20px;
}

@keyframes ctaPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(59, 130, 246, 0.5); }
    50% { box-shadow: 0 4px 30px rgba(59, 130, 246, 0.8), 0 0 60px rgba(59, 130, 246, 0.3); }
}

/* ─── Mobile CTA Banner ─────────────────────────────────── */
.mobile-cta-banner {
    display: none;
}

@media (max-width: 768px) {
    /* Map fills the screen MINUS header and the fixed CTA bar */
    .map-page {
        height: calc(100vh - var(--header-height) - 60px);
        overflow: hidden;
    }

    #map {
        height: 100%;
    }

    /* Hide the desktop floating CTA on mobile */
    .map-cta {
        display: none;
    }

    /* Hide footer on homepage mobile — map is the full page */
    .site-footer {
        display: none;
    }

    /* Fixed CTA bar at the very bottom of the screen — always visible */
    .mobile-cta-banner {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: var(--bg-secondary);
        border-top: 2px solid var(--accent-primary);
        padding: 0.5rem 1rem;
        height: 60px;
    }

    .mobile-cta-banner .btn {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.625rem 2rem;
        font-size: 1rem;
        font-weight: 700;
        border-radius: 50px;
        box-shadow: 0 4px 20px rgba(59, 130, 246, 0.5);
        animation: ctaPulse 2s ease-in-out infinite;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        white-space: nowrap;
    }

    .mobile-cta-banner .btn svg {
        width: 20px;
        height: 20px;
    }

    .mobile-cta-tagline {
        display: none;
    }

    /* Sidebar becomes a bottom sheet — sits above the CTA bar */
    .map-sidebar {
        position: absolute;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 55vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        overflow-y: auto;
    }

    .map-sidebar.collapsed {
        transform: translateY(100%);
    }

    /* Compact form fields on mobile */
    .map-sidebar .map-sidebar-header {
        padding: 0.625rem 0.75rem;
    }

    .map-sidebar .map-sidebar-body {
        padding: 0.5rem 0.75rem;
    }

    .map-sidebar .form-group {
        margin-bottom: 0.5rem;
    }

    .map-sidebar .form-label {
        font-size: 0.7rem;
        margin-bottom: 0.15rem;
    }

    .map-sidebar .form-input {
        padding: 0.35rem 0.5rem;
        font-size: 0.8rem;
    }

    .map-sidebar .form-hint {
        font-size: 0.7rem;
        margin-top: 0.15rem;
    }

    .map-sidebar-actions {
        padding: 0.5rem 0.75rem;
    }

    /* Filter toggle moves to top-left, smaller */
    .map-toggle-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }

    /* Stats bar: smaller, bottom-left, above the CTA bar */
    .map-stats {
        bottom: 0.5rem;
        left: 0.5rem;
        transform: none;
        font-size: 0.75rem;
        padding: 0.35rem 0.75rem;
    }
}

/* ─── Leaflet Popup Styling ──────────────────────────────── */
.leaflet-popup-content-wrapper {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-lg) !important;
}

.leaflet-popup-tip {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
}

.leaflet-popup-close-button {
    color: var(--text-secondary) !important;
}

.map-popup {
    min-width: 220px;
    max-width: 280px;
}

.map-popup .popup-thumb {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
}

.map-popup h4 {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.map-popup .popup-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.map-popup .popup-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.map-popup .popup-link {
    font-size: 0.85rem;
    font-weight: 500;
}

/* ─── Report Pages ───────────────────────────────────────── */
.report-page {
    padding: 2rem 0;
}

.report-detail {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    margin-top: 1.5rem;
}

.report-photo {
    width: 100%;
    border-radius: var(--radius-lg);
    cursor: pointer;
}

.report-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin: 1rem 0;
}

.report-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.report-meta-item svg {
    color: var(--accent-primary);
}

.report-description {
    margin-top: 1.5rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.report-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.report-sidebar .card {
    margin-bottom: 1rem;
}

.report-mini-map {
    height: 200px;
    border-radius: var(--radius-md);
    margin-top: 0.75rem;
}

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

/* ─── Report Submit Form ─────────────────────────────────── */
.submit-page {
    padding: 2rem 0;
}

.submit-form {
    max-width: 800px;
    margin: 0 auto;
}

.submit-map {
    height: 400px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.location-fields {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 640px) {
    .location-fields {
        grid-template-columns: 1fr;
    }
}

.date-time-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ─── Profile Page ───────────────────────────────────────── */
.profile-page {
    padding: 2rem 0;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-primary);
}

.profile-avatar-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--text-muted);
    border: 3px solid var(--border-color);
}

.profile-info h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.profile-stats {
    display: flex;
    gap: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ─── Blog Pages ─────────────────────────────────────────── */
.blog-page {
    padding: 2rem 0;
}

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

.blog-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.blog-header p {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.blog-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
}

.blog-posts {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.blog-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.blog-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.blog-card-body {
    padding: 1.25rem;
}

.blog-card-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.blog-card-title a {
    color: var(--text-primary);
}

.blog-card-title a:hover {
    color: var(--accent-light);
}

.blog-card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.blog-card-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.blog-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: var(--bg-tertiary);
    color: var(--accent-light);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.tag:hover {
    background: var(--accent-primary);
    color: #fff;
}

/* Blog Sidebar */
.blog-sidebar .card {
    margin-bottom: 1rem;
}

.blog-sidebar .tag {
    margin-bottom: 0.25rem;
}

/* Blog Single Post */
.blog-post {
    max-width: 800px;
    margin: 0 auto;
}

.blog-post-header {
    margin-bottom: 2rem;
}

.blog-post-header h1 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.blog-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.blog-post-featured {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

.blog-post-body {
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--text-secondary);
}

.blog-post-body h2 { font-size: 1.5rem; margin: 2rem 0 1rem; color: var(--text-primary); }
.blog-post-body h3 { font-size: 1.25rem; margin: 1.5rem 0 0.75rem; color: var(--text-primary); }
.blog-post-body p { margin-bottom: 1rem; }
.blog-post-body ul, .blog-post-body ol { margin-bottom: 1rem; padding-left: 1.5rem; }
.blog-post-body li { margin-bottom: 0.25rem; }
.blog-post-body blockquote {
    border-left: 3px solid var(--accent-primary);
    padding: 0.5rem 1rem;
    margin: 1rem 0;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.blog-post-body img {
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.blog-post-body .screenshot-caption {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: -1rem;
    margin-bottom: 1.5rem;
}

.blog-post-body .step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--accent-primary);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
    margin-right: 0.5rem;
    flex-shrink: 0;
}
.blog-post-body code {
    background: var(--bg-tertiary);
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.85em;
}
.blog-post-body pre {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 1rem 0;
}
.blog-post-body pre code {
    background: none;
    padding: 0;
}

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

.comment {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.comment-body {
    flex: 1;
}

.comment-author {
    font-weight: 600;
    font-size: 0.9rem;
}

.comment-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

.comment-text {
    margin-top: 0.25rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

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

/* ─── Section Headers ────────────────────────────────────── */
.section-header {
    text-align: center;
    padding: 2rem 0 1rem;
}

.section-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

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

/* ─── Footer ─────────────────────────────────────────────── */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

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

.footer-logo img {
    height: 48px;
    margin-bottom: 1rem;
}

.footer-about {
    color: var(--text-muted);
    font-size: 0.9rem;
    max-width: 360px;
}

.footer-section h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.footer-links a:hover {
    color: var(--accent-light);
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-about {
        max-width: 100%;
    }
}

/* ─── Error Pages ────────────────────────────────────────── */
.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: 2rem;
}

.error-code {
    font-size: 6rem;
    font-weight: 800;
    color: var(--accent-primary);
    line-height: 1;
    margin-bottom: 1rem;
}

.error-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.error-message {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 500px;
}

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

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.pagination-btn:hover:not(.disabled):not(.pagination-current) {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.pagination-current {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
}

.pagination-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-ellipsis {
    color: var(--text-muted);
    padding: 0 0.25rem;
}

/* ─── Tables ─────────────────────────────────────────────── */
.table-wrapper {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

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

.table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr:hover {
    background: var(--bg-tertiary);
}

/* ─── Badges ─────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.badge-danger  { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-info    { background: rgba(59, 130, 246, 0.15); color: var(--info); }

/* ─── Modal ──────────────────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-lg);
}

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

.modal-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* ─── Utility Classes ────────────────────────────────────── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.d-flex { display: flex; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.hidden { display: none !important; }
