/* css/library.css - Gothic Library */

.library-body {
    background: linear-gradient(to right, #0f0f0f 0%, #1a1510 50%, #0f0f0f 100%);
    min-height: 100vh;
    background-image: 
        linear-gradient(rgba(0,0,0,0.8), rgba(0,0,0,0.8)),
        repeating-linear-gradient(90deg, transparent, transparent 50px, rgba(139, 69, 19, 0.03) 50px, rgba(139, 69, 19, 0.03) 51px);
}

.library-header {
    text-align: center;
    padding: 3rem;
    border-bottom: 2px solid var(--empire-gold);
    background: linear-gradient(to bottom, rgba(212, 175, 55, 0.1), transparent);
}

.library-header h1 {
    font-size: 3rem;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

.search-bar {
    max-width: 600px;
    margin: 2rem auto;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 1rem 1.5rem;
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--empire-gold);
    color: var(--empire-text);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    border-radius: 30px;
    outline: none;
}

.search-bar input:focus {
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

.bookshelf {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2rem;
    padding: 3rem;
    max-width: 1400px;
    margin: 0 auto;
    perspective: 1000px;
}

.book-spine {
    height: 280px;
    background: linear-gradient(90deg, #2a1810 0%, #3d2418 20%, #2a1810 50%, #1a0f0a 100%);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
    transform-style: preserve-3d;
    box-shadow: 
        -2px 0 5px rgba(0,0,0,0.5),
        inset 2px 0 10px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-align: center;
    border-left: 4px solid var(--empire-gold);
}

.book-spine:hover {
    transform: translateY(-10px) rotateY(-5deg);
    box-shadow: 
        -5px 5px 20px rgba(0,0,0,0.5),
        0 0 30px rgba(212, 175, 55, 0.2);
}

.book-title {
    font-family: 'Cinzel', serif;
    color: var(--empire-gold);
    font-size: 1rem;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    max-height: 200px;
    overflow: hidden;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.book-author {
    position: absolute;
    bottom: 20px;
    font-size: 0.7rem;
    color: var(--empire-text-muted);
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

.book-year {
    position: absolute;
    top: 20px;
    font-size: 0.7rem;
    color: var(--empire-text-muted);
}

/* Book Viewer Modal */
.book-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.book-modal.active {
    display: flex;
}

.book-viewer {
    width: 90%;
    max-width: 900px;
    height: 90vh;
    background: #1a1510;
    border: 2px solid var(--empire-gold);
    border-radius: 5px;
    display: flex;
    flex-direction: column;
}

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

.viewer-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    font-family: 'Georgia', serif;
    line-height: 1.8;
    font-size: 1.1rem;
}

.viewer-content h1, .viewer-content h2 {
    color: var(--empire-gold);
    font-family: 'Cinzel', serif;
}

.download-btn {
    display: inline-block;
    margin-top: 2rem;
    padding: 1rem 2rem;
    background: var(--empire-gold);
    color: var(--empire-dark);
    text-decoration: none;
    border-radius: 5px;
    font-family: 'Cinzel', serif;
}

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

.genre-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--empire-text-muted);
    font-size: 0.9rem;
}

.genre-btn:hover, .genre-btn.active {
    border-color: var(--empire-gold);
    color: var(--empire-gold);
}
