/* -------------------- RESET & BASE -------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Roboto', sans-serif;
    color: #f5ede4;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 20px;
    background: #1a1008;
}

/* -------------------- FULL-SCREEN LIBRARY BACKGROUND -------------------- */
.library-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: url('assets/library-background.jpg') no-repeat center center;
    background-size: cover;
    filter: brightness(0.7) saturate(0.8);
}

.library-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(20, 12, 6, 0.4);
    pointer-events: none;
}

/* -------------------- ARCHIVE CONTAINER -------------------- */
.archive-container {
    max-width: 1400px;
    width: 100%;
    background: rgba(20, 12, 6, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 32px;
    padding: 30px 40px 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 215, 175, 0.1);
    border: 1px solid rgba(180, 130, 70, 0.15);
    margin: 20px 0;
    position: relative;
    z-index: 1;
    max-height: 95vh;
    overflow-y: auto;
}

.archive-container::-webkit-scrollbar {
    width: 6px;
}
.archive-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}
.archive-container::-webkit-scrollbar-thumb {
    background: #d4a373;
    border-radius: 10px;
}

/* -------------------- HEADER -------------------- */
.archive-header {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(180, 130, 70, 0.3);
    margin-bottom: 30px;
}

.archive-header h1 {
    font-size: 3.2rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #f5ede4;
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.8);
}
.archive-header h1 .light {
    font-weight: 300;
    color: #d4b48c;
}

.subtitle {
    font-size: 1.1rem;
    color: #c4b09a;
    letter-spacing: 1px;
    margin-top: 4px;
    font-weight: 300;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.status-note {
    margin-top: 12px;
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.5);
    display: inline-block;
    padding: 6px 18px;
    border-radius: 30px;
    color: #e0cdb5;
    border: 1px solid rgba(200, 160, 100, 0.2);
    backdrop-filter: blur(4px);
}
.status-note i {
    margin-right: 8px;
    color: #d4a373;
}
/* -------------------- LIBRARY SECTIONS -------------------- */
.library-section {
    margin-bottom: 50px;
}

.library-section h2 {
    font-size: 1.8rem;
    font-weight: 400;
    color: #e8d7c2;
    margin-bottom: 20px;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid rgba(212, 163, 115, 0.6);
    padding-left: 16px;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.9);
    background: transparent;
    padding: 8px 16px 8px 20px;
    border-radius: 0 8px 8px 0;
}
.library-section h2 i {
    color: #d4a373;
    font-size: 1.6rem;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.9);
}

/* -------------------- BOOKSHELF (More Transparent) -------------------- */
.bookshelf {
    display: flex;
    flex-wrap: wrap;
    gap: 18px 12px;
    justify-content: flex-start;
    padding: 20px 10px 30px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    border: 1px solid rgba(180, 130, 70, 0.06);
    box-shadow: inset 0 4px 30px rgba(0, 0, 0, 0.15);
    min-height: 200px;
    position: relative;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.podcasts-section .bookshelf {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(180, 130, 70, 0.04);
}

.bookshelf::before {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 5%;
    width: 90%;
    height: 3px;
    background: linear-gradient(to right, transparent, rgba(138, 122, 106, 0.3), rgba(212, 163, 115, 0.4), rgba(138, 122, 106, 0.3), transparent);
    border-radius: 4px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
}

.bookshelf::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 30%;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.03) 0%,
        transparent 100%
    );
    border-radius: 16px 16px 0 0;
    pointer-events: none;
}

/* -------------------- BOOK SPINE (Base) -------------------- */
.book {
    width: 64px;
    cursor: pointer;
    transition: transform 0.25s ease, filter 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    perspective: 800px;
}

.book:hover {
    transform: translateY(-12px) scale(1.06);
    filter: brightness(1.15);
    z-index: 10;
}

/* -------------------- DOCUMENT SPINE (Using Custom Image) -------------------- */
.document-spine {
    width: 100%;
    height: 210px;
    border-radius: 4px 12px 12px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 18px 10px 14px;
    position: relative;
    transition: all 0.25s;
    box-shadow: 
        6px 6px 25px rgba(0, 0, 0, 0.7),
        -2px 0 10px rgba(0, 0, 0, 0.3),
        inset -3px 0 8px rgba(255, 255, 255, 0.08),
        inset 2px 0 8px rgba(0, 0, 0, 0.3);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    border-left: 2px solid rgba(255, 215, 175, 0.15);
    background-size: cover !important;
    background-position: center !important;
}

