/* ===== DARK ACADEMIA LIBRARY THEME ===== */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=Crimson+Text:ital,wght@0,400;0,600;1,400&family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400&display=swap');

:root {
    --bg-dark: #0d0d0d;
    --bg-darker: #080808;
    --bg-card: #1a1612;
    --bg-card-hover: #231e19;
    --gold: #c9a227;
    --gold-light: #e8c547;
    --gold-dark: #8b7119;
    --cream: #f5e6c8;
    --cream-dark: #d4c4a0;
    --burgundy: #722f37;
    --burgundy-light: #8b3a44;
    --green-dark: #1a3c2a;
    --text-light: #e8dcc8;
    --text-muted: #9a8b7a;
    --border-gold: rgba(201, 162, 39, 0.3);
    --shadow-gold: rgba(201, 162, 39, 0.15);
    --font-display: 'Cinzel', serif;
    --font-body: 'EB Garamond', serif;
    --font-accent: 'Crimson Text', serif;
}

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

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--gold-dark), var(--gold));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold-light);
}

/* ===== ANIMATED BACKGROUND ===== */
body {
    font-family: var(--font-body);
    background: var(--bg-dark);
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
}

.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

#particleCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Floating Books Background */
.floating-books {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.float-book {
    position: absolute;
    font-size: 2rem;
    opacity: 0.03;
    animation: floatBook 20s infinite ease-in-out;
}

.float-book:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; }
.float-book:nth-child(2) { left: 30%; top: 60%; animation-delay: -4s; }
.float-book:nth-child(3) { left: 50%; top: 30%; animation-delay: -8s; }
.float-book:nth-child(4) { left: 70%; top: 70%; animation-delay: -12s; }
.float-book:nth-child(5) { left: 90%; top: 40%; animation-delay: -16s; }

@keyframes floatBook {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-30px) rotate(5deg); }
    50% { transform: translateY(-10px) rotate(-3deg); }
    75% { transform: translateY(-40px) rotate(3deg); }
}

/* ===== MAIN CONTAINER ===== */
.library-container {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    background: linear-gradient(180deg,
        rgba(26, 22, 18, 0.98) 0%,
        rgba(13, 13, 13, 0.99) 100%);
    min-height: 100vh;
    box-shadow:
        0 0 100px rgba(0, 0, 0, 0.8),
        inset 0 0 100px rgba(201, 162, 39, 0.03);
    border-left: 1px solid var(--border-gold);
    border-right: 1px solid var(--border-gold);
}

/* ===== HEADER ===== */
.library-header {
    background: linear-gradient(180deg,
        var(--bg-card) 0%,
        var(--bg-darker) 100%);
    padding: 4rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-bottom: 2px solid var(--gold-dark);
}

.library-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(201, 162, 39, 0.1) 0%, transparent 60%),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
}

