/* ========================================
   LPM HIMMAH - Arsip Digital
   Classic Newspaper Archive Theme
   ======================================== */

/* CSS Variables */
:root {
    /* Primary Colors - Red/White LPM Himmah Palette */
    --primary: #C41E3A;
    --primary-dark: #9B1B2F;
    --primary-light: #DC3545;
    --secondary: #2C3E50;
    --accent: #E74C3C;
    
    /* Category Colors */
    --muhibbah: #8B0000;
    --himmah: #C41E3A;
    --kobarkobari: #2C3E50;
    
    /* Light Theme Neutrals */
    --bg-light: #FAFAFA;
    --bg-lighter: #FFFFFF;
    --bg-warm: #F8F8F8;
    --bg-card: #FFFFFF;
    --bg-card-hover: #FFF5F5;
    --text-primary: #2C2C2C;
    --text-secondary: #5C5C5C;
    --text-muted: #8C8C8C;
    --border: rgba(0, 0, 0, 0.1);
    --border-light: rgba(0, 0, 0, 0.06);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #C41E3A 0%, #DC3545 100%);
    --gradient-hero: linear-gradient(180deg, #FAFAFA 0%, #F5F5F5 100%);
    --gradient-card: linear-gradient(180deg, #FFFFFF 0%, #FAFAFA 100%);
    
    /* Effects */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.06);
    
    /* Spacing */
    --container-width: 1280px;
    --section-padding: 100px;
    
    /* Typography */
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Container */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ========================================
   Navigation
   ======================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition-normal);
}

.navbar.scrolled {
    box-shadow: var(--shadow-sm);
}

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

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    font-size: 28px;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.nav-link-external {
    padding: 10px 20px;
    background: var(--gradient-primary);
    border-radius: 8px;
    color: white;
}

.nav-link-external:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    color: white;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition-fast);
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 120px 24px 80px;
    overflow: hidden;
    background: var(--gradient-hero);
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%238B4513' fill-opacity='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
}

.hero-badge {
    display: inline-block;
    padding: 8px 20px;
    background: rgba(139, 69, 19, 0.1);
    border: 1px solid rgba(139, 69, 19, 0.2);
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 24px;
    animation: fadeInUp 0.6s ease;
}

.hero-title {
    font-size: clamp(36px, 6vw, 72px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
    color: var(--text-primary);
    animation: fadeInUp 0.6s ease 0.1s both;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 40px;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-bottom: 48px;
    animation: fadeInUp 0.6s ease 0.3s both;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 36px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 32px;
    background: var(--gradient-primary);
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    border-radius: 12px;
    transition: var(--transition-normal);
    animation: fadeInUp 0.6s ease 0.4s both;
    box-shadow: var(--shadow-md);
}

.hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.hero-cta svg {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(5px); }
    60% { transform: translateY(3px); }
}

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

/* ========================================
   Search & Filter Section
   ======================================== */
.search-section {
    padding: 80px 0 40px;
    background: var(--bg-light);
}

.search-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
}

.filter-bar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 500px;
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-input {
    width: 100%;
    padding: 16px 20px 16px 52px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.15);
}

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

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    font-family: inherit;
    box-shadow: var(--shadow-sm);
}

.filter-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--primary-light);
}

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

.filter-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.filter-dot.muhibbah { background: var(--muhibbah); }
.filter-dot.himmah { background: var(--himmah); }
.filter-dot.kobarkobari { background: var(--kobarkobari); }

/* ========================================
   Publications Grid
   ======================================== */
.publications-section {
    padding: 40px 0 var(--section-padding);
    background: var(--bg-warm);
}

.publications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.publication-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    overflow: hidden;
    transition: var(--transition-normal);
    cursor: pointer;
    box-shadow: var(--shadow-card);
}

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

.card-thumbnail {
    position: relative;
    aspect-ratio: 3/4;
    background: var(--gradient-card);
    overflow: hidden;
}

.card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.publication-card:hover .card-thumbnail img {
    transform: scale(1.05);
}

.card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    opacity: 0.4;
    background: linear-gradient(180deg, #F5F0E8 0%, #EDE8E0 100%);
}

.card-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-category {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card-category.muhibbah {
    background: rgba(139, 0, 0, 0.9);
    color: white;
}

.card-category.himmah {
    background: rgba(47, 79, 79, 0.9);
    color: white;
}

.card-category.kobarkobari {
    background: rgba(85, 107, 47, 0.9);
    color: white;
}

.card-content {
    padding: 20px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-primary);
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 13px;
}

.card-year {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Loading State */
.loading-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
    color: var(--text-muted);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

/* No Results */
.no-results {
    text-align: center;
    padding: 80px 24px;
    color: var(--text-secondary);
}

.no-results-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.no-results h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

/* ========================================
   About Section
   ======================================== */
.about-section {
    padding: var(--section-padding) 0;
    background: var(--bg-light);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-content .section-title {
    text-align: left;
    margin-bottom: 24px;
}

.about-text {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 16px;
}

.about-text strong {
    color: var(--text-primary);
}

.about-cta {
    margin-top: 32px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-fast);
    cursor: pointer;
    border: none;
    font-family: inherit;
}

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

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Timeline */
.about-timeline {
    position: relative;
    padding-left: 30px;
}

.about-timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: 32px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -30px;
    top: 4px;
    width: 14px;
    height: 14px;
    background: var(--primary);
    border-radius: 50%;
    border: 3px solid var(--bg-light);
}

