@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #e2e8f0;
    --primary-dark: #cbd5e1;
    --primary-light: #f8fafc;
    --primary-rgb: 226, 232, 240;
    --primary-bg: rgba(226, 232, 240, 0.1);
    --accent: #94a3b8;
    --accent-rgb: 148, 163, 184;
    --bg: #0a0e1a;
    --bg-rgb: 10, 14, 26;
    --bg-card: #111827;
    --bg-card-hover: #1a2332;
    --text: #e8edf5;
    --text-muted: #6b7a99;
    --border: #1e2d4a;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.3);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --danger: #ff6b6b;
    --danger-bg: rgba(255, 107, 107, 0.1);
}

[data-theme="light"] {
    --primary: #1e293b;
    --primary-dark: #0f172a;
    --primary-light: #475569;
    --primary-rgb: 30, 41, 59;
    --primary-bg: rgba(30, 41, 59, 0.06);
    --accent: #64748b;
    --accent-rgb: 100, 116, 139;
    --bg: #f5f7fa;
    --bg-rgb: 245, 247, 250;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f2f5;
    --text: #1a1a2e;
    --text-muted: #6b7280;
    --border: #d1d5db;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.05);
    --danger: #dc2626;
    --danger-bg: rgba(220, 38, 38, 0.08);
}

[data-theme="light"] .hero-overlay {
    background: none;
}

[data-theme="light"] .hero-title {
    color: var(--text);
    -webkit-text-stroke: 0;
    text-stroke: 0;
    text-shadow: 0 0 16px rgba(255,255,255,0.85), 0 0 40px rgba(255,255,255,0.4);
}

[data-theme="light"] .hero-subtitle {
    color: var(--text-muted);
    -webkit-text-stroke: 0;
    text-stroke: 0;
    text-shadow: 0 0 12px rgba(255,255,255,0.8), 0 0 30px rgba(255,255,255,0.35);
}

[data-theme="light"] .year-card .year-count {
    color: #fff;
    text-shadow: 0 1px 6px rgba(0,0,0,0.6);
}

[data-theme="light"] .year-dl-btn {
    color: var(--text);
    background: rgba(var(--primary-rgb), 0.08);
    border-color: var(--border);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Hero */
.hero {
    position: relative;
    width: 100%;
    height: 420px;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-card);
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.1) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: #fff;
    margin-bottom: 12px;
    -webkit-text-stroke: 3px #000;
    text-stroke: 3px #000;
    text-shadow: 0 0 30px rgba(0,0,0,0.6), 0 0 60px rgba(0,0,0,0.3);
    transition: text-shadow 0.4s ease;
}

.hero-subtitle {
    font-size: 1.8rem;
    color: #fff;
    font-weight: 700;
    -webkit-text-stroke: 1.5px #000;
    text-stroke: 1.5px #000;
    text-shadow: 0 0 20px rgba(0,0,0,0.5), 0 0 40px rgba(0,0,0,0.25);
    letter-spacing: 0.02em;
    transition: text-shadow 0.4s ease;
}

@media (max-width: 768px) {
    .hero { height: 280px; }
    .hero-title { font-size: 2.2rem; }
    .hero-subtitle { font-size: 1rem; }
}

/* Header */
.header {
    background: rgba(var(--bg-rgb), 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    overflow: hidden;
}

.logo {
    font-size: 1.15rem;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: -0.3px;
    white-space: nowrap;
    color: var(--text);
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    gap: 6px;
    row-gap: 8px;
    flex-wrap: wrap;
    flex: 0 1 auto;
    margin-left: auto;
    justify-content: flex-end;
    min-width: 0;
    align-items: center;
}

/* Nav toggle (burger) — hidden on desktop, shown on mobile via media query */
.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
    font-size: 1.15rem;
    flex-shrink: 0;
    transition: var(--transition);
    line-height: 1;
    padding: 0;
}
.nav-toggle:hover {
    color: var(--text);
    border-color: var(--primary);
    background: var(--primary-bg);
}

.nav-links a {
    padding: 6px 14px;
    border-radius: 100px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
    transition: var(--transition);
    border: 1px solid transparent;
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    line-height: 1;
    letter-spacing: 0.01em;
}

.nav-links a:hover {
    color: var(--text);
    background: var(--primary-bg);
    border-color: var(--border);
    transform: translateY(-1px);
}

.theme-toggle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: var(--transition);
    margin-left: 4px;
    flex-shrink: 0;
}

.theme-toggle:hover {
    color: var(--text);
    border-color: var(--primary);
    background: var(--primary-bg);
    transform: translateY(-1px);
}

.nav-links a.active {
    color: var(--bg);
    background: var(--text);
    border-color: transparent;
}

.nav-group {
    display: inline-flex;
    align-items: center;
    gap: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 10px;
    flex: 1 1 auto;
    padding: 2px 0;
}

/* Page title */
.page-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 36px 0 6px;
    color: var(--text);
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 32px;
}

/* Footer */
.footer {
    margin-top: 60px;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer p {
    color: var(--text-muted);
    font-size: 0.88rem;
}

.footer a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
}

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

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 20px 0 28px;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.breadcrumbs a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    padding: 4px 10px;
    border-radius: 6px;
}

.breadcrumbs a:hover {
    color: var(--primary-light);
    background: var(--primary-bg);
}

.breadcrumbs .sep {
    color: var(--text-muted);
    opacity: 0.4;
}

.breadcrumbs .current {
    color: var(--text);
    font-weight: 500;
}

/* Year Grid */
.year-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 48px;
}

.year-card {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--border);
    transition: var(--transition);
    display: block;
    aspect-ratio: 16 / 10;
}

.year-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.year-card-wrap {
    display: flex;
    flex-direction: column;
}

.year-card-label {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 8px;
    letter-spacing: 0.3px;
}

.year-card-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.year-card:hover .year-card-bg {
    transform: scale(1.08);
}

.year-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.25) 60%, rgba(0,0,0,0.05) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px;
}

.year-card .year-number {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0,0,0,0.7), 0 0 30px rgba(0,0,0,0.4);
}

.year-card .year-count {
    color: rgba(255,255,255,0.7);
    font-size: 0.92rem;
}

.year-card-dl {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
}

.year-dl-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(var(--primary-rgb), 0.3);
    border: 1px solid rgba(var(--primary-rgb), 0.5);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1rem;
    transition: var(--transition);
    backdrop-filter: blur(4px);
}

.year-dl-btn:hover {
    background: rgba(var(--primary-rgb), 0.6);
    border-color: rgba(var(--primary-rgb), 0.9);
    transform: scale(1.1);
}

/* Events List */
.events-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 48px;
}

.event-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 18px;
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.event-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
}

.event-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    flex-shrink: 0;
    overflow: hidden;
}

