/* ========================================================
   BIBLIOTECA VIRTUAL UNIVERSAL - ESTILOS PRINCIPALES
   ======================================================== */

:root {
    --gold: #b8975a;
    --gold-light: #dfc085;
    --gold-dark: #8a6c27;
    --gold-bg: rgba(184, 151, 90, 0.12);
    --gold-border: rgba(184, 151, 90, 0.3);
    --card-bg: rgba(22, 20, 18, 0.7);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-hover-border: rgba(184, 151, 90, 0.45);
    --font-heading: 'Outfit', 'Inter', sans-serif;
    --font-serif: 'Playfair Display', Georgia, serif;
}

/* Abstract Subtle Glows */
.bg-glow-platform {
    position: fixed;
    top: 10%;
    left: 45%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(184, 151, 90, 0.07) 0%, rgba(0, 0, 0, 0) 70%);
    z-index: 0;
    pointer-events: none;
}

/* Nav Bar Search Box */
.nav-search-wrapper {
    flex: 1;
    max-width: 420px;
    margin: 0 1rem;
    position: relative;
}

.nav-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50px;
    padding: 0.5rem 1rem 0.5rem 2.4rem;
    color: #fff;
    font-size: 0.88rem;
    font-family: inherit;
    outline: none;
    transition: all 0.25s ease;
}

.nav-search-input:focus {
    background: rgba(0, 0, 0, 0.8);
    border-color: var(--gold);
    box-shadow: 0 0 15px rgba(184, 151, 90, 0.25);
}

.nav-search-icon {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gold);
    width: 16px;
    height: 16px;
    pointer-events: none;
}

/* Sidebar Styles */
.sidebar-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.9rem;
    margin-bottom: 0.25rem;
    color: var(--muted, #aaa);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.88rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.sidebar-link:hover {
    background: rgba(184, 151, 90, 0.1);
    color: #fff;
    transform: translateX(3px);
}

.sidebar-link.active {
    background: linear-gradient(90deg, rgba(184, 151, 90, 0.25), rgba(184, 151, 90, 0.05));
    border-left: 3px solid var(--gold);
    color: #fff;
    font-weight: 600;
}

.sidebar-link i {
    width: 16px;
    height: 16px;
    margin-right: 0.6rem;
    color: var(--gold);
    flex-shrink: 0;
}

.cat-nav-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cat-nav-badge {
    font-size: 0.72rem;
    background: rgba(255, 255, 255, 0.08);
    color: var(--muted, #888);
    padding: 0.15rem 0.45rem;
    border-radius: 12px;
    font-weight: 500;
    margin-left: 0.5rem;
}

.sidebar-link.active .cat-nav-badge {
    background: var(--gold);
    color: #000;
    font-weight: 700;
}

/* Catálogo Header Banner */
.catalogo-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 1.2rem;
    margin-bottom: 2rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid var(--card-border);
}

.catalogo-header-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    color: var(--ink, #fff);
    margin: 0;
    line-height: 1.2;
}

.catalogo-header-count {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--gold);
    background: var(--gold-bg);
    border: 1px solid var(--gold-border);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    margin-top: 0.4rem;
    font-weight: 600;
}

.catalogo-filters-bar {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.custom-select-catalog {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--card-border);
    color: #fff;
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.2s;
}

.custom-select-catalog:focus {
    border-color: var(--gold);
}

/* Grilla de Tarjetas de Libros */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.book-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.book-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: 16px 0 0 16px;
    background: transparent;
    transition: background 0.3s ease;
}

.book-card:hover {
    transform: translateY(-5px);
    border-color: var(--card-hover-border);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(184, 151, 90, 0.12);
}

.book-card:hover::before {
    background: var(--gold);
}

