/* EduVault Theme - Modern Dashboard UI 2026 */
:root {
    /* Light Mode (Default) */
    --primary-blue: #2563eb;
    --primary-blue-light: #eff6ff;
    --hover-blue: #1d4ed8;
    --bg-gray: #f8fafc;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --border-strong: #cbd5e1;
    --danger-red: #ef4444;
    --danger-red-light: #fef2f2;
    --warning-orange: #f97316;
    --warning-orange-light: #fff7ed;
    --success-green: #10b981;
    --success-green-light: #ecfdf5;
    --sidebar-width: 260px;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* 8px Spacing System */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 32px;
    --space-8: 40px;
    --space-9: 48px;
    --space-10: 64px;
    
    /* Typography Scale */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 2rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
}

/* Dark Mode Overrides */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-gray: #0f172a;
        --sidebar-bg: #1e293b;
        --card-bg: #1e293b;
        --text-main: #f1f5f9;
        --text-secondary: #cbd5e1;
        --text-muted: #64748b;
        --border-color: #334155;
        --border-strong: #475569;
        --primary-blue-light: rgba(37, 99, 235, 0.15);
        --danger-red-light: rgba(239, 68, 68, 0.15);
        --warning-orange-light: rgba(249, 115, 22, 0.15);
        --success-green-light: rgba(16, 185, 129, 0.15);
    }
}

/* Toggle support via class */
body.dark-mode {
    --bg-gray: #0f172a;
    --sidebar-bg: #1e293b;
    --card-bg: #1e293b;
    --text-main: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border-color: #334155;
    --border-strong: #475569;
    --primary-blue-light: rgba(37, 99, 235, 0.15);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* Search Highlight */
mark {
    background: var(--warning-orange-light);
    color: var(--warning-orange);
    padding: 1px 4px;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

body {
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    background-color: var(--bg-gray);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-main);
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

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

.text-muted {
    color: var(--text-muted);
    font-size: var(--text-sm);
}

/* --- GLOBAL SIDEBAR (Dashboard Nav) --- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

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

.brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-blue), #3b82f6);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-sm);
}

.brand-text {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.025em;
}

.nav-menu {
    flex: 1;
    padding: var(--space-4) 0;
    overflow-y: auto;
}

.nav-label {
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
}

.nav-label:not(:first-child) {
    margin-top: var(--space-5);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-6);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: var(--text-sm);
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
    margin: var(--space-1) var(--space-2);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.nav-item:hover {
    background: var(--primary-blue-light);
    color: var(--primary-blue);
}

.nav-item.active {
    background: var(--primary-blue-light);
    color: var(--primary-blue);
    border-left-color: var(--primary-blue);
    font-weight: 600;
}

.user-profile {
    padding: var(--space-5) var(--space-6);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    background: var(--bg-gray);
}

.avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-blue), #3b82f6);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: var(--text-sm);
}

.user-info h4 {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: 600;
}

.user-info span {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* --- MAIN CONTENT --- */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.top-bar {
    background: var(--sidebar-bg);
    height: 72px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-7);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

/* --- SEARCH BAR --- */
.search-container {
    position: relative;
    flex: 1;
    max-width: 480px;
}

.search-bar {
    background: var(--bg-gray);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-3) var(--space-4);
    width: 100%;
    color: var(--text-main);
    font-size: var(--text-sm);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    transition: all var(--transition-fast);
    cursor: text;
}

.search-bar:focus-within {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px var(--primary-blue-light);
    background: var(--card-bg);
}

.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: var(--text-sm);
    color: var(--text-main);
    outline: none;
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.search-bar .search-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-bar .search-clear {
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-1);
    border-radius: var(--radius-sm);
    display: none;
    transition: all var(--transition-fast);
}

.search-bar .search-clear:hover {
    color: var(--text-main);
    background: var(--border-color);
}

.search-bar.has-value .search-clear {
    display: flex;
}

.search-bar .search-shortcut {
    font-size: var(--text-xs);
    color: var(--text-muted);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-family: monospace;
}

/* Search Results Dropdown */
.search-results {
    position: absolute;
    top: calc(100% + var(--space-2));
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 200;
}

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

.search-results-header {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-color);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.search-result-item:hover,
.search-result-item.active {
    background: var(--primary-blue-light);
}

.search-result-item .result-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.search-result-item .result-icon.pdf {
    background: var(--danger-red-light);
    color: var(--danger-red);
}

.search-result-item .result-icon.ppt {
    background: var(--warning-orange-light);
    color: var(--warning-orange);
}

.search-result-item .result-icon.subject {
    background: var(--primary-blue-light);
    color: var(--primary-blue);
}

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

