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

:root {
    /* Color Palette - Premium Deep Navy & Gold */
    --primary-color: #1a2b6d;
    --primary-dark: #0f1b3d;
    --accent-blue: #2563eb;
    --secondary-color: #d4af37;
    /* Gold */
    --accent-color: #ffd700;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;

    /* Neutral Colors - Gallery Clean */
    --bg-color: #fafafa;
    --surface-color: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.05);

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --border-radius: 8px;
    --border-radius-sm: 4px;
    --transition: all 0.2s ease;

    /* Re-import fluid variables from global (optional, but good for local safety) */
    --fs-h1: clamp(2rem, 8vw, 4rem);
    --fs-h2: clamp(1.8rem, 6vw, 2.8rem);
}

body {
    font-family: var(--font-family);
    background: linear-gradient(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.8)),
        url('../images/divine-bird-bg.png') center/cover fixed no-repeat;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

/* Smooth Document Cards */
.document-card {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.document-card:hover {
    transform: translateY(-8px) scale(1.02);
    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);
}

/* ===== LAYOUT & CONTAINERS ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(10px, 3vw, 20px);
    /* Reduced horizontal padding */
}

/* ===== HEADER STYLES ===== */
/* Top Banner Styles */
.top-banner {
    background: linear-gradient(135deg, #1a2b6d 0%, #0f1b3d 100%);
    color: white;
    padding: 10px 0;
    font-size: 0.9rem;
    font-weight: 500;
    border-bottom: 2px solid var(--accent-color);
}

.top-banner .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-box {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
    background: #f8fafc;
    padding: 12px 20px;
    border-radius: 12px;
    border: 2px solid #f1f5f9;
    transition: var(--transition);
}

.filter-box i {
    color: var(--primary-color);
}

.lesson-item {
    background: white;
    padding: 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.lesson-item:hover {
    border-color: var(--secondary-color);
    box-shadow: var(--shadow);
    transform: translateX(4px);
}

.lesson-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.lesson-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.filter-label {
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

#category-filter {
    border: 1px solid var(--border-color);
    background: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: inherit;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    width: 100%;
}

/* Staggered Entrance for Document Cards */
.document-card:nth-child(1) {
    animation-delay: 0.1s;
}

.document-card:nth-child(2) {
    animation-delay: 0.2s;
}

.document-card:nth-child(3) {
    animation-delay: 0.3s;
}

.document-card:nth-child(4) {
    animation-delay: 0.4s;
}

.document-card:nth-child(5) {
    animation-delay: 0.5s;
}

.document-card:nth-child(6) {
    animation-delay: 0.6s;
}

.document-card:nth-child(n+7) {
    animation-delay: 0.7s;
}

.document-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
    /* Reduced gap */
    margin-bottom: 20px;
    /* Reduced margin */
}

@media (max-width: 992px) {
    .document-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .document-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    .document-card {
        padding: 10px !important;
    }

    .document-title {
        font-size: 0.72rem !important;
        line-height: 1.2 !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
}

@media (max-width: 400px) {
    .document-grid {
        grid-template-columns: 1fr !important;
        /* Single column for very narrow phones */
    }
}

.service-times span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.language-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
}

.language-switcher select {
    background: transparent;
    border: none;
    color: white;
    font-family: inherit;
    cursor: pointer;
    outline: none;
}

.language-switcher select option {
    background: #0f1b3d;
    color: white;
}

/* Mobile menu button styles handled by global.css */

/* Premium PDF Toolbar Styles */
.pdf-toolbar {
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    padding: 10px 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    position: sticky;
    top: 0;
    z-index: 10;
    flex-wrap: wrap;
    /* Allow wrapping on mobile */
}

.pdf-toolbar .toolbar-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pdf-toolbar .zoom-display {
    font-weight: 600;
    color: var(--primary-color);
    min-width: 60px;
    text-align: center;
}

.pdf-toolbar .nav-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.pdf-toolbar .page-info {
    font-size: 0.9rem;
    font-weight: 500;
}

/* ===== PREMIUM PDF TOOLBAR BUTTON STYLES ===== */

/* PDF Controls layout */
.pdf-controls-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Prev / Next Page buttons in toolbar */
.pdf-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--btn-radius);
    border: 2px solid #1a2b6d;
    background: white;
    color: #1a2b6d;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    min-height: var(--touch-target);
}