.book-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.book-cat-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--gold);
    background: var(--gold-bg);
    border: 1px solid var(--gold-border);
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    max-width: 80%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-fav-btn {
    background: transparent;
    border: none;
    color: var(--muted, #666);
    cursor: pointer;
    padding: 0.2rem;
    transition: transform 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-fav-btn:hover {
    transform: scale(1.25);
    color: #f59e0b;
}

.book-fav-btn.active {
    color: #f59e0b;
}

.book-card-body {
    cursor: pointer;
    flex: 1;
    margin-bottom: 1.2rem;
}

.book-card-title {
    font-family: var(--font-serif);
    font-size: 1.18rem;
    font-weight: 600;
    color: var(--ink, #fff);
    line-height: 1.35;
    margin-bottom: 0.45rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-card-author {
    font-size: 0.85rem;
    color: var(--muted, #999);
    font-weight: 500;
}

.book-card-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: auto;
}

.btn-read-book {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #000;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 0.55rem 0.8rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-read-book:hover {
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(184, 151, 90, 0.35);
}

.btn-open-pdf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--ink, #fff);
    font-size: 0.82rem;
    padding: 0.55rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-open-pdf:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(184, 151, 90, 0.1);
}

/* Paginación */
.pagination-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.btn-page, .btn-page-num {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--ink, #fff);
    font-size: 0.85rem;
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-page:hover:not(:disabled), .btn-page-num:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(184, 151, 90, 0.1);
}

.btn-page-num.active {
    background: var(--gold);
    border-color: var(--gold);
    color: #000;
    font-weight: 700;
}

.btn-page:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-dots {
    color: var(--muted, #666);
    padding: 0 0.4rem;
}

/* Empty State */
.empty-state-catalogo {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 1rem;
    background: var(--card-bg);
    border: 1px dashed var(--card-border);
    border-radius: 16px;
    color: var(--muted, #aaa);
}

.empty-state-catalogo h3 {
    color: #fff;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

/* ========================================================
   VISTA LECTOR INTERACTIVO DE LIBRO
   ======================================================== */
.lector-container {
    display: none;
}

.lector-container.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.lector-top-header {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem 1.8rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    backdrop-filter: blur(12px);
}

.lector-btn-volver {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--gold);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.lector-btn-volver:hover {
    background: var(--gold-bg);
    border-color: var(--gold);
    transform: translateX(-2px);
}

.lector-book-info {
    flex: 1;
    min-width: 250px;
}

.lector-book-info h1 {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--ink, #fff);
    margin: 0.3rem 0;
    line-height: 1.25;
}

.lector-book-info p {
    color: var(--gold);
    font-size: 0.95rem;
    margin: 0;
}

.lector-pdf-frame-wrapper {
    background: #000;
    border: 1px solid var(--card-border);
    border-radius: 16px;
    overflow: hidden;
    height: 780px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    margin-bottom: 2rem;
}

.lector-pdf-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #1e1e1e;
}

/* Panel de Notas / Tu Espejo */
.lector-companion-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.lector-companion-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.6rem;
    backdrop-filter: blur(12px);
}

.lector-companion-card h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lector-companion-card p.desc {
    font-size: 0.85rem;
    color: var(--muted, #888);
    margin-bottom: 1rem;
}

.lector-textarea-notas {
    width: 100%;
    min-height: 160px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 1rem;
    color: #fff;
    font-family: var(--font-serif);
    font-size: 1rem;
    line-height: 1.6;
    outline: none;
    resize: vertical;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.lector-textarea-notas:focus {
    border-color: var(--gold);
}

.ai-prompt-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(184, 151, 90, 0.08);
    border: 1px solid var(--gold-border);
    color: #e5d8c3;
    padding: 0.45rem 0.8rem;
    border-radius: 20px;
    font-size: 0.82rem;
    cursor: pointer;
    margin: 0.3rem 0.3rem 0.3rem 0;
    transition: all 0.2s;
}

.ai-prompt-chip:hover {
    background: var(--gold);
    color: #000;
    font-weight: 600;
}

@media (max-width: 900px) {
    .lector-companion-grid {
        grid-template-columns: 1fr;
    }
    .lector-pdf-frame-wrapper {
        height: 520px;
    }
    .catalogo-header-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    .nav-search-wrapper {
        display: none;
    }
}

/* Nuevos Estilos Profesionales para Tarjeta de Libro */
.book-card-year {
    font-size: 0.7rem;
    color: var(--gold);
    margin-bottom: 0.4rem;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    opacity: 0.8;
}

.book-card-author-wrapper {
    margin-top: 0.8rem;
    padding-top: 0.6rem;
    border-top: 1px dashed rgba(255,255,255,0.1);
}

.author-label {
    display: block;
    font-size: 0.65rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.2rem;
}

.book-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.2rem;
}