.timeline-year {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.timeline-content h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.timeline-content p {
    font-size: 14px;
    color: var(--text-muted);
}

/* ========================================
   Footer
   ======================================== */
.footer {
    padding: 60px 0 30px;
    background: #2C2C2C;
    border-top: 4px solid var(--primary);
}

.footer-content {
    text-align: center;
    margin-bottom: 40px;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.footer-brand .logo-text {
    color: white;
}

.footer-text {
    color: #A0A0A0;
    font-size: 14px;
    max-width: 400px;
    margin: 0 auto 24px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
}

.footer-links a {
    color: #CCCCCC;
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition-fast);
}

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

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

.footer-bottom p {
    color: #666666;
    font-size: 13px;
}

/* ========================================
   Modal
   ======================================== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(20, 15, 10, 0.85);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 95vw;
    max-height: 95vh;
    height: 95vh;
    background: linear-gradient(180deg, #3D3530 0%, #2A2420 100%);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.5),
        0 10px 30px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, transparent 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
    color: #F5F0E8;
    max-width: 70%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #C4B8A8;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #F5F0E8;
    transform: scale(1.05);
}

.modal-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    min-height: 0;
    height: calc(100vh - 160px);
}

/* ========================================
   Paper-Style PDF Reader
   ======================================== */
.pdf-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.paper-reader {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* The Desk - Wooden table surface */
.paper-desk {
    flex: 1;
    background:
        radial-gradient(ellipse at center, #4A3F35 0%, #3A302A 50%, #2A2420 100%),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-blend-mode: overlay;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: auto;
}

/* Wood grain texture overlay */
.paper-desk::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 100px,
            rgba(0, 0, 0, 0.03) 100px,
            rgba(0, 0, 0, 0.03) 102px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 50px,
            rgba(255, 255, 255, 0.01) 50px,
            rgba(255, 255, 255, 0.01) 51px
        );
    pointer-events: none;
}

/* Ambient lighting */
.paper-desk::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 60%;
    background: radial-gradient(ellipse at top, rgba(255, 245, 230, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

/* Paper shadow on desk */
.paper-shadow {
    position: absolute;
    width: 90%;
    max-width: 700px;
    height: 95%;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.4) 0%, transparent 70%);
    transform: translateY(20px) scaleY(0.3);
    filter: blur(20px);
    z-index: 0;
}

/* Paper stack - creates depth */
.paper-stack {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Stacked paper effect */
.paper-stack::before,
.paper-stack::after {
    content: '';
    position: absolute;
    background: #F8F4EE;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.paper-stack::before {
    width: calc(100% - 8px);
    height: calc(100% - 4px);
    bottom: -6px;
    left: 4px;
    transform: rotate(0.5deg);
    background: linear-gradient(180deg, #F0EBE3 0%, #E8E3DB 100%);
}

.paper-stack::after {
    width: calc(100% - 16px);
    height: calc(100% - 8px);
    bottom: -12px;
    left: 8px;
    transform: rotate(-0.3deg);
    background: linear-gradient(180deg, #E8E3DB 0%, #DDD8D0 100%);
}

/* The paper page itself */
.paper-page {
    position: relative;
    z-index: 2;
    background: linear-gradient(135deg, #FEFCF8 0%, #F8F4EE 50%, #F5F0E8 100%);
    border-radius: 3px;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.15),
        0 8px 24px rgba(0, 0, 0, 0.1),
        inset 0 0 60px rgba(139, 90, 43, 0.03);
    max-width: 100%;
    max-height: 100%;
}

/* Paper texture */
.paper-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='paper'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.04' numOctaves='5' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23paper)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    border-radius: 3px;
}

/* Subtle page aging effect */
.paper-page::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to right, rgba(139, 90, 43, 0.05) 0%, transparent 5%),
        linear-gradient(to left, rgba(139, 90, 43, 0.03) 0%, transparent 3%),
        linear-gradient(to bottom, rgba(139, 90, 43, 0.02) 0%, transparent 2%);
    pointer-events: none;
    border-radius: 3px;
}

/* Page curl effect */
.page-curl {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, transparent 50%, rgba(0, 0, 0, 0.1) 50%);
    border-radius: 0 0 3px 0;
    z-index: 3;
    pointer-events: none;
    opacity: 0.5;
}

/* ========================================
   Reader Controls
   ======================================== */
.reader-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: linear-gradient(180deg, #2A2420 0%, #1F1B18 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    gap: 16px;
}

.controls-left,
.controls-center,
.controls-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.controls-center {
    flex: 1;
    justify-content: center;
}

.control-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #C4B8A8;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
    color: #F5F0E8;
    transform: translateY(-1px);
}