.event-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.event-icon-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(var(--primary-rgb),0.2), rgba(var(--accent-rgb),0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.event-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.event-info p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Photo Grid */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
    margin-bottom: 48px;
}

.photo-card {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: var(--transition);
    cursor: pointer;
    aspect-ratio: 4 / 3;
}

.photo-card-cover {
    grid-column: 1 / -1;
    justify-self: center;
    max-width: 900px;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-color: var(--primary);
    border-width: 2px;
}

.photo-card-cover .photo-thumb {
    object-fit: cover;
}

.photo-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.photo-card .photo-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: var(--transition);
}

.photo-card:hover .photo-thumb {
    transform: scale(1.06);
}

.photo-card .video-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

.card-dl-btn {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(var(--primary-rgb), 0.5);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 0.85rem;
    opacity: 0;
    transform: scale(0.85);
    transition: var(--transition);
    backdrop-filter: blur(4px);
}

.photo-card:hover .card-dl-btn {
    opacity: 1;
    transform: scale(1);
}

.card-dl-btn:hover {
    background: rgba(var(--primary-rgb), 0.8);
    transform: scale(1.15);
}

.photo-overlay {
    position: absolute;
    bottom: 0;
    left: 0; right: 0;
    padding: 20px 14px 12px;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    opacity: 0;
    transform: translateY(8px);
    transition: var(--transition);
    pointer-events: none;
}

.photo-card:hover .photo-overlay {
    opacity: 1;
    transform: translateY(0);
}

.photo-overlay .photo-title {
    font-weight: 600;
    font-size: 0.92rem;
    margin-bottom: 4px;
    display: block;
}

.cover-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 100px;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.photo-overlay .photo-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.photo-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 500;
}

.photo-tag.year {
    background: rgba(var(--primary-rgb), 0.2);
    color: var(--primary-light);
}

.photo-tag.event {
    background: rgba(var(--accent-rgb), 0.15);
    color: var(--accent);
}

.photo-tag.keyword {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
}

/* ============ SLIDER (Lightbox) ============ */
.slider {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 1000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.slider.active {
    display: flex;
    animation: sliderFade 0.25s ease;
}

@keyframes sliderFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slider-top {
    position: absolute;
    top: 0;
    left: 0; right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    z-index: 10;
    background: linear-gradient(rgba(0,0,0,0.5), transparent);
}

.slider-counter {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    font-weight: 500;
}

.slider-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.slider-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition);
}

.slider-btn:hover {
    background: rgba(255,255,255,0.15);
}

.slider-btn-download {
    background: rgba(var(--primary-rgb), 0.25);
    border: 2px solid rgba(var(--primary-rgb), 0.5);
    text-decoration: none;
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
    white-space: nowrap;
}

.slider-btn-download:hover {
    background: rgba(var(--primary-rgb), 0.5);
    border-color: rgba(var(--primary-rgb), 0.8);
}

.slider-close {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    transition: var(--transition);
}

.slider-close:hover {
    background: rgba(255,255,255,0.15);
    transform: rotate(90deg);
}

.slider-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
}

.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    color: #fff;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    font-size: 1.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 5;
}

.slider-nav:hover {
    background: rgba(255,255,255,0.12);
    transform: translateY(-50%) scale(1.05);
}

.slider-nav.prev { left: 20px; }
.slider-nav.next { right: 20px; }

.slider-content {
    max-width: 85vw;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 0 60px;
}

.slider-content img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.slider-content video {
    max-width: 100%;
    max-height: 75vh;
    border-radius: var(--radius-sm);
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    background: #000;
}

.slider-media-info {
    color: rgba(255,255,255,0.7);
    text-align: center;
    font-size: 0.9rem;
    max-width: 600px;
}

.slider-media-info .smi-title {
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 2px;
}

.slider-media-info .smi-meta {
    opacity: 0.6;
    font-size: 0.85rem;
}

/* Search */
.search-section {
    margin-bottom: 32px;
}

.search-form {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.search-form input {
    flex: 1;
    min-width: 200px;
    padding: 12px 20px;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.search-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

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

.search-form button {
    padding: 12px 28px;
    border-radius: 100px;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.search-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.3);
}

/* Admin */
.admin-page {
    padding-top: 24px;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
}

.admin-header h1 {
    font-size: 1.8rem;
    margin: 0;
    background: none;
    -webkit-text-fill-color: var(--text);
    color: var(--text);
}

.admin-table-wrap {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.admin-table th {
    text-align: left;
    padding: 14px 16px;
    background: rgba(var(--primary-rgb), 0.06);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.admin-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(30, 45, 74, 0.5);
    vertical-align: middle;
}

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

.admin-table tr:hover td {
    background: rgba(var(--primary-rgb), 0.03);
}

.admin-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.admin-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
}

.admin-type-badge.photo {
    background: rgba(var(--primary-rgb), 0.15);
    color: var(--primary-light);
}

.admin-type-badge.video {
    background: rgba(var(--accent-rgb), 0.15);
    color: var(--accent);
}

.admin-actions {
    display: flex;
    gap: 6px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 100px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.3);
}