/* Header Ornaments */
.header-ornament {
    position: absolute;
    width: 80px;
    height: 80px;
    opacity: 0.4;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath fill='%23c9a227' d='M50 0 L60 40 L100 50 L60 60 L50 100 L40 60 L0 50 L40 40 Z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.header-ornament.top-left { top: 20px; left: 20px; }
.header-ornament.top-right { top: 20px; right: 20px; transform: rotate(90deg); }
.header-ornament.bottom-left { bottom: 20px; left: 20px; transform: rotate(-90deg); }
.header-ornament.bottom-right { bottom: 20px; right: 20px; transform: rotate(180deg); }

/* Candles */
.candle {
    position: absolute;
    bottom: 30px;
    width: 20px;
    height: 60px;
    background: linear-gradient(180deg, #f5e6c8 0%, #d4b896 100%);
    border-radius: 3px 3px 0 0;
}

.left-candle { left: 60px; }
.right-candle { right: 60px; }

.flame {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 25px;
    background: radial-gradient(ellipse at bottom,
        #ffd700 0%,
        #ff8c00 40%,
        #ff4500 70%,
        transparent 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: flicker 0.5s infinite alternate;
    box-shadow:
        0 0 10px #ffd700,
        0 0 20px #ff8c00,
        0 0 30px rgba(255, 140, 0, 0.5);
}

@keyframes flicker {
    0%, 100% {
        transform: translateX(-50%) scale(1) rotate(-2deg);
        opacity: 1;
    }
    25% {
        transform: translateX(-50%) scale(1.05, 0.95) rotate(1deg);
        opacity: 0.9;
    }
    50% {
        transform: translateX(-50%) scale(0.95, 1.05) rotate(-1deg);
        opacity: 1;
    }
    75% {
        transform: translateX(-50%) scale(1.02, 0.98) rotate(2deg);
        opacity: 0.95;
    }
}

/* Header Content */
.header-content {
    position: relative;
    z-index: 2;
}

.header-icon {
    font-size: 3rem;
    color: var(--gold);
    margin-bottom: 1rem;
    text-shadow: 0 0 30px rgba(201, 162, 39, 0.5);
    animation: iconGlow 3s ease-in-out infinite;
}

@keyframes iconGlow {
    0%, 100% { text-shadow: 0 0 30px rgba(201, 162, 39, 0.5); }
    50% { text-shadow: 0 0 50px rgba(201, 162, 39, 0.8), 0 0 80px rgba(201, 162, 39, 0.4); }
}

.library-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.title-line {
    font-family: var(--font-accent);
    font-size: 1rem;
    color: var(--gold);
    letter-spacing: 8px;
    text-transform: uppercase;
}

.title-main {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 600;
    color: var(--cream);
    letter-spacing: 4px;
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(201, 162, 39, 0.2);
    animation: titleShimmer 5s ease-in-out infinite;
}

@keyframes titleShimmer {
    0%, 100% { text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), 0 0 40px rgba(201, 162, 39, 0.2); }
    50% { text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), 0 0 60px rgba(201, 162, 39, 0.4); }
}

.library-subtitle {
    font-family: var(--font-accent);
    font-size: 1.2rem;
    font-style: italic;
    color: var(--text-muted);
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.subtitle-ornament {
    color: var(--gold);
    font-style: normal;
}

/* ===== NAVIGATION ===== */
.library-nav {
    background: linear-gradient(180deg, var(--bg-darker) 0%, var(--bg-card) 100%);
    border-bottom: 1px solid var(--border-gold);
    padding: 1rem 2rem;
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-left, .nav-right {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.nav-btn {
    background: transparent;
    border: 1px solid var(--border-gold);
    color: var(--text-muted);
    padding: 0.75rem 1.5rem;
    font-family: var(--font-display);
    font-size: 0.85rem;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

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

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

.nav-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(201, 162, 39, 0.2);
}

.nav-btn.active {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    border-color: var(--gold);
    color: var(--bg-dark);
}

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

.back-btn {
    background: linear-gradient(135deg, var(--green-dark), #2a5c4a);
    border-color: #3d8b6a;
    color: var(--cream);
}

.back-btn:hover {
    background: linear-gradient(135deg, #2a5c4a, var(--green-dark));
    border-color: #4da87d;
    color: var(--cream);
}

.admin-nav-btn.active-admin {
    background: linear-gradient(135deg, var(--burgundy), var(--burgundy-light));
    border-color: var(--burgundy-light);
    color: var(--cream);
    animation: adminPulse 2s ease-in-out infinite;
}

@keyframes adminPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(114, 47, 55, 0.4); }
    50% { box-shadow: 0 0 25px rgba(114, 47, 55, 0.8); }
}

/* ===== SEARCH SECTION ===== */
.search-section {
    background: var(--bg-card);
    padding: 2rem;
    border-bottom: 1px solid var(--border-gold);
}

.search-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    color: var(--gold);
    font-size: 1rem;
    z-index: 2;
}

.search-input {
    width: 100%;
    padding: 1rem 3rem 1rem 3.5rem;
    font-family: var(--font-body);
    font-size: 1.1rem;
    background: var(--bg-darker);
    border: 2px solid var(--border-gold);
    border-radius: 8px;
    color: var(--text-light);
    transition: all 0.4s ease;
}

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

.search-input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow:
        0 0 20px rgba(201, 162, 39, 0.2),
        inset 0 0 20px rgba(201, 162, 39, 0.05);
}

.clear-search-btn {
    position: absolute;
    right: 1rem;
    background: var(--gold-dark);
    border: none;
    color: var(--bg-dark);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.clear-search-btn:hover {
    background: var(--gold);
    transform: rotate(90deg);
}

.search-results-count {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-muted);
    font-family: var(--font-accent);
    font-style: italic;
    min-height: 1.5rem;
}

/* ===== CONTROLS SECTION ===== */
.controls-section {
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-darker) 100%);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-gold);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

.genre-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    flex: 1;
}

.genre-btn {
    background: transparent;
    border: 1px solid rgba(201, 162, 39, 0.2);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.genre-btn i {
    font-size: 0.8rem;
    color: var(--gold-dark);
    transition: all 0.3s ease;
}

.genre-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 5px 15px rgba(201, 162, 39, 0.2);
}

.genre-btn:hover i {
    color: var(--gold-light);
    transform: scale(1.2);
}

.genre-btn.active {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    border-color: var(--gold);
    color: var(--bg-dark);
}