.search-result-item .result-title {
    font-weight: 500;
    font-size: var(--text-sm);
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-item .result-subtitle {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.search-no-results {
    padding: var(--space-8) var(--space-4);
    text-align: center;
}

.search-no-results svg {
    color: var(--text-muted);
    margin-bottom: var(--space-3);
}

.search-no-results p {
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.search-loading {
    padding: var(--space-6) var(--space-4);
    text-align: center;
}

.search-loading .spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto var(--space-3);
}

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

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

.action-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    background: transparent;
    border: none;
}

.action-btn:hover {
    background: var(--bg-gray);
    color: var(--text-main);
}

.content-area {
    padding: var(--space-7);
    max-width: 1400px;
}

.page-header {
    margin-bottom: var(--space-7);
}

.page-title {
    font-size: var(--text-3xl);
    font-weight: 700;
    margin: 0 0 var(--space-2) 0;
    letter-spacing: -0.025em;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: var(--text-base);
}

.section-title {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: var(--space-5);
    color: var(--text-main);
}

/* --- CARD GRID --- */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-6);
}

.resource-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.resource-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-blue), #3b82f6);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.resource-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-strong);
}

.resource-card:hover::before {
    opacity: 1;
}

.icon-wrapper {
    width: 72px;
    height: 72px;
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    transition: transform var(--transition-base);
}

.resource-card:hover .icon-wrapper {
    transform: scale(1.05);
}

.icon-wrapper svg {
    width: 40px;
    height: 40px;
}

.icon-wrapper.icon-pdf {
    background: var(--danger-red-light);
    color: var(--danger-red);
}

.icon-wrapper.icon-ppt {
    background: var(--warning-orange-light);
    color: var(--warning-orange);
}

.card-title {
    font-weight: 600;
    font-size: var(--text-base);
    margin-bottom: var(--space-5);
    color: var(--text-main);
    line-height: 1.4;
    flex-grow: 1;
}

.resource-card > .btn-quick-view {
    width: 100%;
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    width: 100%;
}

.btn-quick-view {
    background: var(--primary-blue);
    color: white;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    flex: 1;
    min-width: 0;
    text-align: center;
    transition: all var(--transition-fast);
    border: none;
    cursor: pointer;
    line-height: 1.4;
}

.btn-quick-view:hover {
    background: var(--hover-blue);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-download-pdf {
    background: transparent;
    color: var(--primary-blue);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    border: 1px solid var(--primary-blue);
    flex: 1;
    min-width: 0;
    text-align: center;
    transition: all var(--transition-fast);
    cursor: pointer;
    line-height: 1.4;
}

.btn-download-pdf:hover {
    background: var(--primary-blue);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Button Variants */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
    border: none;
    cursor: pointer;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--hover-blue);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-secondary:hover {
    background: var(--border-color);
    transform: translateY(-1px);
}

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

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-gray);
    color: var(--text-main);
}

.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
}

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

/* --- Loading States --- */
.skeleton {
    background: linear-gradient(90deg, var(--border-color) 25%, var(--bg-gray) 50%, var(--border-color) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.skeleton-icon {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
}

.skeleton-title {
    width: 70%;
    height: 20px;
    margin-bottom: var(--space-5);
}

.skeleton-btn {
    width: 100%;
    height: 40px;
}

/* --- Empty States --- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-10) var(--space-6);
    text-align: center;
}

/* --- ANNOUNCEMENT BAR --- */
.announcement-bar {
    background: linear-gradient(135deg, var(--primary-blue), #3b82f6);
    border-radius: var(--radius-lg);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    box-shadow: var(--shadow-md);
    animation: slideInDown 0.5s ease-out;
    position: relative;
    overflow: hidden;
}

.announcement-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%);
    animation: shine 3s infinite;
}

@keyframes shine {
    100% { transform: translateX(100%); }
}

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

.announcement-content {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex: 1;
}

.announcement-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.announcement-text {
    color: white;
    font-size: var(--text-sm);
    font-weight: 500;
    margin: 0;
}

.announcement-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: var(--space-1);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.announcement-close:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.announcement-bar.hidden {
    display: none;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    background: var(--bg-gray);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-5);
    color: var(--text-muted);
}

.empty-state-icon svg {
    width: 40px;
    height: 40px;
}

.empty-state-title {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: var(--space-2);
    color: var(--text-main);
}

.empty-state-text {
    color: var(--text-muted);
    font-size: var(--text-sm);
    max-width: 400px;
}

/* --- Error States --- */
.error-state {
    background: var(--danger-red-light);
    border: 1px solid var(--danger-red);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
}

.error-state-icon {
    color: var(--danger-red);
    flex-shrink: 0;
}

.error-state-content {
    flex: 1;
}

.error-state-title {
    font-weight: 600;
    color: var(--danger-red);
    margin-bottom: var(--space-1);
}

.error-state-text {
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

/* --- Success Toast --- */
.toast {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-5);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    z-index: 9999;
    transform: translateY(100px);
    opacity: 0;
    transition: all var(--transition-base);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    border-left: 3px solid var(--success-green);
}

.toast.error {
    border-left: 3px solid var(--danger-red);
}

.toast-icon {
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: var(--success-green);
}

.toast.error .toast-icon {
    color: var(--danger-red);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: var(--text-sm);
}

