/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

body {
    background: #f9f9f9;
    color: #222;
    line-height: 1.6;
    font-size: 16px;
}

/* === HEADER === */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #004080;
    color: #fff;
    padding: 15px 30px;
}

header .logo {
    display: flex;
    align-items: center;
}

header .logo img {
    width: 50px;
    margin-right: 10px;
}

header h1 {
    font-size: 1.25rem;
}

/* === NAVBAR === */
nav {
    display: flex;
    gap: 25px;
}

nav li {
    list-style: none;
}

nav a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: color 0.3s;
}

nav a:hover {
    color: #ffcc00;
}

/* === BOT�0�7N DARK MODE === */
#toggle-dark {
    background: #222;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    color: #fff;
    transition: background-color 0.3s, color 0.3s;
}

#toggle-dark:hover {
    background: #ffcc00;
    color: #000;
}

/* === HERO SECTION === */
.hero {
    text-align: center;
    padding: 60px 20px;
    color: rgb(39, 4, 121);
}

.hero h2 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.hero p {
    font-size: 1.125rem;
    margin-bottom: 20px;
}

.hero .btn {
    background: #ffcc00;
    color: #222;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s;
    cursor: pointer;
}

.hero .btn:hover {
    background: #ffaa00;
}

/* === NOTICIAS === */
.noticias {
    padding: 40px 20px;
    background: #f0f0f0;
}

.noticias h2 {
    margin-bottom: 20px;
    color: #004080;
}

.noticias article {
    margin-bottom: 15px;
    padding: 10px;
    border-left: 4px solid #004080;
    background: white;
}

/* === GALER�0�1A === */
.galeria {
    padding: 40px 20px;
    text-align: center;
}

.galeria h2 {
    margin-bottom: 20px;
    color: #004080;
}

.galeria .imagenes {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.galeria img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s;
    cursor: pointer;
}

.galeria img:hover {
    transform: scale(1.1);
}

/* === FOOTER === */
footer {
    background: #2975c1;
    color: white;
    text-align: center;
    padding: 15px;
    margin-top: 20px;
}

/* === CONTENIDO PRINCIPAL === */
main {
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
}

main h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #004080;
}

.titulo-principal {
    text-align: center;
    margin-bottom: 10px;
}


/* ===========================
   �9�3 BUSCADOR DE LIBROS
=========================== */
  /* Formulario de filtros */
  form {
    background: white;
    max-width: 1000px;
    margin: 20px auto;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0px 2px 6px rgba(0,0,0,0.1);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
  }
  
  form input, 
  form select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    flex: 1;
    min-width: 180px;
  }
  
  form button,
  form a {
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    background: #1a73e8;
    color: white;
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
  }
  
  form a {
    background: #666;
  }
  
  form button:hover {
    background: #0c55b8;
  }
  
  form a:hover {
    background: #444;
  }

/* ===========================
   �9�0 RESULTADOS DE LIBROS
=========================== */
.material {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    margin: 15px auto;
    max-width: 800px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.material h3 {
    color: #004080;
    margin-bottom: 8px;
}

.material p {
    margin: 4px 0;
}

.material .acciones {
    margin-top: 10px;
}

.material .acciones a,
.material .acciones button {
    display: inline-block;
    padding: 8px 12px;
    margin-right: 8px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s;
    cursor: pointer;
    border: none;
}

.material .acciones .btn-ver {
    background: #ffcc00;
    color: #222;
}

.material .acciones .btn-ver:hover {
    background: #e6b800;
}

.material .acciones .btn-solicitar {
    background: #004080;
    color: #fff;
}

.material .acciones .btn-solicitar:hover {
    background: #0059b3;
}

/* ===========================
   �9�5 SUGERENCIAS
=========================== */
.sugerencias {
    max-width: 800px;
    margin: 50px auto;
    padding: 10px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.sugerencias h3 {
    color: #004080;
    margin-bottom: 12px;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sugerencias textarea {
    width: 100%;
    height: 100px;
    padding: 12px;
    font-size: 1rem;
    border: 2px solid #ccc;
    border-radius: 8px;
    resize: vertical;
    transition: border-color 0.3s, background-color 0.3s, color 0.3s;
}

.sugerencias textarea:focus {
    border-color: #004080;
    outline: none;
}

/*boton de enviar la sugerencia */
#btnSugerir {
    margin-top: 15px;
    background: #ff9800;
    color: #fff;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

#btnSugerir:hover {
    background: #e68a00;
}


/* Lista de sugerencias */
#listaSugerencias .sugerencia {
    background: #f0f0f0;
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
    color: #333;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* ===========================
   �9�3 DARK MODE
=========================== */
body.dark-mode {
    background: #1e1e1e;
    color: #f0f0f0;
}

body.dark-mode header,
body.dark-mode footer {
    background: #111;
}

body.dark-mode nav a {
    color: #ffcc00;
}

body.dark-mode nav a:hover {
    color: #fff;
}

body.dark-mode .hero {
    color: #fff;
}

body.dark-mode .noticias {
    background: #333;
}

body.dark-mode .noticias article {
    background: #444;
    border-left-color: #ffcc00;
}

body.dark-mode .material {
    background: #333;
    color: #eee;
}

body.dark-mode .material h3 {
    color: #ffcc00;
}

body.dark-mode #sugerencias {
    background: #2a2a2a;
}

body.dark-mode #sugerencias textarea {
    background: #444;
    color: #eee;
    border-color: #666;
}

