/* CSS REUTILIZABLE Y ORGANIZADO */
:root {
    --primary-blue: #003366;
    --secondary-gray: #f4f4f4;
    --text-dark: #333;
    --border-color: #ddd;
    --white: #ffffff;
    --accent-blue: #0056b3;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #e9ecef;
    color: var(--text-dark);
}

/* HEADER & BANNER */
header {
    background-color: var(--white);
    border-bottom: 2px solid var(--primary-blue);
    display: grid;
    grid-template-areas: "banner logo" "title logo";
    grid-template-columns: 1fr auto;
}

.banner-container {
    width: 100%;
    /* padding: 10px 5%; */
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    grid-area: banner;
}

.banner-logos {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-placeholder {
    height: 60px;
    object-fit: contain;
}

.logo{
    grid-area: logo;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 160px;
}

.logo img{
    scale: 2.5;
}

.title-section {
    background-color: var(--white);
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    /* box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); */
}

.icon-box {
    background-color: var(--primary-blue);
    color: white;
    padding: 4px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-box i{
    width: 200px;
    height: ;
}

.title-section h1 {
    font-size: 1.5rem;
    color: var(--primary-blue);
    text-transform: uppercase;
    font-weight: bold;
}

.title-section p {
    font-size: 0.9rem;
    color: #666;
}

/* NAVIGATION MENU (NAV) */
nav {
    background-color: var(--primary-blue);
    color: white;
    padding: 0 5%;
}

.nav-list {
    list-style: none;
    display: flex;
}

.nav-list li a {
    color: white;
    text-decoration: none;
    padding: 15px 20px;
    display: block;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.nav-list li a:hover {
    background-color: var(--accent-blue);
}

/* MAIN LAYOUT */
.container {
    display: flex;
    padding: 30px 5%;
    gap: 30px;
    min-height: 80vh;
}

/* SIDEBAR (Categorías) */
aside {
    flex: 0 0 250px;
    background: var(--white);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    height: fit-content;
}

.sidebar-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    color: var(--primary-blue);
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 5px;
    color: #555;
    text-decoration: none;
    border-bottom: 1px solid #eee;
    transition: color 0.2s;
}

.category-item:hover {
    color: var(--accent-blue);
    background-color: #f8f9fa;
}

/* MAIN CONTENT AREA */
main {
    flex: 1;
}

/* SEARCH FILTERS BLOCK */
.search-filters {
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.search-bar-container {
    position: relative;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
}

.search-input-wrapper i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.main-search {
    width: 100%;
    padding: 12px 12px 12px 45px;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.main-search:focus {
    border-color: var(--accent-blue);
}

.clear-filters {
    color: var(--accent-blue);
    text-decoration: none;
    font-size: 0.85rem;
    margin-left: 20px;
    font-weight: 500;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.select-wrapper select {
    width: 100%;
    padding: 10px 10px 10px 35px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: #fdfdfd;
    appearance: none;
    cursor: pointer;
    font-size: 0.85rem;
}

.select-wrapper i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    pointer-events: none;
}

/* RESULTS AREA (Placeholder) */
.results-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    aside {
        flex: none;
        width: 100%;
    }

    .nav-list {
        flex-wrap: wrap;
    }
}

/* container */
.results-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.book-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    overflow: hidden;
    transition: transform 0.2s;
}

.book-card:hover {
    transform: translateY(-5px);
}

.book-cover {
    width: 120px;
    background: #f0f0f0;
}

.book-cover img {
    width: 100%;
    height: 100%;
    /* object-fit: cover; */
}

.book-info {
    padding: 15px;
    flex: 1;
}

.book-info h3 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: #2c3e50;
}

.book-author, .book-meta {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 4px;
}

.book-desc {
    font-size: 0.8rem;
    color: #888;
    margin: 10px 0;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #004a99;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
}


/* --- ESTILOS PARA EL MODAL DE REGISTRO --- */

/* Fondo del modal */
.modal {
    display: none; 
    position: fixed; 
    z-index: 2000; 
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    background-color: rgba(0, 51, 102, 0.7); /* Azul primario con transparencia */
    backdrop-filter: blur(4px); /* Efecto de desenfoque al fondo */
    justify-content: center; 
    align-items: center;
    padding: 15px;
}

/* Caja de contenido del modal */
.modal-content {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: modalAppear 0.3s ease-out;
}

@keyframes modalAppear {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-content h3 {
    color: var(--primary-blue);
    margin-bottom: 10px;
    font-size: 1.4rem;
    border-bottom: 2px solid var(--primary-blue);
    padding-bottom: 8px;
}

.modal-content p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 20px;
}

/* Estilos de los campos del formulario */
#download-form input, 
#download-form select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
    background-color: #fdfdfd;
    transition: border-color 0.3s;
}

#download-form input:focus, 
#download-form select:focus {
    border-color: var(--accent-blue);
    background-color: #fff;
}

/* Botones del modal */
.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.btn-submit {
    background-color: var(--primary-blue);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    flex: 2;
    transition: background 0.3s;
}

.btn-submit:hover {
    background-color: var(--accent-blue);
}

.btn-cancel {
    background-color: #e0e0e0;
    color: var(--text-dark);
    border: none;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    flex: 1;
    transition: background 0.2s;
}

.btn-cancel:hover {
    background-color: #d0d0d0;
}

/* Ajuste para que el botón de descarga en la card se vea como botón real */
.download-btn-trigger {
    cursor: pointer;
    border: none;
    font-family: inherit;
    width: 100%; /* Opcional: para que ocupe todo el ancho en la info */
    justify-content: center;
}