.toast-message {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* --- ICONS COLORS --- */
.icon-pdf {
    color: var(--danger-red);
}

.icon-ppt {
    color: var(--warning-orange);
}

/* --- VIEWER STYLES (Restored & Namespaced) --- */
.ppt-viewer-wrapper {
    margin: 0;
    padding: 0;
    border: none;
    background: var(--card-bg);
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.image-viewer-layout {
    display: flex;
    height: calc(100vh - 120px);
    border: 1px solid var(--border-color);
    background: #1a1a2e;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* Renamed to avoid overlap with global .sidebar */
.viewer-sidebar {
    width: 200px;
    background: var(--sidebar-bg);
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: var(--space-3);
    gap: var(--space-2);
    flex-shrink: 0;
}

.sidebar-item {
    cursor: pointer;
    border: 2px solid transparent;
    padding: var(--space-2);
    border-radius: var(--radius-md);
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all var(--transition-fast);
}

.sidebar-item:hover {
    background: var(--bg-gray);
    border-color: var(--border-color);
}

.sidebar-item.active {
    border-color: var(--primary-blue);
    background: var(--primary-blue-light);
}

.sidebar-num {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-bottom: var(--space-1);
    align-self: flex-start;
    font-weight: 500;
}

.sidebar-thumb {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.main-slide-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: #1a1a2e;
    padding: 0;
    overflow: hidden;
    position: relative;
}

.slide-container {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 0;
    padding: var(--space-4);
}

.slide-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
}

.image-controls {
    position: absolute;
    bottom: var(--space-5);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-4);
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-full);
    color: white;
    z-index: 10;
    box-shadow: var(--shadow-xl);
}

.slide-counter {
    font-weight: 600;
    font-size: var(--text-sm);
    min-width: 60px;
    text-align: center;
}

.controls {
    margin-top: var(--space-5);
    border-top: 1px solid var(--border-color);
    padding-top: var(--space-4);
    text-align: center;
}

/* Global button reset for viewer */
button {
    padding: var(--space-3) var(--space-5);
    margin: 0 var(--space-2);
    cursor: pointer;
    border: none;
    background: var(--primary-blue);
    color: white;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    font-size: var(--text-sm);
    box-shadow: var(--shadow-sm);
}

button:hover {
    background: var(--hover-blue);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--text-muted);
    transform: none;
    box-shadow: none;
}

.container.wide {
    max-width: 100% !important;
    padding: 0 var(--space-5);
    width: 100%;
    flex-grow: 1;
}

/* Navigation for viewer page */
.nav {
    display: flex;
    gap: var(--space-4);
    padding: var(--space-4) 0;
    margin-bottom: var(--space-4);
}

.nav a {
    color: var(--primary-blue);
    font-weight: 500;
    font-size: var(--text-sm);
    transition: color var(--transition-fast);
}

.nav a:hover {
    color: var(--hover-blue);
}

/* Sidebar toggle button - visible only on mobile */
.sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0;
    margin-right: var(--space-3);
    background: transparent;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.sidebar-toggle:hover {
    background: var(--bg-gray);
    transform: none;
}

/* Overlay for mobile sidebar - hidden by default */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
}

/* Tablet Responsive */
@media (max-width: 1024px) {
    .search-container {
        max-width: 320px;
    }
    
    .content-area {
        padding: var(--space-6);
    }
    
    .resource-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: var(--space-5);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar-toggle {
        display: flex;
    }

    .sidebar {
        width: 280px;
        overflow: visible;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }

    body.sidebar-open .sidebar-overlay {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .top-bar {
        padding: 0 var(--space-4);
        height: 64px;
    }

    .search-container {
        flex: 1;
        max-width: none;
    }

    .search-bar .search-shortcut {
        display: none;
    }

    .content-area {
        padding: var(--space-5);
    }

    .page-title {
        font-size: var(--text-2xl);
    }

    .resource-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .resource-card {
        padding: var(--space-5);
    }

    .icon-wrapper {
        width: 56px;
        height: 56px;
    }

    .icon-wrapper svg {
        width: 32px;
        height: 32px;
    }

    .viewer-sidebar {
        width: 100px;
        padding: var(--space-2);
    }

    .image-viewer-layout {
        height: calc(100vh - 160px);
    }

    .image-controls {
        bottom: var(--space-3);
        padding: var(--space-2) var(--space-4);
        gap: var(--space-3);
    }

    .toast {
        left: var(--space-4);
        right: var(--space-4);
        bottom: var(--space-4);
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .content-area {
        padding: var(--space-4);
    }

    .page-title {
        font-size: var(--text-xl);
    }

    .card-actions {
        flex-direction: column;
    }

    .btn-quick-view,
    .btn-download-pdf {
        width: 100%;
    }

    .viewer-sidebar {
        width: 70px;
    }

    .sidebar-num {
        font-size: 10px;
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .sidebar-overlay,
    .top-bar,
    .search-container {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
    }

    .resource-card {
        break-inside: avoid;
    }
}

/* --- Footer --- */
.site-footer {
    padding: var(--space-6) 0 var(--space-4) 0;
    margin-top: var(--space-8);
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: var(--text-sm);
}