/* CSS para la página Biblioteca */

/* Layout Principal */
.biblioteca-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    padding: 40px 20px;
    max-width: 1300px;
    margin: 0 auto;
    background-color: #f9f9f9;
}

/* Sidebar de Filtros */
.biblio-sidebar {
    flex: 1;
    min-width: 250px;
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    height: fit-content;
}

.biblio-sidebar h3 {
    margin-top: 0;
    color: #1b386c;
    font-size: 1.4rem;
    margin-bottom: 20px;
    border-bottom: 2px solid #8bc03f;
    padding-bottom: 10px;
    display: inline-block;
}

.filter-group {
    margin-bottom: 25px;
}

.filter-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #333;
}

/* Buscador */
.biblio-search-form {
    display: flex;
    gap: 5px;
}

.biblio-search-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.biblio-search-btn {
    background: #1b386c;
    color: #fff;
    border: none;
    padding: 0 15px;
    border-radius: 6px;
    cursor: pointer;
}

.biblio-search-btn:hover {
    background: #0b5ed7;
}

/* Lista de Categorías (Filtros) */
.cat-filters-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cat-filters-list li {
    margin-bottom: 8px;
}

.cat-filters-list a {
    text-decoration: none;
    color: #555;
    font-size: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-radius: 6px;
    transition: all 0.2s;
}

.cat-filters-list a:hover,
.cat-filters-list a.active {
    background: #eff6ff;
    color: #1b386c;
    font-weight: bold;
}

.count {
    background: #e0e0e0;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    color: #333;
}

/* Grid de Resultados */
.biblio-grid {
    flex: 3;
    min-width: 300px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

/* Cards */
.biblio-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #eee;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.biblio-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.12);
}

.biblio-thumb {
    height: 180px;
    overflow: hidden;
    position: relative;
    background-color: #eaeaea;
    /* Placeholder color */
}

.biblio-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.biblio-card:hover .biblio-thumb img {
    transform: scale(1.05);
}

/* Icono tipo de archivo superpuesto */
.file-type-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-size: 18px;
    color: #d55136;
}

.biblio-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.biblio-cat-badge {
    font-size: 11px;
    text-transform: uppercase;
    color: #8bc03f;
    font-weight: bold;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.biblio-title {
    font-size: 18px;
    margin: 0 0 10px;
    color: #1b386c;
    line-height: 1.3;
    font-weight: 700;
}

.biblio-excerpt {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
    flex-grow: 1;
}

.biblio-read-more {
    font-size: 14px;
    color: #3872b5;
    font-weight: bold;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.biblio-read-more:hover {
    text-decoration: underline;
}

/* Modal Biblioteca (Reusando estilo similar pero específico) */
.library-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.library-modal.active {
    display: flex;
}

.lib-modal-content {
    background-color: #fefefe;
    border-radius: 12px;
    width: 100%;
    max-width: 900px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s;
}

@media(min-width: 768px) {
    .lib-modal-content {
        flex-direction: row;
    }

    .lib-modal-img {
        width: 40%;
        height: auto;
    }

    .lib-modal-body {
        width: 60%;
        overflow-y: auto;
    }
}

.lib-modal-img {
    height: 250px;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lib-modal-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lib-modal-body {
    padding: 30px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.lib-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #aaa;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    z-index: 10;
}

.lib-close-btn:hover {
    color: #000;
}

.lib-modal-title {
    color: #1b386c;
    margin-top: 0;
    font-size: 28px;
    margin-bottom: 20px;
}

.lib-modal-desc {
    font-size: 16px;
    line-height: 1.6;
    color: #444;
    margin-bottom: 30px;
}

.lib-download-btn {
    display: inline-block;
    background: #8bc03f;
    color: #fff;
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 30px;
    font-weight: bold;
    font-size: 16px;
    text-align: center;
    align-self: flex-start;
    transition: background 0.3s;
    border: none;
    cursor: pointer;
}

.lib-download-btn:hover {
    background: #7ab32f;
}

.lib-download-btn i {
    margin-right: 8px;
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
    }

    to {
        transform: translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .biblioteca-container {
        flex-direction: column;
    }

    .biblio-sidebar {
        width: 100%;
    }
    
    .biblio-grid {
        grid-template-columns: 1fr;
    }

    .lib-modal-img {
        width: 100%;
        height: 200px;
    }

    .lib-modal-body {
        width: 100%;
        height: auto;
    }
}