.book:hover .document-spine {
    box-shadow: 
        8px 8px 35px rgba(0, 0, 0, 0.9),
        0 0 25px rgba(0, 158, 219, 0.15),
        inset -2px 0 12px rgba(255, 255, 255, 0.12),
        inset 2px 0 12px rgba(0, 0, 0, 0.2);
    transform: scale(1.02);
}

.document-spine::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 4px 12px 12px 4px;
    background: rgba(0, 0, 0, 0.25);
    pointer-events: none;
    z-index: 1;
}

.document-spine .spine-highlight {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 4px 12px 12px 4px;
    pointer-events: none;
    z-index: 2;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.02) 15%,
        transparent 40%,
        rgba(0, 0, 0, 0.05) 70%,
        rgba(0, 0, 0, 0.15) 90%,
        rgba(0, 0, 0, 0.25) 100%
    );
    border-radius: 4px 12px 12px 4px;
}

.document-spine .spine-edge {
    position: absolute;
    top: 2px;
    left: -2px;
    width: 6px;
    height: calc(100% - 4px);
    border-radius: 2px 0 0 2px;
    pointer-events: none;
    z-index: 3;
    background: linear-gradient(
        to right,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(255, 255, 255, 0.05) 40%,
        transparent 100%
    );
}

.document-spine .book-title {
    position: relative;
    z-index: 5;
    font-size: 0.85rem;
    font-weight: 700;
    writing-mode: vertical-rl;
    letter-spacing: 3px;
    text-align: center;
    line-height: 1.2;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: break-word;
    text-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(0, 0, 0, 0.5);
    color: white;
}

.document-spine .book-icon {
    position: relative;
    z-index: 5;
    font-size: 1.4rem;
    opacity: 0.9;
    margin-top: 8px;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6));
    color: white;
}

/* -------------------- PODCAST SPINE (CSS Styled) -------------------- */
.podcast-spine {
    width: 100%;
    height: 210px;
    border-radius: 4px 12px 12px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 18px 10px 14px;
    position: relative;
    transition: all 0.25s;
    box-shadow: 
        6px 6px 25px rgba(0, 0, 0, 0.7),
        -2px 0 10px rgba(0, 0, 0, 0.3),
        inset -3px 0 8px rgba(255, 255, 255, 0.08),
        inset 2px 0 8px rgba(0, 0, 0, 0.3);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    border-left: 2px solid rgba(255, 215, 175, 0.15);
    background: 
        repeating-linear-gradient(
            90deg,
            rgba(0, 0, 0, 0.06) 0px,
            rgba(0, 0, 0, 0.02) 2px,
            rgba(255, 255, 255, 0.04) 4px,
            rgba(0, 0, 0, 0.05) 6px,
            rgba(0, 0, 0, 0.01) 8px
        ),
        repeating-linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.07) 0px,
            rgba(255, 255, 255, 0.02) 3px,
            rgba(0, 0, 0, 0.05) 6px,
            rgba(255, 255, 255, 0.01) 9px
        ),
        linear-gradient(145deg, #a67c52, #7a5a3a);
    color: #f5ede4;
    border-left-color: #d4a373;
}

.book:hover .podcast-spine {
    box-shadow: 
        8px 8px 35px rgba(0, 0, 0, 0.9),
        0 0 25px rgba(166, 124, 82, 0.2),
        inset -2px 0 12px rgba(255, 255, 255, 0.12),
        inset 2px 0 12px rgba(0, 0, 0, 0.2);
}

.podcast-spine::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 4px 12px 12px 4px;
    background: 
        radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 40%, rgba(0, 0, 0, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 40% 70%, rgba(255, 255, 255, 0.04) 0%, transparent 40%),
        radial-gradient(ellipse at 80% 85%, rgba(0, 0, 0, 0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

.podcast-spine::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 4px 12px 12px 4px;
    background: 
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 25px,
            rgba(0, 0, 0, 0.03) 25px,
            rgba(255, 255, 255, 0.02) 26px,
            transparent 26px,
            transparent 50px
        ),
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 60px,
            rgba(0, 0, 0, 0.04) 60px,
            rgba(255, 255, 255, 0.02) 61px,
            transparent 61px,
            transparent 80px
        );
    pointer-events: none;
    z-index: 1;
}