body.dark-mode #sugerencias li {
    background: #444;
    color: #fff;
}

body.dark-mode .top-section {
    background: #2a2a2a;
}

body.dark-mode .top-section input,
body.dark-mode .top-section select {
    background: #444;
    color: #fff;
    border-color: #666;
}

body.dark-mode .top-section input:focus,
body.dark-mode .top-section select:focus {
    border-color: #ffaa00;
    outline: none;
}

body.dark-mode .top-section .btn-buscar {
    background: #ffaa00;
    color: #000;
}

body.dark-mode .top-section a {
    color: #ffcc00;
}


/* �9�3 Dark mode para sugerencias */
body.dark-mode .sugerencias {
    background: #2a2a2a;
    color: #f1f1f1;
    box-shadow: 0 2px 6px rgba(255, 255, 255, 0.1);
}

body.dark-mode .sugerencias h3 {
    color: #ffcc00;
}

body.dark-mode .sugerencias textarea {
    background: #444;
    color: #f1f1f1;
    border: 2px solid #666;
}

body.dark-mode .sugerencias textarea:focus {
    border-color: #ffcc00;
}

/* �9�3 Dark mode para el bot��n */
body.dark-mode #btnSugerir {
    background: #ffcc00;
    color: #000;
}

body.dark-mode #btnSugerir:hover {
    background: #e6b800;
}

/* �9�3 Dark mode para cada sugerencia agregada */
body.dark-mode #listaSugerencias .sugerencia {
    background: #444;
    color: #f1f1f1;
}
/* ===========================
   �9�2 LAYOUT LIBROS + SUGERENCIAS
=========================== */
.libros-sugerencias {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-top: 30px;
}

/* Columna de resultados de libros */
.libros-sugerencias .libros {
    flex: 2;  /* ocupa m��s espacio */
}

/* Columna de sugerencias */
.libros-sugerencias .sugerencias {
    flex: 1;  /* ocupa menos espacio */
    margin: 0; /* quitar m��rgenes extra */
}
  
.nivel-primaria {
    background-color: yellow;
    color: #000;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
  }
  
  .nivel-secundaria {
    background-color: green;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
  }
  
  
  .contador-libros {
    margin: 20px auto;
    text-align: center;
    background: #007BFF;
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    width: fit-content;
    font-size: 18px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  }
  .contenedor-principal {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin: 20px;
  }
  .col-libros { flex: 3; }
  .col-sugerencias {
    flex: 1;
    background: #f2f2f2;
    padding: 15px;
    border-radius: 8px;
  }
  .nivel-primaria {
    background-color: yellow; color: #000;
    padding: 2px 6px; border-radius: 4px; font-weight: bold;
  }
  .nivel-secundaria {
    background-color: green; color: #fff;
    padding: 2px 6px; border-radius: 4px; font-weight: bold;
  }
  .material {
    margin-bottom: 25px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
  }
  .libro-detalle {
    display: flex;
    gap: 15px;
    align-items: flex-start;
  }
  .libro-detalle .info { flex: 1; }
  .libro-detalle .visor { flex: 1; }
  .libro-detalle iframe {
    width: 100%; height: 250px;
    border: 1px solid #ccc; border-radius: 6px;
  }
  @media (max-width: 768px) {
    .libro-detalle { flex-direction: column; }
    .libro-detalle iframe { height: 200px; }
  }
  .paginacion {
    margin: 20px 0;
    text-align: center;
  }
  .paginacion a {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    background: #fff;
  }
  .paginacion a.activo {
    background: #007BFF;
    color: #fff;
    font-weight: bold;
  }
  .paginacion a:hover {
    background: #f0f0f0;
  }
  .paginacion a, .paginacion span {
padding: 6px 12px;
margin: 3px;
border-radius: 5px;
background: #f4f4f4;
text-decoration: none;
color: #004080;
transition: background 0.3s;
}

.paginacion a:hover {
background: #004080;
color: white;
}

.paginacion .activo {
background: #004080;
color: white;
font-weight: bold;
}