.genre-btn.active i {
    color: var(--bg-dark);
}

.action-buttons {
    display: flex;
    gap: 0.75rem;
}

.action-btn {
    background: transparent;
    border: 2px solid var(--border-gold);
    color: var(--text-muted);
    padding: 0.6rem 1.2rem;
    font-family: var(--font-display);
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stats-btn:hover {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    border-color: var(--gold);
    color: var(--bg-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(201, 162, 39, 0.3);
}

.donate-btn:hover {
    background: linear-gradient(135deg, var(--burgundy), var(--burgundy-light));
    border-color: var(--burgundy-light);
    color: var(--cream);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(114, 47, 55, 0.3);
}

/* ===== STATS DASHBOARD ===== */
.stats-dashboard {
    background: var(--bg-card);
    margin: 2rem;
    padding: 2rem;
    border: 2px solid var(--border-gold);
    border-radius: 12px;
    animation: slideDown 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

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

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

.stats-header h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--gold);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.close-stats {
    background: transparent;
    border: 1px solid var(--border-gold);
    color: var(--text-muted);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-stats:hover {
    background: var(--burgundy);
    border-color: var(--burgundy);
    color: var(--cream);
    transform: rotate(90deg);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-darker);
    border: 1px solid var(--border-gold);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.stat-card:hover {
    transform: translateY(-8px);
    border-color: var(--gold);
    box-shadow: 0 10px 30px rgba(201, 162, 39, 0.2);
}

.stat-icon {
    font-size: 2.5rem;
    color: var(--gold);
    margin-bottom: 1rem;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: var(--cream);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-family: var(--font-accent);
    font-size: 0.95rem;
    color: var(--text-muted);
}

.recommendations-section {
    background: var(--bg-darker);
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid var(--border-gold);
}

.recommendations-section h3 {
    font-family: var(--font-display);
    color: var(--gold);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.recommendations-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.recommendation-card {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.recommendation-card:hover {
    transform: translateY(-5px);
    border-color: var(--gold);
    box-shadow: 0 5px 15px rgba(201, 162, 39, 0.2);
}

.recommendation-card .book-title {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--cream);
    margin-bottom: 0.5rem;
}

.recommendation-card .book-genre {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===== MAIN CONTENT ===== */
.library-main {
    padding: 2rem;
    min-height: 60vh;
}

.books-section {
    display: none;
}

.books-section.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

.section-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.section-ornament {
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.section-title {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--cream);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    white-space: nowrap;
}

.section-title i {
    color: var(--gold);
}

/* ===== BOOKSHELF ===== */
.bookshelf-container {
    position: relative;
    padding: 2rem;
    background: linear-gradient(180deg,
        rgba(26, 22, 18, 0.5) 0%,
        rgba(13, 13, 13, 0.8) 100%);
    border-radius: 12px;
    border: 1px solid var(--border-gold);
}

.bookshelf {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    padding: 2rem 2rem 3.5rem;
    min-height: 320px;
    align-items: flex-end;
    position: relative;
    perspective: 1500px;
}

.shelf-wood {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 25px;
    background: linear-gradient(180deg,
        #5c4a3d 0%,
        #4a3c32 30%,
        #3d3129 60%,
        #2e2520 100%);
    border-radius: 0 0 10px 10px;
    box-shadow:
        0 5px 20px rgba(0, 0, 0, 0.5),
        inset 0 2px 3px rgba(255, 255, 255, 0.1);
}

.shelf-wood::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(90deg,
        transparent,
        transparent 20px,
        rgba(0, 0, 0, 0.1) 20px,
        rgba(0, 0, 0, 0.1) 21px);
}

/* ===== BOOK CARDS ===== */
.book-card {
    width: 50px;
    height: 280px;
    border-radius: 3px 3px 0 0;
    cursor: pointer;
    position: relative;
    transform-style: preserve-3d;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow:
        -3px 0 8px rgba(0, 0, 0, 0.5),
        2px 0 5px rgba(0, 0, 0, 0.3),
        inset -2px 0 4px rgba(0, 0, 0, 0.4),
        inset 2px 0 4px rgba(255, 255, 255, 0.15);
    animation: bookAppear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
    animation-delay: calc(var(--book-index, 0) * 0.04s);
    flex-shrink: 0;
}

@keyframes bookAppear {
    from {
        opacity: 0;
        transform: translateY(40px) rotateX(-20deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}

/* Book spine title */
.book-card::before {
    content: attr(data-spine-title);
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) rotate(-90deg);
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
    max-width: 230px;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    z-index: 1;
}

/* Page edges */
.book-card::after {
    content: '';
    position: absolute;
    right: 2px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: repeating-linear-gradient(0deg,
        #f5e6c8, #f5e6c8 0.5px,
        #d4c4a0 0.5px, #d4c4a0 1px);
    opacity: 0.6;
    box-shadow: 1px 0 2px rgba(0, 0, 0, 0.2);
}

.book-card:hover {
    transform: translateY(-50px) translateZ(20px) scale(1.03);
    box-shadow:
        -3px 0 12px rgba(0, 0, 0, 0.6),
        3px 55px 35px rgba(0, 0, 0, 0.5),
        inset -2px 0 6px rgba(0, 0, 0, 0.5),
        inset 2px 0 6px rgba(255, 255, 255, 0.2),
        0 0 30px rgba(201, 162, 39, 0.15);
    z-index: 100;
    filter: brightness(1.1);
}

/* Hidden book info - shows on hover */
.book-cover, .book-title, .book-info, .book-status, .checkout-info {
    display: none;
}

.book-card:hover .book-cover,
.book-card:hover .book-title,
.book-card:hover .book-info,
.book-card:hover .book-status,
.book-card:hover .checkout-info {
    display: block;
}

/* Info popup */
.book-card .book-cover {
    position: absolute;
    left: 60px;
    top: -30px;
    background: var(--bg-card);
    border: 2px solid var(--gold-dark);
    border-radius: 12px;
    padding: 1.5rem;
    min-width: 260px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    z-index: 1000;
    animation: cardSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateX(-15px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.book-card .book-cover::before {
    content: '\f02d';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 2.5rem;
    color: var(--gold);
    display: block;
    text-align: center;
    margin-bottom: 1rem;
}

.book-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--cream);
    margin-bottom: 1rem;
    text-align: center;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-gold);
}

.book-info {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0.4rem 0;
}

.book-status {
    margin-top: 1rem;
    padding: 0.6rem;
    border-radius: 6px;
    font-family: var(--font-display);
    font-size: 0.85rem;
    text-align: center;
    letter-spacing: 1px;
}

.status-available {
    background: linear-gradient(135deg, var(--green-dark), #2a5c4a);
    color: var(--cream);
    border: 1px solid #3d8b6a;
}

.status-checkedout {
    background: linear-gradient(135deg, var(--burgundy), var(--burgundy-light));
    color: var(--cream);
    border: 1px solid #a04450;
}

.checkout-info {
    font-family: var(--font-accent);
    font-size: 0.85rem;
    font-style: italic;
    color: var(--text-muted);
    text-align: center;
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: rgba(201, 162, 39, 0.1);
    border-radius: 4px;
}

/* Empty State */
.empty-shelf {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    font-family: var(--font-accent);
    font-size: 1.2rem;
    font-style: italic;
    width: 100%;
}

/* ===== MODALS ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-darker) 100%);
    margin: 5% auto;
    border: 2px solid var(--gold-dark);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.7),
        0 0 60px rgba(201, 162, 39, 0.1);
    animation: modalSlide 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: flex-end;
    padding: 1rem;
}

.close {
    background: transparent;
    border: 1px solid var(--border-gold);
    color: var(--text-muted);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.close:hover {
    background: var(--burgundy);
    border-color: var(--burgundy);
    color: var(--cream);
    transform: rotate(90deg);
}

.modal-body {
    padding: 0 2.5rem 2.5rem;
    text-align: center;
    overflow-y: auto;
    max-height: calc(85vh - 100px);
}

.book-cover-large {
    font-size: 4rem;
    color: var(--gold);
    margin-bottom: 1.5rem;
    text-shadow: 0 0 30px rgba(201, 162, 39, 0.4);
}

.modal-body h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--cream);
    margin-bottom: 1.5rem;
}

.modal-details {
    margin: 1.5rem 0;
}

.modal-info {
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: var(--text-muted);
    margin: 0.75rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.modal-info i {
    color: var(--gold);
}

.modal-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.modal-btn {
    background: transparent;
    border: 2px solid var(--gold-dark);
    color: var(--gold);
    padding: 1rem 2rem;
    font-family: var(--font-display);
    font-size: 0.95rem;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.modal-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(201, 162, 39, 0.3);
}

.modal-btn.primary-btn {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    border-color: var(--gold);
    color: var(--bg-dark);
}

.modal-btn.primary-btn:hover {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
}

.modal-btn.checkin-btn {
    background: linear-gradient(135deg, var(--green-dark), #2a5c4a);
    border-color: #3d8b6a;
    color: var(--cream);
}

.modal-btn.checkin-btn:hover {
    background: linear-gradient(135deg, #2a5c4a, #3d8b6a);
}

.modal-btn.delete-btn {
    background: linear-gradient(135deg, var(--burgundy), var(--burgundy-light));
    border-color: var(--burgundy-light);
    color: var(--cream);
}

.modal-btn.delete-btn:hover {
    background: linear-gradient(135deg, var(--burgundy-light), #a04450);
}

.modal-btn.cancel-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-muted);
    color: var(--text-muted);
}

.modal-btn.cancel-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-light);
    color: var(--text-light);
}

/* Form Styles */
.donate-form {
    max-width: 400px;
    margin: 0 auto;
    text-align: left;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-family: var(--font-display);
    font-size: 0.9rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.9rem 1rem;
    font-family: var(--font-body);
    font-size: 1rem;
    background: var(--bg-darker);
    border: 2px solid var(--border-gold);
    border-radius: 6px;
    color: var(--text-light);
    transition: all 0.3s ease;
}

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

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 15px rgba(201, 162, 39, 0.2);
}

.form-group select {
    cursor: pointer;
}

#checkout-name {
    width: 100%;
    max-width: 350px;
    padding: 1rem;
    font-family: var(--font-body);
    font-size: 1rem;
    background: var(--bg-darker);
    border: 2px solid var(--border-gold);
    border-radius: 6px;
    color: var(--text-light);
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

#checkout-name:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 15px rgba(201, 162, 39, 0.2);
}

/* About Modal */
.about-modal {
    max-width: 700px;
}

.about-content {
    text-align: left;
    max-width: 550px;
    margin: 0 auto;
}

.about-content p {
    font-family: var(--font-body);
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.about-content h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--gold);
    margin: 2rem 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.about-content ul {
    margin: 0 0 1.5rem 1.5rem;
    color: var(--text-muted);
    line-height: 1.8;
}

.about-content li {
    margin-bottom: 0.5rem;
}

.about-content strong {
    color: var(--cream);
}

.about-content code {
    background: var(--bg-darker);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: var(--gold);
    border: 1px solid var(--border-gold);
}

.about-links {
    margin-top: 2rem;
    text-align: center;
}

/* ===== FOOTER ===== */
.library-footer {
    background: linear-gradient(180deg, var(--bg-darker) 0%, var(--bg-card) 100%);
    text-align: center;
    padding: 3rem 2rem;
    border-top: 1px solid var(--border-gold);
    position: relative;
}

.footer-ornament {
    width: 150px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 0 auto 1.5rem;
}

.library-footer p {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.library-footer i {
    color: var(--gold);
}

.footer-quote {
    font-family: var(--font-accent);
    font-style: italic;
    font-size: 0.95rem !important;
    margin-top: 1rem !important;
    color: var(--text-muted);
    opacity: 0.7;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .title-main {
        font-size: 2rem;
    }

    .title-line {
        font-size: 0.8rem;
        letter-spacing: 4px;
    }

    .candle {
        display: none;
    }

    .header-ornament {
        width: 40px;
        height: 40px;
    }

    .nav-inner {
        flex-direction: column;
    }

    .nav-left, .nav-right {
        width: 100%;
        justify-content: center;
    }

    .nav-btn span {
        display: none;
    }

    .nav-btn {
        padding: 0.75rem;
    }

    .controls-section {
        flex-direction: column;
    }

    .genre-filters {
        width: 100%;
    }

    .genre-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

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

    .bookshelf {
        padding: 1.5rem 1rem 3rem;
    }

    .book-card {
        width: 42px;
        height: 240px;
    }

    .book-card::before {
        font-size: 0.6rem;
        max-width: 200px;
    }

    .book-card .book-cover {
        min-width: 200px;
        left: 50px;
        padding: 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .section-ornament {
        width: 50px;
    }

    .stats-dashboard {
        margin: 1rem;
        padding: 1.5rem;
    }

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

    .modal-content {
        width: 95%;
        margin: 3% auto;
    }

    .modal-body {
        padding: 0 1.5rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .library-header {
        padding: 2.5rem 1rem;
    }

    .title-main {
        font-size: 1.5rem;
        letter-spacing: 2px;
    }

    .library-subtitle {
        font-size: 0.9rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .book-card {
        width: 38px;
        height: 220px;
    }

    .book-card:hover {
        transform: translateY(-40px) translateZ(15px);
    }

    .book-card .book-cover {
        min-width: 180px;
        left: 45px;
        font-size: 0.85rem;
    }

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

    .stat-value {
        font-size: 2rem;
    }

    .modal-body h2 {
        font-size: 1.4rem;
    }

    .book-cover-large {
        font-size: 3rem;
    }
}