.btn-sm {
    padding: 6px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.83rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-edit {
    color: var(--primary-light);
    background: rgba(var(--primary-rgb), 0.1);
}

.btn-edit:hover {
    background: rgba(var(--primary-rgb), 0.2);
}

.btn-delete {
    color: var(--danger);
    background: var(--danger-bg);
}

.btn-delete:hover {
    background: var(--danger-bg);
    filter: brightness(1.2);
}

/* Form */
.form-page {
    padding-top: 24px;
    max-width: 600px;
}

.photo-form {
    background: var(--bg-card);
    padding: 32px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.photo-form label {
    display: block;
    margin-top: 20px;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.photo-form label:first-of-type {
    margin-top: 0;
}

.photo-form input[type="text"],
.photo-form input[type="number"],
.photo-form textarea,
.photo-form input[type="file"] {
    width: 100%;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.photo-form input:focus,
.photo-form textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

.photo-form textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.photo-form small {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 4px;
}

.photo-form button[type="submit"] {
    margin-top: 28px;
    padding: 12px 36px;
    border-radius: 100px;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

.photo-form button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.3);
}

.current-photo {
    margin-bottom: 20px;
    text-align: center;
}

.current-photo img {
    max-width: 220px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
}

/* Messages */
.msg {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.msg-success {
    background: rgba(var(--accent-rgb), 0.08);
    color: var(--accent);
    border: 1px solid rgba(var(--accent-rgb), 0.15);
}

.msg-error {
    background: rgba(255, 107, 107, 0.08);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.15);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h3 {
    color: var(--text);
    margin-bottom: 8px;
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 36px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    text-align: center;
}

.stat-card .stat-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text);
}

.stat-card .stat-label {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 4px;
}

/* Section divider */
.section-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 36px 0 20px;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ============ PAGE COMPONENTS (moved from page <style> blocks) ============ */

/* Stories */
.stories-grid { display:flex; flex-direction:column; gap:20px; margin-bottom:40px; }
.story-card { background:var(--bg-card); border:1px solid var(--border); border-radius:16px; padding:28px; transition:var(--transition); }
.story-card:hover { border-color:var(--primary); }
.story-year { font-size:0.82rem; font-weight:600; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.5px; margin-bottom:12px; }
.story-text { color:var(--text); line-height:1.8; font-size:1.05rem; white-space:pre-wrap; }
.story-date { font-size:0.78rem; color:var(--text-muted); margin-top:12px; }
.story-years-bar { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:28px; }
.story-years-bar a { padding:6px 18px; border-radius:100px; font-size:0.88rem; text-decoration:none; background:var(--bg-card); border:1px solid var(--border); color:var(--text); transition:var(--transition); }
.story-years-bar a:hover { border-color:var(--primary); background:var(--primary-bg); }

/* Files */
.files-list { display:flex; flex-direction:column; gap:12px; margin-bottom:40px; }
.file-card { background:var(--bg-card); border:1px solid var(--border); border-radius:12px; padding:16px 20px; transition:var(--transition); display:flex; align-items:center; gap:16px; flex-wrap:wrap; }
.file-card:hover { border-color:var(--primary); }
.file-icon { font-size:1.6rem; flex-shrink:0; }
.file-info { flex:1; min-width:140px; }
.file-title { font-weight:600; font-size:1rem; }
.file-meta { font-size:0.82rem; color:var(--text-muted); margin-top:2px; }
.file-download { padding:8px 20px; border-radius:8px; font-size:0.85rem; text-decoration:none; background:linear-gradient(135deg,var(--primary),var(--accent)); color:#fff; font-weight:600; transition:var(--transition); flex-shrink:0; }
.file-download:hover { opacity:0.9; transform:translateY(-1px); }
.years-bar { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:28px; }
.years-bar a { padding:6px 18px; border-radius:100px; font-size:0.88rem; text-decoration:none; background:var(--bg-card); border:1px solid var(--border); color:var(--text); transition:var(--transition); }
.years-bar a:hover { border-color:var(--primary); background:var(--primary-bg); }
.years-bar a.active { background:var(--primary); color:#fff; border-color:var(--primary); }

/* Audio */
.audio-list { display:flex; flex-direction:column; gap:12px; margin-bottom:40px; }
.audio-card { background:var(--bg-card); border:1px solid var(--border); border-radius:12px; padding:16px 20px; transition:var(--transition); display:flex; align-items:center; gap:16px; flex-wrap:wrap; }
.audio-card:hover { border-color:var(--primary); }
.audio-icon { font-size:1.6rem; flex-shrink:0; }
.audio-info { flex:1; min-width:140px; }
.audio-title { font-weight:600; font-size:1rem; }
.audio-meta { font-size:0.82rem; color:var(--text-muted); margin-top:2px; }
.audio-card audio { height:40px; max-width:300px; flex-shrink:0; }
.audio-years-bar { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:28px; }
.audio-years-bar a { padding:6px 18px; border-radius:100px; font-size:0.88rem; text-decoration:none; background:var(--bg-card); border:1px solid var(--border); color:var(--text); transition:var(--transition); }
.audio-years-bar a:hover { border-color:var(--primary); background:var(--primary-bg); }

/* Responsive - burger on ≤1024px (tablets, small laptops), full nav on >1024px */
@media (max-width: 1024px) {
    .header { padding: 10px 0; }
    .header-inner { flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
    .logo { margin-right: auto; }
    .nav-toggle { display: flex; margin-right: 4px; }
    .theme-toggle { margin-left: 0; }
    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 2px;
        padding: 6px 0 2px;
        order: 3;
        margin-left: 0;
    }
    .nav-links.nav-open { display: flex; }
    .nav-links a { padding: 6px 10px; font-size: 0.82rem; border-radius: 8px; width: 100%; }
    .nav-row { flex-direction: column; width: 100%; }
}

@media (max-width: 640px) {
    .header { padding: 8px 0; }
    .header-inner { gap: 4px; }
    .logo { font-size: 0.82rem; }
    .nav-links { padding: 4px 0 0; margin-left: 0; }
    .nav-links a { padding: 5px 8px; font-size: 0.78rem; }
}

@media (max-width: 480px) {
    .header { padding: 6px 0; }
    .header-inner { gap: 3px; }
    .logo { font-size: 0.72rem; }
    .nav-toggle { width: 26px; height: 26px; font-size: 0.85rem; margin-right: 3px; }
    .theme-toggle { width: 24px; height: 24px; font-size: 0.7rem; }
    .nav-links { padding: 2px 0 0; margin-left: 0; }
    .nav-links a { padding: 5px 8px; font-size: 0.7rem; }
}

/* Preview Modal (admin) */
.preview-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0,0,0,0.9);
    align-items: center;
    justify-content: center;
    padding: 40px;
    cursor: zoom-out;
}

.preview-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2.5rem;
    color: #fff;
    cursor: pointer;
    z-index: 1001;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

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

.preview-content {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 75vh;
}

.preview-actions {
    position: absolute;
    bottom: 30px;
    display: flex;
    gap: 12px;
    z-index: 1001;
}

/* Checkbox Group */
.checkbox-group {
    margin-bottom: 20px;
}

.checkbox-label {
    display: inline-block;
    vertical-align: middle;
    padding: 3px 12px;
    margin: 3px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.88rem;
    line-height: 1.6;
    transition: var(--transition);
    white-space: nowrap;
}

.checkbox-label:hover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.08);
}

.checkbox-label input[type="checkbox"] {
    accent-color: var(--primary);
    width: 14px;
    height: 14px;
    margin: 0 2px 0 0;
    vertical-align: middle;
}

/* Admin category pages */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: var(--transition);
}

.category-card:hover {
    border-color: var(--primary);
}

.category-cover {
    display: block;
    width: 100%;
    height: 160px;
    overflow: hidden;
    background: var(--bg);
}

.category-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    opacity: 0.3;
}

.category-card-body {
    padding: 16px;
}

.category-card-body h3 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.category-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.category-count {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.category-card-actions {
    display: flex;
    gap: 8px;
    padding: 8px 16px 16px;
}

/* Sticky Audio Player */
.sticky-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: rgba(15, 20, 35, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    padding: 0 16px;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.sticky-player.active {
    transform: translateY(0);
}

.sp-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 60px;
}

.sp-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: 0.2s;
    flex-shrink: 0;
}