.pdf-nav-btn:hover:not(:disabled) {
    background: #1a2b6d;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 43, 109, 0.3);
}

.pdf-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    border-color: #ccc;
    color: #999;
}

.pdf-nav-btn i {
    font-size: 0.8rem;
}

/* Page indicator badge */
.pdf-page-badge {
    background: #f1f5f9;
    border: 1px solid #cbd5e0;
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}

/* Zoom buttons */
.pdf-zoom-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.pdf-zoom-btn:hover {
    background: #1a2b6d;
    color: white;
    border-color: #1a2b6d;
}

/* Zoom badge */
.pdf-zoom-badge {
    font-size: 0.82rem;
    font-weight: 600;
    color: #1a2b6d;
    min-width: 44px;
    text-align: center;
}

/* Download / Action button */
.pdf-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--btn-radius);
    border: none;
    background: #d4af37;
    color: #1a2b6d;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.25s ease;
    min-height: var(--touch-target);
}

.pdf-action-btn:hover {
    background: #c9a027;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

/* ===== PREMIUM MODAL FOOTER NAVIGATION ===== */
.modal-footer {
    background: #fff;
    border-top: 1px solid #e2e8f0;
    padding: 14px 24px;
}

.modal-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

/* Document Prev / Next navigation buttons */
.modal-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 22px;
    border-radius: var(--btn-radius);
    border: 2px solid #1a2b6d;
    background: white;
    color: #1a2b6d;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.3px;
    min-height: var(--touch-target);
}

.modal-nav-btn:hover:not(:disabled) {
    background: #1a2b6d;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 43, 109, 0.25);
}

.modal-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: #ccc;
    color: #aaa;
    transform: none;
    box-shadow: none;
}

.modal-nav-prev i {
    transition: transform 0.2s ease;
}

.modal-nav-prev:hover:not(:disabled) i {
    transform: translateX(-3px);
}

.modal-nav-next i {
    transition: transform 0.2s ease;
}

.modal-nav-next:hover:not(:disabled) i {
    transform: translateX(3px);
}

/* Download button in modal footer */
.modal-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 24px;
    border-radius: var(--btn-radius);
    background: #d4af37;
    color: #1a2b6d;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    min-height: var(--touch-target);
}

.modal-download-btn:hover {
    background: #c9a027;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

/* ===== NAVIGATION STYLES ===== */
/* Navigation Styles - Overridden above */

/* ===== HERO SECTION ===== */
.hero {
    text-align: center;
    padding: 1rem 0 2rem;
    /* Reduced from 2rem 0 3rem */
    background: #f1f5f9;
    color: var(--primary-color);
}

.hero h2 {
    font-size: var(--fs-h2);
    font-weight: 800;
    margin-bottom: 0.75rem;
    font-family: 'Playfair Display', serif;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ===== MAIN CONTENT ===== */
main {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    margin: -1.5rem auto 1.5rem;
    /* Reduced bottom margin from 2.5rem */
    padding: 1rem;
    /* Reduced from 1.5rem */
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    main {
        margin: 0 auto;
        padding: 1.5rem;
        border-radius: 0;
    }
}

/* ===== ARCHIVE LAYOUT WRAPPER ===== */
.archive-layout-wrapper {
    display: grid;
    grid-template-columns: 2.5fr 1fr;
    gap: 1rem;
    /* Reduced from 2rem */
    align-items: start;
}

.main-archive-content {
    flex: 1;
}

/* ===== LESSONS SIDEBAR ===== */
.lessons-sidebar {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.75rem;
    /* Reduced from 1.25rem */
    position: sticky;
    top: 100px;
    height: fit-content;
    max-height: calc(100vh - 120px);
}

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

.sidebar-header h3 i {
    color: var(--secondary-color);
}

.sidebar-search {
    position: relative;
    margin-bottom: 1.5rem;
}

.sidebar-search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.sidebar-search input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
    outline: none;
}

/* Quarter Pills for Lessons */
.quarter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem 0;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.quarter-pill {
    padding: 0.5rem 1rem;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: normal;
    text-align: center;
    flex: 1 1 auto;
}

.quarter-pill:hover {
    background: #f1f5f9;
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.quarter-pill.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(26, 43, 109, 0.2);
}

.sidebar-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Sidebar Custom Scrollbar */
.sidebar-list::-webkit-scrollbar {
    width: 4px;
}

.sidebar-list::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

/* Sidebar Document Card Adjustments */
.lessons-sidebar .document-card {
    padding: 1rem;
    background: white;
}

.lessons-sidebar .document-icon {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
}

.lessons-sidebar .document-title {
    font-size: 0.9rem;
}

/* ===== CONTROLS ===== */
.controls-wrapper {
    background: #f8fafc;
    padding: 0.5rem 1rem;
    /* Reduced from 1rem */
    border-radius: 12px;
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
    /* Reduced from 1.5rem */
    border: 2px solid #f1f5f9;
}

.search-box {
    flex: 2;
    position: relative;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
}

.search-box i {
    padding-left: 1rem;
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    font-size: 0.95rem;
    outline: none;
    background: transparent;
}

.filter-box {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0 1rem;
    position: relative;
}

.filter-box i {
    color: var(--text-muted);
}

.filter-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

#category-filter {
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    outline: none;
    padding: 0.75rem 0.5rem;
    width: 100%;
}