.podcast-spine .spine-highlight {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 4px 12px 12px 4px;
    pointer-events: none;
    z-index: 2;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.02) 15%,
        transparent 40%,
        rgba(0, 0, 0, 0.05) 70%,
        rgba(0, 0, 0, 0.15) 90%,
        rgba(0, 0, 0, 0.25) 100%
    );
    border-radius: 4px 12px 12px 4px;
}

.podcast-spine .spine-edge {
    position: absolute;
    top: 2px;
    left: -2px;
    width: 6px;
    height: calc(100% - 4px);
    border-radius: 2px 0 0 2px;
    pointer-events: none;
    z-index: 3;
    background: linear-gradient(
        to right,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(255, 255, 255, 0.05) 40%,
        transparent 100%
    );
}

.podcast-spine .spine-embossing {
    position: absolute;
    top: 15%;
    left: 10%;
    right: 10%;
    height: 70%;
    border: 1px solid rgba(255, 215, 175, 0.08);
    border-radius: 2px;
    pointer-events: none;
    z-index: 2;
    box-shadow: inset 0 0 20px rgba(255, 215, 175, 0.03);
}

.podcast-spine .book-title {
    position: relative;
    z-index: 5;
    font-size: 0.85rem;
    font-weight: 700;
    writing-mode: vertical-rl;
    letter-spacing: 3px;
    text-align: center;
    line-height: 1.2;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: break-word;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.podcast-spine .book-icon {
    position: relative;
    z-index: 5;
    font-size: 1.4rem;
    opacity: 0.8;
    margin-top: 8px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* -------------------- TOOLTIP -------------------- */
.book-tooltip {
    display: none;
    position: absolute;
    bottom: 230px;
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    background: rgba(20, 12, 6, 0.95);
    backdrop-filter: blur(8px);
    padding: 18px 20px;
    border-radius: 14px;
    border: 1px solid rgba(180, 130, 70, 0.4);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
    color: #f0e3d4;
    font-size: 0.85rem;
    z-index: 20;
    text-align: left;
    pointer-events: auto;
}

.book-tooltip.visible {
    display: block;
    animation: fadeInUp 0.2s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.book-tooltip p {
    margin-bottom: 6px;
}
.book-tooltip p strong {
    color: #ffdbb5;
    font-size: 0.95rem;
}
.book-tooltip .audio-player {
    margin-top: 12px;
    width: 100%;
}
.book-tooltip .audio-player audio {
    width: 100%;
    border-radius: 8px;
    background: #1f140c;
}

.book-tooltip::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid rgba(20, 12, 6, 0.95);
}

/* -------------------- FOOTER -------------------- */
.archive-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(180, 130, 70, 0.2);
    text-align: center;
    font-size: 0.9rem;
    color: #b8a088;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.archive-footer i {
    color: #d4a373;
    margin-right: 6px;
}
.archive-footer .small {
    font-size: 0.75rem;
    color: #8a7a6a;
    margin-top: 4px;
}

/* -------------------- RESPONSIVE -------------------- */
@media (max-width: 768px) {
    .archive-container {
        padding: 16px;
        max-height: 98vh;
    }
    .archive-header h1 {
        font-size: 2.4rem;
    }
    .book {
        width: 52px;
    }
    .document-spine,
    .podcast-spine {
        height: 170px;
        padding: 14px 6px 12px;
    }
    .document-spine .book-title,
    .podcast-spine .book-title {
        font-size: 0.7rem;
        letter-spacing: 2px;
    }
    .document-spine .book-icon,
    .podcast-spine .book-icon {
        font-size: 1.2rem;
    }
    .book-tooltip {
        width: 220px;
        left: 0;
        transform: none;
        bottom: 190px;
    }
    .book-tooltip::after {
        left: 20%;
    }
    .bookshelf {
        gap: 12px 6px;
        padding: 10px 5px 20px;
    }
    .library-section h2 {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .book {
        width: 44px;
    }
    .document-spine,
    .podcast-spine {
        height: 140px;
        padding: 10px 4px 10px;
    }
    .document-spine .book-title,
    .podcast-spine .book-title {
        font-size: 0.6rem;
        letter-spacing: 1px;
    }
    .document-spine .book-icon,
    .podcast-spine .book-icon {
        font-size: 1rem;
    }
    .book-tooltip {
        width: 180px;
        font-size: 0.75rem;
        bottom: 160px;
        padding: 12px;
    }
    .archive-header h1 {
        font-size: 1.8rem;
    }
}