.sp-btn:hover {
    background: rgba(255,255,255,0.15);
}

.sp-play {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
    background: var(--primary);
    color: var(--bg);
    border-color: var(--primary);
}

.sp-play:hover {
    background: var(--primary-dark);
}

.sp-close {
    font-size: 0.9rem;
    opacity: 0.5;
}

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

.sp-info {
    flex: 1;
    min-width: 0;
    padding: 0 4px;
}

.sp-title {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sp-progress-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 2;
    min-width: 100px;
}

.sp-time {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    min-width: 35px;
    text-align: center;
}

.sp-bar {
    flex: 1;
    height: 5px;
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}

.sp-bar-fill {
    height: 100%;
    width: 0;
    background: var(--primary);
    border-radius: 3px;
    pointer-events: none;
}

.sp-bar-thumb {
    position: absolute;
    top: 50%;
    width: 13px;
    height: 13px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    display: none;
}

.sp-bar:hover .sp-bar-thumb {
    display: block;
}

.sp-track:hover {
    border-color: var(--primary) !important;
    background: rgba(var(--primary-rgb), 0.06) !important;
}

@media (max-width: 768px) {
    .sp-inner {
        gap: 6px;
        height: 52px;
    }
    .sp-btn {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
    .sp-play {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
    .sp-progress-wrap {
        min-width: 60px;
    }
    .sp-time {
        font-size: 0.7rem;
        min-width: 28px;
    }
    .sp-title {
        font-size: 0.8rem;
    }
}

/* ============ BEAUTIFUL COLORFUL TRANSITIONS ============ */

/* Page fade-in */
body {
    animation: pageFadeIn 0.5s ease;
}

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

/* Smooth theme toggle */
* {
    transition: background-color 0.4s ease, border-color 0.4s ease, color 0.3s ease, box-shadow 0.4s ease;
}

/* 🌈 HERO — animated gradient overlay with color cycling */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        rgba(255, 107, 107, 0.15), 
        rgba(255, 193, 7, 0.1), 
        rgba(0, 204, 255, 0.15), 
        rgba(170, 0, 255, 0.1)
    );
    background-size: 400% 400%;
    animation: auroraDrift 12s ease-in-out infinite;
    z-index: 1;
    pointer-events: none;
}

[data-theme="light"] .hero::before {
    background: linear-gradient(135deg,
        rgba(255, 107, 107, 0.08),
        rgba(255, 193, 7, 0.05),
        rgba(0, 204, 255, 0.08),
        rgba(170, 0, 255, 0.05)
    );
    background-size: 400% 400%;
    animation: auroraDrift 12s ease-in-out infinite;
}

.hero-overlay {
    z-index: 2;
}

@keyframes auroraDrift {
    0%   { background-position: 0% 50%; }
    25%  { background-position: 100% 0%; }
    50%  { background-position: 100% 100%; }
    75%  { background-position: 0% 100%; }
    100% { background-position: 0% 50%; }
}

/* Hero text entrance */
.hero-title {
    animation: heroTextIn 0.8s ease 0.2s both;
}

.hero-subtitle {
    animation: heroTextIn 0.8s ease 0.4s both;
}

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

/* 🌈 CARD GLOW — animated rainbow border glow on hover */
.year-card,
.photo-card,
.event-card,
.category-card,
.cat-admin-card,
.stat-card,
.admin-table-wrap {
    position: relative;
    isolation: isolate;
}

.year-card::before,
.photo-card::before,
.event-card::before,
.category-card::before,
.cat-admin-card::before,
.stat-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s ease;
    background: linear-gradient(135deg, #ff6b6b, #ffc107, #00ccff, #aa00ff, #ff6b6b);
    background-size: 400% 400%;
    animation: rainbowBorder 4s ease infinite;
    pointer-events: none;
}

.year-card:hover::before,
.photo-card:hover::before,
.event-card:hover::before,
.category-card:hover::before,
.cat-admin-card:hover::before,
.stat-card:hover::before {
    opacity: 1;
}

/* Ensure content stays above the pseudo-element */
.year-card > *,
.photo-card > *,
.event-card > *,
.category-card > *,
.cat-admin-card > *,
.stat-card > * {
    position: relative;
    z-index: 1;
}

/* Also glow via box-shadow as fallback/enhancement */
.year-card:hover,
.photo-card:hover,
.event-card:hover,
.category-card:hover,
.cat-admin-card:hover,
.stat-card:hover,
.admin-table-wrap:hover,
.cat-tree-item .cat-admin-card:hover {
    box-shadow: 0 0 30px rgba(255, 107, 107, 0.15), 0 0 60px rgba(0, 204, 255, 0.08), var(--shadow);
    transition: box-shadow 0.5s ease, transform 0.3s ease, border-color 0.3s ease;
}

@keyframes rainbowBorder {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 🌈 BUTTONS — colorful gradient pulse */
.btn-primary,
.btn-create,
.btn-save,
.search-form button,
.photo-form button[type="submit"] {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    background-size: 200% 200%;
    animation: btnShimmer 4s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.btn-primary::after,
.btn-create::after,
.btn-save::after,
.search-form button::after,
.photo-form button[type="submit"]::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 30%, rgba(255,255,255,0.15) 50%, transparent 70%);
    background-size: 200% 100%;
    animation: btnShine 3s ease-in-out infinite;
    pointer-events: none;
    border-radius: inherit;
}

@keyframes btnShimmer {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

.btn-primary:hover,
.btn-create:hover,
.btn-save:hover,
.search-form button:hover,
.photo-form button[type="submit"]:hover {
    animation: btnPulse 1.5s ease-in-out infinite;
}

@keyframes btnPulse {
    0%, 100% { 
        box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.3),
                    0 0 40px rgba(255, 107, 107, 0.1),
                    0 0 80px rgba(0, 204, 255, 0.05);
    }
    50%      { 
        box-shadow: 0 8px 40px rgba(var(--primary-rgb), 0.5),
                    0 0 60px rgba(255, 107, 107, 0.2),
                    0 0 100px rgba(0, 204, 255, 0.1);
    }
}