.filter-box::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: auto;
    color: var(--text-muted);
}

.filter-box select {
    padding: 1rem 3rem 1rem 7.5rem;
    border: none;
    background: transparent;
    font-size: 1rem;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    appearance: none;
    border-radius: var(--border-radius);
    width: 100%;
}

/* ===== LIST HEADER ===== */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    /* Reduced from 1.5rem */
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.list-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

#doc-count {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* ===== DOCUMENT GRID ===== */
.document-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    /* Reduced from 1.5rem to match top rule */
    margin-bottom: 1.5rem;
    /* Reduced from 2rem */
}

.document-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.document-card:hover {
    border-color: var(--secondary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.document-card:hover::before {
    transform: scaleX(1);
}

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

.document-icon {
    width: 44px;
    height: 44px;
    background: #f1f5f9;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--primary-color);
    transition: var(--transition);
    flex-shrink: 0;
}

.document-card:hover .document-icon {
    background: var(--primary-color);
    color: white;
}

.document-card:hover .document-icon {
    background: var(--primary-color);
    color: white;
    transform: rotate(-5deg);
}

.document-info {
    flex: 1;
    margin-left: 1rem;
}

.document-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    /* Standard property */
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    box-orient: vertical;
}

/* Sidebar No Results */
.no-results-sidebar {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9rem;
}

.document-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.document-category {
    background: var(--bg-color);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-weight: 500;
}

.document-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    opacity: 1;
    transition: var(--transition);
}

/* ===== BUTTON STYLES ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-family);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

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

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

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

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

.btn-icon {
    padding: 0.5rem;
    border-radius: 8px;
}

.btn-icon:hover {
    background: var(--bg-color);
    transform: scale(1.1);
}

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

.pagination-btn {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--text-primary);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.pagination-btn:hover:not(.disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

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

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

/* ===== MODAL STYLES ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 2rem;
}

.modal-overlay.visible {
    display: flex !important;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 1000px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

@media (max-width: 768px) {
    .modal-content {
        width: 100% !important;
        height: 100% !important;
        border-radius: 0 !important;
        max-width: none !important;
    }

    .document-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    .document-card {
        padding: 10px !important;
        min-height: auto !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
    }

    .document-title {
        font-size: 0.72rem !important;
        line-height: 1.2 !important;
        max-height: none !important;
        overflow: visible !important;
        margin-bottom: 4px !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }

    .document-category {
        font-size: 0.6rem !important;
        padding: 2px 4px !important;
    }

    .document-actions .btn {
        padding: 5px 8px !important;
        font-size: 0.65rem !important;
    }

    .document-icon {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.9rem !important;
    }

    .document-info {
        margin-left: 8px !important;
    }

    .document-category {
        font-size: 0.65rem !important;
        padding: 2px 5px !important;
    }

    .document-actions {
        margin-top: auto !important;
        gap: 6px !important;
    }

    .document-actions .btn {
        padding: 6px !important;
        font-size: 0.75rem !important;
    }

    .modal-overlay {
        padding: 0 !important;
    }

    .modal-header {
        padding: 0.75rem 1rem !important;
        background: #fff;
        z-index: 10;
        box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
    }

    .modal-body {
        flex: 1;
        -webkit-overflow-scrolling: touch;
        overflow-y: scroll;
        position: relative;
    }

    #pdf-viewer {
        height: 100% !important;
        width: 100% !important;
        display: block;
        border: none;
        overflow: auto;
    }

    .modal-footer {
        padding: 0.75rem 1rem !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center;
        background: #fff;
        z-index: 10;
        box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.1);
    }

    .modal-nav {
        flex: 1;
        display: flex;
        gap: 0.5rem;
    }

    .modal-nav button {
        flex: 1;
        padding: 0.5rem !important;
        font-size: 0.8rem;
    }

    .modal-nav button span {
        display: none;
        /* Hide text, show icons to save space */
    }

    #modal-download {
        margin-left: 0.5rem;
        padding: 0.5rem 1rem !important;
        width: auto !important;
    }
}

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

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 6px;
    transition: var(--transition);
}