.control-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.control-btn.nav-btn {
    width: 44px;
    height: 44px;
    background: linear-gradient(180deg, rgba(196, 30, 58, 0.8) 0%, rgba(156, 20, 48, 0.8) 100%);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.control-btn.nav-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, rgba(220, 53, 69, 0.9) 0%, rgba(196, 30, 58, 0.9) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.3);
}

.zoom-level {
    min-width: 50px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #A89888;
}

.page-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.page-input {
    width: 48px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #F5F0E8;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    font-family: inherit;
}

.page-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.15);
}

.page-input::-webkit-outer-spin-button,
.page-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.page-separator {
    color: #6A5F55;
    font-weight: 500;
}

#totalPages {
    color: #A89888;
    font-size: 14px;
    font-weight: 600;
}

/* ========================================
   Paper Loading Animation
   ======================================== */
.paper-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #3D3530 0%, #2A2420 100%);
    z-index: 100;
}

.loading-book {
    position: relative;
    width: 80px;
    height: 60px;
    perspective: 400px;
}

.book-page {
    position: absolute;
    width: 40px;
    height: 60px;
    background: linear-gradient(90deg, #F5F0E8 0%, #E8E3DB 100%);
    border-radius: 2px;
    transform-origin: left center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.book-page:nth-child(1) {
    left: 40px;
    animation: flipPage 1.5s ease-in-out infinite;
}

.book-page:nth-child(2) {
    left: 40px;
    animation: flipPage 1.5s ease-in-out infinite 0.3s;
}

.book-page:nth-child(3) {
    left: 40px;
    animation: flipPage 1.5s ease-in-out infinite 0.6s;
}

@keyframes flipPage {
    0%, 100% {
        transform: rotateY(0deg);
    }
    50% {
        transform: rotateY(-180deg);
    }
}

.paper-loading p {
    margin-top: 24px;
    color: #A89888;
    font-size: 14px;
    font-weight: 500;
}

/* Load Error */
.load-error {
    text-align: center;
    padding: 40px;
}

.load-error .error-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.load-error h3 {
    font-size: 20px;
    color: #F5F0E8;
    margin-bottom: 8px;
}

.load-error p {
    color: #A89888;
    margin-bottom: 24px;
}

.error-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Modal Footer */
.modal-footer-simple {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    background: linear-gradient(180deg, #1F1B18 0%, #181512 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-download {
    background: linear-gradient(180deg, #C41E3A 0%, #9B1B2F 100%);
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.3);
}

.btn-download:hover {
    background: linear-gradient(180deg, #DC3545 0%, #C41E3A 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(196, 30, 58, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #F5F0E8;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.modal-content-simple {
    max-width: 95vw;
    max-height: 95vh;
    height: 95vh;
}

/* Fullscreen Mode */
.modal.fullscreen {
    padding: 0;
}

.modal.fullscreen .modal-content {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
}

.modal.fullscreen .paper-desk {
    padding: 40px;
}


/* ========================================
   Responsive
   ======================================== */
@media (max-width: 968px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-content .section-title {
        text-align: center;
    }

    .about-text {
        text-align: center;
    }

    .about-cta {
        text-align: center;
    }
}

@media (max-width: 768px) {
    :root {
        --section-padding: 60px;
    }

    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .hero-stats {
        gap: 24px;
    }

    .stat-number {
        font-size: 28px;
    }

    .filter-buttons {
        width: 100%;
    }

    .filter-btn {
        flex: 1;
        min-width: calc(50% - 6px);
        justify-content: center;
    }

    .publications-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }

    /* Modal responsive */
    .modal {
        padding: 8px;
    }

    .modal-content {
        max-height: 98vh;
        border-radius: 16px;
    }

    .modal-header {
        padding: 12px 16px;
    }

    .modal-title {
        font-size: 14px;
        max-width: 60%;
    }

    .paper-desk {
        padding: 16px;
    }

    .reader-controls {
        padding: 10px 12px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .controls-left {
        order: 2;
        flex: 1;
        justify-content: flex-start;
    }

    .controls-center {
        order: 1;
        width: 100%;
        justify-content: center;
    }

    .controls-right {
        order: 3;
        flex: 1;
        justify-content: flex-end;
    }

    .control-btn {
        width: 36px;
        height: 36px;
    }

    .control-btn.nav-btn {
        width: 40px;
        height: 40px;
    }

    .zoom-level {
        display: none;
    }

    .page-info {
        padding: 6px 12px;
    }

    .page-input {
        width: 40px;
        padding: 4px 6px;
        font-size: 13px;
    }

    .modal-footer-simple {
        padding: 10px 16px;
    }

    .btn-download {
        padding: 10px 20px;
        font-size: 14px;
    }
}


@media (max-width: 480px) {
    .hero-title {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .hero-stats {
        flex-direction: column;
        gap: 16px;
    }

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

    /* Very small screens */
    .modal-header {
        padding: 10px 12px;
    }

    .modal-title {
        font-size: 13px;
    }

    .paper-desk {
        padding: 12px;
    }

    .control-btn {
        width: 32px;
        height: 32px;
    }

    .control-btn.nav-btn {
        width: 36px;
        height: 36px;
    }

    #fitWidth,
    #fullscreenBtn {
        display: none;
    }
}