/* 🌈 LOGO — gradient text animation */
.logo {
    background: linear-gradient(135deg, var(--primary-light), #ff6b6b, var(--accent), #00ccff, var(--primary-light));
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: logoGradient 6s ease-in-out infinite;
    font-weight: 800;
}

@keyframes logoGradient {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 🌈 HEADER BORDER — animated bottom border */
.header {
    border-bottom: 1px solid transparent;
    background-image: linear-gradient(rgba(var(--bg-rgb), 0.9), rgba(var(--bg-rgb), 0.9)), 
                      linear-gradient(135deg, #ff6b6b, #ffc107, #00ccff, #aa00ff);
    background-origin: padding-box, border-box;
    background-clip: padding-box, border-box;
}

/* 🌈 NAV ACTIVE — colorful glow */
.nav-links a.active {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: var(--bg);
    animation: navRainbow 3s ease-in-out infinite;
}

@keyframes navRainbow {
    0%, 100% { 
        box-shadow: 0 0 8px rgba(255, 107, 107, 0.3);
    }
    33% { 
        box-shadow: 0 0 8px rgba(255, 193, 7, 0.3);
    }
    66% { 
        box-shadow: 0 0 8px rgba(0, 204, 255, 0.3);
    }
}

/* 🌈 SECTION DIVIDER — colorful gradient */
.section-divider::after {
    background: linear-gradient(to right, transparent, #ff6b6b, #ffc107, #00ccff, #aa00ff, transparent);
    background-size: 200% 100%;
    animation: dividerRainbow 4s ease-in-out infinite;
}

@keyframes dividerRainbow {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 🌈 SCROLLBAR — iridescent thumb */
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #ff6b6b, #ffc107, #00ccff, #aa00ff);
    background-size: 100% 300%;
    animation: scrollbarRainbow 4s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes scrollbarRainbow {
    0%   { background-position: 0% 0%; }
    50%  { background-position: 0% 100%; }
    100% { background-position: 0% 0%; }
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }

/* 🌈 FOOTER LINK — colorful hover */
.footer a {
    position: relative;
    background: linear-gradient(135deg, #ff6b6b, #ffc107, #00ccff);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: footerLinkGrad 4s ease-in-out infinite;
}

@keyframes footerLinkGrad {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.footer a::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(135deg, #ff6b6b, #ffc107, #00ccff);
    background-size: 200% 100%;
    animation: footerLinkGrad 4s ease-in-out infinite;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.footer a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* 🌈 YEAR NUMBER — colorful glow on hover */
.year-card:hover .year-number {
    text-shadow: 0 0 30px rgba(255, 107, 107, 0.4), 
                 0 0 60px rgba(0, 204, 255, 0.3),
                 0 0 90px rgba(170, 0, 255, 0.2);
    transition: text-shadow 0.3s ease;
}

/* 🌈 DELETE BUTTON — colorful danger */
.btn-delete {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: #fff;
    border: none;
    animation: deletePulse 3s ease-in-out infinite;
}

.btn-delete:hover {
    filter: brightness(1.2);
    animation: shake 0.3s ease;
}

@keyframes deletePulse {
    0%, 100% { box-shadow: 0 0 15px rgba(255, 107, 107, 0.3); }
    50%      { box-shadow: 0 0 30px rgba(255, 107, 107, 0.6); }
}

/* 🌈 TABLE HEADERS — subtle color */
.admin-table th {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.05), rgba(0, 204, 255, 0.05));
    background-size: 200% 100%;
    animation: thGradient 6s ease-in-out infinite;
}

@keyframes thGradient {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 🌈 PAGE TITLE — gradient underline (text kept solid for emoji compat) */
.page-title {
    color: var(--text);
    margin-bottom: 16px;
    position: relative;
    display: inline-block;
}

.page-title::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(135deg, #ff6b6b, #ffc107, #00ccff, #aa00ff);
    background-size: 300% 100%;
    animation: pageTitleUnderline 6s ease-in-out infinite;
    border-radius: 2px;
}

@keyframes pageTitleUnderline {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

[data-theme="light"] .page-title::after {
    background: linear-gradient(135deg, #dc2626, #f59e0b, #2563eb, #7c3aed);
    background-size: 300% 100%;
    animation: pageTitleUnderline 6s ease-in-out infinite;
}

/* 🌈 ADMIN HEADER TITLE — colorful underline */
.admin-header h1 {
    color: var(--text);
    -webkit-text-fill-color: var(--text);
    background: none;
    position: relative;
    display: inline-block;
}

.admin-header h1::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(135deg, #ff6b6b, #ffc107, #00ccff, #aa00ff);
    background-size: 300% 100%;
    animation: pageTitleUnderline 6s ease-in-out infinite;
    border-radius: 2px;
}

/* 🌈 BREADCRUMBS — colorful separator */
.breadcrumbs .sep {
    color: transparent;
    background: linear-gradient(135deg, #ff6b6b, #00ccff);
    -webkit-background-clip: text;
    background-clip: text;
    font-weight: 700;
}

/* 🌈 EMPTY STATE ICON — floating color */
.empty-state .empty-icon {
    animation: emptyFloat 3s ease-in-out infinite, emptyColor 6s ease-in-out infinite;
}

@keyframes emptyFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-10px); }
}

@keyframes emptyColor {
    0%   { opacity: 0.4; }
    50%  { opacity: 0.8; }
    100% { opacity: 0.4; }
}

/* 🌈 STAT NUMBERS — colorful */
.stat-card .stat-number {
    background: linear-gradient(135deg, #ff6b6b, #ffc107, #00ccff);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: statNumGrad 4s ease-in-out infinite;
}

@keyframes statNumGrad {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.stat-card:hover .stat-number {
    animation: statPulse 0.6s ease, statNumGrad 4s ease-in-out infinite;
}

@keyframes statPulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* 🌈 CARD SHIMMER ENTRANCE — staggered with color */
.year-grid .year-card,
.photo-grid .photo-card,
.events-list .event-card,
.category-grid .category-card {
    animation: cardSlideUp 0.5s ease both;
}

.year-grid .year-card:nth-child(1)  { animation-delay: 0.02s; }
.year-grid .year-card:nth-child(2)  { animation-delay: 0.04s; }
.year-grid .year-card:nth-child(3)  { animation-delay: 0.06s; }
.year-grid .year-card:nth-child(4)  { animation-delay: 0.08s; }
.year-grid .year-card:nth-child(5)  { animation-delay: 0.10s; }
.year-grid .year-card:nth-child(6)  { animation-delay: 0.12s; }
.year-grid .year-card:nth-child(7)  { animation-delay: 0.14s; }
.year-grid .year-card:nth-child(8)  { animation-delay: 0.16s; }
.year-grid .year-card:nth-child(9)  { animation-delay: 0.18s; }
.year-grid .year-card:nth-child(10) { animation-delay: 0.20s; }
.year-grid .year-card:nth-child(11) { animation-delay: 0.22s; }
.year-grid .year-card:nth-child(12) { animation-delay: 0.24s; }
.year-grid .year-card:nth-child(13) { animation-delay: 0.26s; }
.year-grid .year-card:nth-child(14) { animation-delay: 0.28s; }
.year-grid .year-card:nth-child(15) { animation-delay: 0.30s; }

.photo-grid .photo-card:nth-child(1)  { animation-delay: 0.02s; }
.photo-grid .photo-card:nth-child(2)  { animation-delay: 0.04s; }
.photo-grid .photo-card:nth-child(3)  { animation-delay: 0.06s; }
.photo-grid .photo-card:nth-child(4)  { animation-delay: 0.08s; }
.photo-grid .photo-card:nth-child(5)  { animation-delay: 0.10s; }
.photo-grid .photo-card:nth-child(6)  { animation-delay: 0.12s; }
.photo-grid .photo-card:nth-child(7)  { animation-delay: 0.14s; }
.photo-grid .photo-card:nth-child(8)  { animation-delay: 0.16s; }
.photo-grid .photo-card:nth-child(9)  { animation-delay: 0.18s; }
.photo-grid .photo-card:nth-child(10) { animation-delay: 0.20s; }
.photo-grid .photo-card:nth-child(11) { animation-delay: 0.22s; }
.photo-grid .photo-card:nth-child(12) { animation-delay: 0.24s; }
.photo-grid .photo-card:nth-child(13) { animation-delay: 0.26s; }
.photo-grid .photo-card:nth-child(14) { animation-delay: 0.28s; }
.photo-grid .photo-card:nth-child(15) { animation-delay: 0.30s; }

.events-list .event-card:nth-child(1)  { animation-delay: 0.02s; }
.events-list .event-card:nth-child(2)  { animation-delay: 0.04s; }
.events-list .event-card:nth-child(3)  { animation-delay: 0.06s; }
.events-list .event-card:nth-child(4)  { animation-delay: 0.08s; }
.events-list .event-card:nth-child(5)  { animation-delay: 0.10s; }

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

/* 🌈 IMAGE SHIMMER LOADING — iridescent shimmer */
.photo-thumb,
.year-card-bg,
.cat-admin-cover img,
.category-cover img,
.admin-thumb {
    background: linear-gradient(110deg, 
        var(--bg-card) 25%, 
        rgba(255, 107, 107, 0.05) 35%, 
        rgba(0, 204, 255, 0.05) 45%, 
        var(--bg-card) 55%
    );
    background-size: 300% 100%;
    animation: iridescentShimmer 3s ease-in-out infinite;
}

@keyframes iridescentShimmer {
    0%   { background-position: 300% 0; }
    100% { background-position: -300% 0; }
}

/* 🌈 TAG BADGES — colorful hover */
.photo-tag {
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
}

.photo-tag:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.2);
}

.photo-tag.year:hover {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.3), rgba(0, 204, 255, 0.3));
}

.photo-tag.event:hover {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.3), rgba(170, 0, 255, 0.2));
}

/* 🌈 SLIDER IMAGE ZOOM — with rainbow shadow */
.slider-content img {
    animation: sliderImgIn 0.4s ease;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 40px rgba(255, 107, 107, 0.1);
}

@keyframes sliderImgIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

/* 🌈 MSG TOAST — colorful slide-in */
.msg {
    animation: msgSlideIn 0.4s ease;
    border-left: 3px solid;
    position: relative;
    overflow: hidden;
}

.msg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 30%, rgba(255,255,255,0.05) 50%, transparent 70%);
    background-size: 200% 100%;
    animation: btnShine 3s ease-in-out infinite;
    pointer-events: none;
}

.msg-success {
    border-left-color: #00ccff;
    background: linear-gradient(135deg, rgba(0, 204, 255, 0.06), rgba(255, 107, 107, 0.03));
}

.msg-error {
    border-left-color: #ff6b6b;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.08), rgba(255, 193, 7, 0.03));
}

@keyframes msgSlideIn {
    from { opacity: 0; transform: translateY(-12px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* 🌈 ADMIN TABLE ROWS — colorful slide-in */
.admin-table tbody tr {
    animation: rowSlideIn 0.3s ease both;
}

.admin-table tbody tr:nth-child(1) { animation-delay: 0.02s; }
.admin-table tbody tr:nth-child(2) { animation-delay: 0.04s; }
.admin-table tbody tr:nth-child(3) { animation-delay: 0.06s; }
.admin-table tbody tr:nth-child(4) { animation-delay: 0.08s; }
.admin-table tbody tr:nth-child(5) { animation-delay: 0.10s; }
.admin-table tbody tr:nth-child(6) { animation-delay: 0.12s; }
.admin-table tbody tr:nth-child(7) { animation-delay: 0.14s; }
.admin-table tbody tr:nth-child(8) { animation-delay: 0.16s; }
.admin-table tbody tr:nth-child(9) { animation-delay: 0.18s; }
.admin-table tbody tr:nth-child(10) { animation-delay: 0.20s; }

@keyframes rowSlideIn {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* 🌈 CHECKBOX ACTIVE — colorful bounce */
.checkbox-label:active {
    transform: scale(0.95);
    border-color: #ff6b6b;
}

.checkbox-label input[type="checkbox"]:checked ~ span {
    background: linear-gradient(135deg, #ff6b6b, #00ccff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 🌈 PREVIEW MODAL — with colorful border glow */
.preview-modal.active {
    animation: modalFadeIn 0.25s ease;
}

.preview-modal {
    background: rgba(0,0,0,0.92);
    backdrop-filter: blur(8px);
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

/* 🌈 DOWNLOAD BUTTON — colorful spin */
.card-dl-btn:hover {
    background: linear-gradient(135deg, #ff6b6b, #00ccff);
    border-color: transparent;
    animation: dlSpin 0.6s ease;
}

@keyframes dlSpin {
    0%   { transform: scale(1) rotate(0deg); }
    50%  { transform: scale(1.2) rotate(15deg); }
    100% { transform: scale(1.15) rotate(0deg); }
}

/* 🌈 THEME TOGGLE — colorful hover */
.theme-toggle:hover {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.15), rgba(0, 204, 255, 0.15));
    border-color: transparent;
    transform: rotate(180deg);
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.2);
}

/* 🌈 BREADCRUMBS LINK — colorful hover */
.breadcrumbs a:hover {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.08), rgba(0, 204, 255, 0.08));
    border-color: transparent;
    color: var(--text);
}

/* 🌈 CATEGORY CARD — tree view child indicator */
.cat-child-indicator {
    color: #ff6b6b;
    filter: drop-shadow(0 0 4px rgba(255, 107, 107, 0.5));
    animation: catIndicatorPulse 2s ease-in-out infinite;
}

@keyframes catIndicatorPulse {
    0%, 100% { opacity: 0.5; }
    50%      { opacity: 1; }
}

/* 🌈 CAT HAS CHILDREN — left border */
.cat-has-children {
    border-left: 3px solid transparent;
    border-image: linear-gradient(180deg, #ff6b6b, #00ccff) 1;
}

/* ============ COMPREHENSIVE RESPONSIVE DESIGN ============ */

/* Small phones (< 480px) */
@media (max-width: 480px) {
    .container { padding: 0 12px; }

    .hero { height: 180px; }
    .hero-title { font-size: 1.5rem; -webkit-text-stroke: 2px #000; text-stroke: 2px #000; }
    .hero-subtitle { font-size: 0.82rem; -webkit-text-stroke: 1px #000; text-stroke: 1px #000; }

    .page-title { font-size: 1.3rem; margin: 18px 0 4px; }
    .page-subtitle { font-size: 0.85rem; margin-bottom: 18px; }

    .year-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .year-card { aspect-ratio: 4/3; }
    .year-card .year-number { font-size: 1.5rem; }
    .year-card-overlay { padding: 10px; }
    .year-card .year-count { font-size: 0.72rem; }
    .year-dl-btn { width: 26px; height: 26px; font-size: 0.72rem; top: 6px; right: 6px; }

    .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .photo-card { aspect-ratio: 4/3; }
    .photo-overlay { padding: 12px 8px 8px; }
    .photo-overlay .photo-title { font-size: 0.75rem; }
    .photo-tag { font-size: 0.58rem; padding: 1px 5px; }
    .photo-card .video-badge { top: 6px; right: 6px; padding: 2px 6px; font-size: 0.6rem; }

    .events-list { grid-template-columns: 1fr; gap: 8px; }
    .event-card { padding: 10px; gap: 8px; }
    .event-icon { width: 32px; height: 32px; }
    .event-info h3 { font-size: 0.82rem; }
    .event-info p { font-size: 0.75rem; }

    .category-grid { grid-template-columns: 1fr; gap: 10px; }
    .category-cover { height: 90px; }
    .category-card-body { padding: 8px; }
    .category-card-body h3 { font-size: 0.9rem; }
    .category-desc { font-size: 0.75rem; }

    .stories-grid { gap: 10px; margin-bottom: 24px; }
    .story-card { padding: 14px; border-radius: 10px; }
    .story-text { font-size: 0.9rem; line-height: 1.6; }
    .story-year { font-size: 0.7rem; margin-bottom: 6px; }
    .story-date { font-size: 0.7rem; margin-top: 6px; }

    .story-years-bar { gap: 5px; margin-bottom: 14px; }
    .story-years-bar a { padding: 4px 10px; font-size: 0.75rem; }

    .files-list { gap: 6px; margin-bottom: 24px; }
    .file-card { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 12px; }
    .file-info { min-width: 0; }
    .file-title { font-size: 0.88rem; }
    .file-meta { font-size: 0.72rem; }
    .file-icon { font-size: 1.2rem; }
    .file-download { align-self: flex-start; padding: 5px 12px; font-size: 0.78rem; }

    .years-bar { gap: 5px; margin-bottom: 14px; }
    .years-bar a { padding: 4px 10px; font-size: 0.75rem; }

    .audio-list { gap: 6px; margin-bottom: 24px; }
    .audio-card { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 12px; }
    .audio-info { min-width: 0; }
    .audio-title { font-size: 0.88rem; }
    .audio-meta { font-size: 0.72rem; }
    .audio-icon { font-size: 1.2rem; }
    .audio-card audio { max-width: 100%; width: 100%; height: 34px; }

    .audio-years-bar { gap: 5px; margin-bottom: 14px; }
    .audio-years-bar a { padding: 4px 10px; font-size: 0.75rem; }

    .admin-page { padding-top: 10px; }
    .admin-header { flex-direction: column; align-items: stretch; gap: 6px; margin-bottom: 14px; }
    .admin-header h1 { font-size: 1.2rem; }

    .admin-table-wrap { overflow-x: auto; }
    .admin-table { font-size: 0.7rem; }
    .admin-table th, .admin-table td { padding: 5px 6px; }
    .admin-thumb { width: 36px; height: 36px; }
    .admin-actions { gap: 3px; }
    .btn-sm { padding: 3px 7px; font-size: 0.7rem; }
    .admin-type-badge { font-size: 0.62rem; padding: 1px 5px; }

    .form-page { padding-top: 10px; }
    .photo-form { padding: 14px; }
    .photo-form label { font-size: 0.8rem; margin-top: 12px; }
    .photo-form input[type="text"], .photo-form input[type="number"], .photo-form textarea, .photo-form input[type="file"] { padding: 7px 10px; font-size: 0.85rem; }
    .photo-form button[type="submit"] { padding: 9px 20px; font-size: 0.85rem; }

    .stats { grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 20px; }
    .stat-card { padding: 10px; }
    .stat-card .stat-number { font-size: 1.2rem; }
    .stat-card .stat-label { font-size: 0.7rem; }

    .slider-content { max-width: 100vw; padding: 0 2px; }
    .slider-nav { width: 28px; height: 28px; font-size: 0.8rem; }
    .slider-nav.prev { left: 2px; }
    .slider-nav.next { right: 2px; }
    .slider-top { padding: 6px 8px; }
    .slider-btn, .slider-close { width: 30px; height: 30px; font-size: 0.85rem; }
    .slider-btn-download { padding: 4px 8px; font-size: 0.72rem; }
    .slider-content img, .slider-content video { max-height: 50vh; }
    .slider-counter { font-size: 0.7rem; }
    .slider-media-info { font-size: 0.75rem; }
    .slider-media-info .smi-title { font-size: 0.82rem; }
    .slider-media-info .smi-meta { font-size: 0.7rem; }

    .sticky-player { padding: 0 4px; }
    .sp-inner { height: 40px; gap: 3px; }
    .sp-btn { width: 24px; height: 24px; font-size: 0.65rem; }
    .sp-play { width: 28px; height: 28px; font-size: 0.78rem; }
    .sp-progress-wrap { min-width: 24px; flex: 1; }
    .sp-time { font-size: 0.5rem; min-width: 18px; }
    .sp-title { font-size: 0.65rem; }
    .sp-bar { height: 3px; }
    .sp-bar-thumb { width: 8px; height: 8px; }

    .search-form { flex-direction: column; gap: 8px; }
    .search-form input { min-width: 0; width: 100%; padding: 8px 14px; font-size: 0.85rem; }
    .search-form button { width: 100%; padding: 8px 18px; font-size: 0.82rem; }
    .search-section { margin-bottom: 16px; }

    .breadcrumbs { font-size: 0.75rem; margin: 8px 0 12px; gap: 4px; }
    .breadcrumbs a { padding: 2px 6px; }

    .msg { padding: 8px 12px; font-size: 0.8rem; margin-bottom: 12px; gap: 6px; }

    .checkbox-group { margin-bottom: 10px; }
    .checkbox-label { padding: 2px 7px; margin: 2px; font-size: 0.78rem; }

    .footer { margin-top: 20px; padding: 12px 0; }
    .footer p { font-size: 0.72rem; }

    .preview-modal { padding: 12px; }
    .preview-close { top: 10px; right: 12px; font-size: 1.5rem; }
    .preview-actions { bottom: 12px; gap: 6px; }

    .upload-zone { padding: 14px 10px; }
    .upload-zone .icon { font-size: 1.6rem; }
    .upload-zone p { font-size: 0.85rem; }
    .upload-zone small { font-size: 0.72rem; }
    .form-row { flex-direction: column; gap: 8px; }
    .form-row .field { width: 100%; }

    .file-item { flex-wrap: wrap; gap: 4px; padding: 6px 8px; }
    .file-item .preview { width: 24px; height: 24px; }
    .file-item .name { font-size: 0.75rem; }
    .file-item .size { font-size: 0.65rem; }
    .file-item .progress-wrap { height: 3px; }

    .view-tabs { gap: 4px; margin-bottom: 14px; }
    .view-tab { padding: 6px 12px; font-size: 0.78rem; }

    .all-item { flex-direction: column; gap: 6px; padding: 10px; }
    .all-item-actions { align-self: flex-start; }
    .all-item-icon { width: 32px; height: 32px; font-size: 0.85rem; }

    .section-divider { font-size: 0.7rem; margin: 16px 0 10px; gap: 8px; }

    .cover-badge { font-size: 0.58rem; padding: 1px 7px; }

    .empty-state { padding: 24px 14px; }
    .empty-state .empty-icon { font-size: 2.2rem; }
    .empty-state h3 { font-size: 0.95rem; }

    .current-photo img { max-width: 120px; }

    .cat-admin-cover { height: 70px; }
    .cat-admin-body { padding: 6px 10px; }
    .cat-admin-body h3 { font-size: 0.85rem; }
    .cat-admin-desc { font-size: 0.72rem; }
    .cat-admin-meta { font-size: 0.68rem; }
    .cat-admin-actions { padding: 4px 10px 8px; gap: 3px; }
    .btn-action { padding: 3px 8px; font-size: 0.72rem; }

    .card-dl-btn { width: 26px; height: 26px; font-size: 0.68rem; top: 6px; left: 6px; }

    .photo-card-cover { max-width: 100%; }

    /* Admin inline-style pages (stories.php, files.php) override */
    .admin-page > [style*="flex-direction: column"] { gap: 10px !important; }
    .admin-page [style*="background:var(--bg-card);border:1px solid var(--border);border-radius:12px"] { padding: 14px !important; }
    .admin-page [style*="border-radius:100px;padding:4px 16px"] { padding: 3px 10px !important; font-size: 0.78rem !important; }
    .admin-page img[style*="max-height:200px"] { max-height: 140px !important; }
    .admin-page [style*="padding:10px 24px"] { padding: 8px 16px !important; font-size: 0.82rem !important; }
    .admin-page span[style*="font-size:1.4rem"] { font-size: 1.1rem !important; }
    .admin-page [style*="margin-bottom:24px"] { margin-bottom: 16px !important; gap: 10px !important; }
    .admin-page [style*="padding:6px 14px"] { padding: 4px 10px !important; font-size: 0.75rem !important; }
    .admin-page [style*="padding:6px 12px"] { padding: 4px 8px !important; font-size: 0.75rem !important; }
    .admin-page [style*="justify-content:space-between;align-items:start"] { flex-direction: column !important; align-items: stretch !important; }
}

/* Phones (481-640px) */
@media (min-width: 481px) and (max-width: 640px) {
    .container { padding: 0 14px; }

    .hero { height: 210px; }
    .hero-title { font-size: 1.9rem; }
    .hero-subtitle { font-size: 0.95rem; }

    .page-title { font-size: 1.5rem; margin: 22px 0 5px; }
    .page-subtitle { font-size: 0.92rem; margin-bottom: 22px; }

    .year-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .year-card .year-number { font-size: 2rem; }
    .year-card-overlay { padding: 14px; }

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

    .category-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .category-cover { height: 110px; }

    .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }

    .file-card, .audio-card { padding: 12px 14px; }
    .audio-card audio { max-width: 200px; }

    .story-card { padding: 18px; }

    .stories-grid, .files-list, .audio-list { margin-bottom: 28px; }

    .admin-header h1 { font-size: 1.4rem; }
    .admin-table th, .admin-table td { padding: 8px 10px; }

    .slider-nav { width: 34px; height: 34px; font-size: 1rem; }
}

/* Small tablets (641-768px) — portrait */
@media (min-width: 641px) and (max-width: 768px) {
    .container { padding: 0 16px; }
    .hero { height: 280px; }
    .hero-title { font-size: 2.2rem; }
    .hero-subtitle { font-size: 1rem; }
    .page-title { font-size: 1.8rem; }
    .year-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .photo-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .category-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .category-cover { height: 120px; }
    .stories-grid { gap: 14px; }
    .files-list { gap: 8px; }
    .audio-list { gap: 8px; }
    .audio-card audio { max-width: 200px; }
    .admin-header { flex-direction: row; align-items: center; gap: 12px; }
    .admin-table th, .admin-table td { padding: 8px 10px; }
    .slider-nav { width: 36px; height: 36px; font-size: 1rem; }
}

/* Tablets (769-1024px) landscape */
@media (min-width: 769px) and (max-width: 1024px) {
    .year-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    .photo-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    .category-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
    .hero-title { font-size: 3rem; }
    .hero-subtitle { font-size: 1.4rem; }
    .hero { height: 340px; }
    .container { padding: 0 20px; }
    .admin-header { flex-direction: row; align-items: center; gap: 14px; }
    .stories-grid { gap: 16px; }
    .files-list { gap: 10px; }
    .audio-list { gap: 10px; }
}

/* Print */
@media print {
    .header, .footer, .nav-links, .theme-toggle, .slider, .sticky-player,
    .admin-header-actions, .admin-actions, .card-dl-btn, .btn, .search-section,
    .story-years-bar, .years-bar, .audio-years-bar { display: none !important; }
    body { background: #fff; color: #000; animation: none; }
    * { transition: none !important; animation: none !important; }
    .container { max-width: 100%; padding: 0; }
    .hero { height: auto; min-height: 200px; }
    .hero-overlay { position: relative; background: none !important; padding: 40px 0; }
    .hero-title, .hero-subtitle { color: #000; -webkit-text-stroke: 0; text-stroke: 0; text-shadow: none; }
    .photo-card, .year-card, .story-card, .file-card, .audio-card, .event-card, .category-card { break-inside: avoid; border-color: #ddd; }
    .photo-overlay { opacity: 1 !important; transform: none !important; background: linear-gradient(transparent, rgba(0,0,0,0.7)); }
}