.modal-close-btn:hover {
    background: var(--danger-color);
    color: white;
}

.modal-body {
    flex: 1;
    padding: 0;
    position: relative;
}

#pdf-viewer {
    width: 100%;
    height: 100%;
    border: none;
    overflow: auto;
    background: #525659;
}

.pdf-canvas-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    min-height: 100%;
}

.pdf-page-canvas {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 100%;
    height: auto !important;
    margin: 20px auto;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-color);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.modal-nav {
    display: flex;
    gap: 0.5rem;
}

/* ===== NO DOCUMENTS STATE ===== */
.no-documents {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.no-documents i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-documents h4 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

/* ===== FOOTER ===== */
.main-footer {
    background: #0f172a !important;
    /* Deep Navy - definitely no purple */
    color: white;
    padding: 40px 0 0;
    /* Reduced from 60px */
    margin-top: 2rem;
    /* Reduced from 4rem */
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 30px;
    /* Reduced from 50px */
    padding: 0 20px 20px;
    /* Reduced bottom padding */
}

.footer-logo {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.footer-logo img {
    height: 60px;
    width: auto;
    border-radius: 50%;
    margin-right: 15px;
}

.footer-logo h3 {
    font-size: 1.5rem;
    margin-bottom: 0;
    color: white;
}

.footer-desc {
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    font-size: 0.95rem;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--accent-color);
    color: var(--text-primary);
    transform: translateY(-5px);
}

.footer-col h4 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    /* Reduced from 25px */
    position: relative;
    padding-bottom: 12px;
    color: var(--accent-color);
    font-weight: 600;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--accent-color);
}

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

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: white;
    padding-left: 8px;
}

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

.footer-contact li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 18px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.95rem;
    gap: 12px;
}

.footer-contact i {
    color: var(--accent-color);
    font-size: 1rem;
    margin-top: 4px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 30px 20px;
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.loading {
    animation: pulse 2s infinite;
}

/* ===== RESPONSIVE DESIGN ===== */
/* Tablet & Medium Screens */
@media (max-width: 1024px) {
    .nav-links {
        gap: 1rem;
    }

    .nav-links a {
        padding: 8px 10px;
        font-size: 0.9rem;
    }
}

/* Mobile Navigation for Archive */
@media (max-width: 992px) {
    .archive-layout-wrapper {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }

    .lessons-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        top: 0;
        margin-bottom: 2rem;
    }

    .hero h2 {
        font-size: 2.2rem;
    }
}

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

    .filter-label {
        display: none;
    }

    .filter-box select {
        padding-left: 3rem;
    }

    .list-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

/* PDF Viewer Responsive Fixes */
.pdf-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    background: #f1f5f9;
    border-bottom: 1px solid var(--border-color);
}

.pdf-zoom-controls {
    display: flex;
    gap: 5px;
}

#pdf-page-info {
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    min-width: 100px;
    justify-content: center;
}

@media (max-width: 600px) {
    .pdf-controls {
        flex-direction: column;
        align-items: center;
    }

    .pdf-zoom-controls,
    #pdf-download {
        width: 100%;
        justify-content: center;
    }

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

.canvas-wrapper {
    touch-action: pan-x pan-y;
    /* Enable smooth touch scrolling for mobile */
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 480px) {
    .hero {
        padding: 2rem 0;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

    main {
        padding: 1.5rem;
        margin: -1rem auto 2rem;
    }

    .document-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* Dark Mode Support Removed */
/* Modal Header Actions */
.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

#modal-external {
    font-size: 1rem !important;
    padding: 8px 12px !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

@media (max-width: 768px) {
    .modal-header-actions .sr-only {
        /* On mobile, don't show the text in the tiny button */
        display: none;
    }

    .controls-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        border-right: 1px solid var(--border-color);
        /* Restore border on mobile search box */
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}