
/* VARIABLES PARA COLORES */
:root {
  --color-fondo: #f6f6f6;
  --color-texto: #222;
  --color-nav-fondo: #fff;
  --color-nav-texto: #000;
  --rojo: #ff6f3c;
  --rojo-hover: #e65c23;
  --color-banner-fondo: #fff4e5;
  --color-banner-texto: #663300;
  --color-banner-borde: #ffb84d;
  --badge-fondo: transparent;
  --badge-sombra: none;
  --color-libro-estado-bg: #ff6f3c;
}

/* --- NAV --- */
body {
    font-family: 'Montserrat', Arial, sans-serif;
    background: var(--color-fondo);
    margin: 0;
    color: var(--color-texto);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    background: var(--color-nav-fondo);
    height: 60px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.logo-img {
    height: 80px;
    width: auto;
}

nav .nav-links {
    display: flex;
    gap: 24px;
}

nav .nav-links a {
    color: var(--color-nav-texto);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: color 0.3s ease;
}

nav .nav-links a.activo {
  color: var(--rojo); /* mismo color del hover para coherencia */
  font-weight: 700;
  border-bottom: 2px solid var(--rojo);
  padding-bottom: 2px;
}

nav .nav-links a:hover {
    color: var(--rojo);
}

nav .search-bar {
    display: flex;
    align-items: center;
    background: var(--color-nav-fondo);
    border-radius: 24px;
    padding: 4px 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

nav .search-bar input {
    border: none;
    outline: none;
    padding: 8px;
    font-size: 1rem;
    border-radius: 24px;
    flex: 1;
    background: var(--color-fondo);
    color: var(--color-texto);
}

nav .search-bar button {
    background: var(--rojo);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 24px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s ease;
}

nav .search-bar button:hover {
    background: var(--rojo-hover);
}

/* Botón modo oscuro */
#toggle-dark-mode {
  background-color: #ff6f3c; /* color naranja que usas */
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 24px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
  box-shadow: 0 2px 6px rgba(255, 111, 60, 0.5);
  font-family: 'Montserrat', Arial, sans-serif;
}

#toggle-dark-mode:hover {
  background-color: #e65c23; /* naranja más oscuro en hover */
}

#toggle-dark-mode:focus {
  outline: 2px solid #ff6f3c;
  outline-offset: 2px;
}

/* --- CARRUSEL LIBROS --- */
.libros-carrusel {
    margin: 30px auto;
    max-width: 1200px;
    padding: 0 10px;
}

.libros-carrusel h3 {
    font-size: 1.4rem;
    color: var(--color-texto);
    margin-bottom: 15px;
}

.subtitulo-carrusel {
  font-size: 0.9rem;
  color: #555;
  margin-top: -10px;
  margin-bottom: 15px;
  font-style: italic;
}

/* Estado del libro completo o en progreso */
.estado-libro {
  position: absolute;
  top: 12px;
  right: 8px;
  background-color: var(--color-libro-estado-bg);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 12px;
  box-shadow: 0 0 5px rgba(0,0,0,0.3);
  user-select: none;
  pointer-events: none;
  white-space: nowrap;
  z-index: 10;
}

/* Logo patrocinador */
.badge-logo {
  position: absolute;
  top: 18px;
  left: 10px;
  background-color: transparent;  /* transparente, sin fondo */
  border-radius: 50%;              /* círculo */
  width: 32px;
  height: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: none;  /* sin sombra */
  z-index: 10;
}


.badge-logo img {
  width: 50px !important;
  height: 50px !important;
  object-fit: contain;
}

/* Contenedor principal del carrusel */
.contenedor-principal {
    display: flex;
    align-items: center;
    position: relative;
}

/* Flechas */
.flecha-izquierda,
.flecha-derecha {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: 2px solid var(--rojo);
    background-color: rgba(0, 0, 0, 0.3);
    font-size: 30px;
    width: 40px;
    height: 60px;
    color: #fff;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s ease;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.flecha-izquierda:hover,
.flecha-derecha:hover {
    background: rgba(0, 0, 0, 0.9);
    box-shadow: 0 0 10px var(--rojo);
}

.flecha-izquierda {
    left: 0;
}

.flecha-derecha {
    right: 0;
}

/* Contenedor scrollable */
.contenedor-carousel {
    width: 100%;
    padding: 20px 0;
    overflow-x: auto;
    scroll-behavior: smooth;
    background-color: rgba(255, 255, 255, 0.05);
    /* border: 3px solid var(--rojo); */
    /* box-shadow: 0 0 20px var(--rojo); */
    border-radius: 10px;
}


/* Flex horizontal */
.carousel {
    display: flex;
    flex-wrap: nowrap;
    gap: 0px;
}

/* Tarjeta libro */
.libro {
    min-width: 12%;
    max-width: 12%;
    height: 285px;
    background: transparent;
    border-radius: 1px;
    box-shadow: 3px 3px 8px rgba(255, 255, 255, 0.1);
    padding: 12px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.libro:hover {
    transform: scale(1.1);
    z-index: 5;
}

.libro img {
    width: 103%;
    height: 250px;
    object-fit: cover;
    margin-bottom: 10px;
    border-radius: 4px;
}

.libro h4 {
    font-size: 1rem;
    color: var(--color-texto);
    margin: 0 0 6px;
    font-weight: 700;
    text-decoration: none;
}

.libro p {
    font-size: 1rem;
    color: var(--rojo);
    margin: 0;
    text-decoration: none;
}

/* Indicadores puntos */
.indicadores {
    display: flex;
    justify-content: center;
    margin-top: 12px;
    gap: 8px;
}

.indicadores button {
    background: #ccc;
    height: 6px;
    width: 20px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.indicadores button:hover,
.indicadores button.activo {
    background: var(--rojo);
}

/* Responsividad */
@media (max-width: 992px) {
    .libro {
        min-width: 28%;
    }
}

@media (max-width: 600px) {
    .libro {
        min-width: 45%;
    }
    @media (max-width: 600px) {
  .flecha-izquierda,
  .flecha-derecha {
    display: none;
  }
}

}

/* NAV: ajustar elementos en pantallas pequeñas */
@media (max-width: 768px) {
    nav {
        flex-wrap: wrap;
        height: auto;
        padding: 10px;
        gap: 10px;
    }

    .logo-img {
        height: 60px;
        margin-bottom: 8px;
    }

    nav .nav-links {
        gap: 12px;
    }

    nav .nav-links a {
        font-size: 0.9rem;
    }

    nav .search-bar {
        width: 100%;
        max-width: none;
        padding: 6px 10px;
        box-sizing: border-box;
    }

    nav .search-bar input {
        font-size: 0.9rem;
        padding: 6px 8px;
    }

    nav .search-bar button {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
}

/* CARRUSEL: mejorar scroll y tamaño en pantallas pequeñas */
@media (max-width: 768px) {
    .libros-carrusel {
        padding: 0 5px;
    }

    .contenedor-carousel {
        border-width: 2px;
        border-radius: 8px;
        padding: 15px 0;
    }

    .carousel {
        gap: 16px;
    }

    .libro {
        min-width: 25%;
        max-width: 25%;
        height: auto;
    }

    .libro img {
        height: auto;
        max-height: 260px;
        width: 100%;
    }

    .libro h4 {
        font-size: 0.9rem;
    }

    .libro p {
        font-size: 0.9rem;
    }
}

/* En móviles muy pequeños */
@media (max-width: 480px) {
    nav {
        padding: 8px;
    }

    .logo-img {
        height: 60px;
        margin-bottom: 1px;
    }

    nav .nav-links {
        gap: 12px;
    }

    nav .nav-links a {
        font-size: 0.85rem;
    }

    nav .search-bar input {
        font-size: 0.85rem;
        padding: 5px 6px;
    }

    nav .search-bar button {
        padding: 5px 10px;
        font-size: 0.85rem;
    }

    .libro {
        min-width: 30%;
        max-width: 30%;
        height: auto;
    }

    .libro img {
        max-height: 200px;
    }

    .flecha-izquierda,
    .flecha-derecha {
    display: none;
  }
}

/* --- aviso temporal --- */
.beta-banner {
  background-color: var(--color-banner-fondo);
  color: var(--color-banner-texto);
  border: 1px solid var(--color-banner-borde);
  padding: 16px 20px;
  text-align: center;
  font-size: 1rem;
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  z-index: 1000;
  display: block; /* CAMBIO de flex a block */
  box-shadow: 0 2px 8px rgba(255, 180, 0, 0.3);
}

.beta-banner p {
  margin: 0 auto;
  line-height: 1.4;
  max-width: 800px;
  text-align: center;
}

.beta-banner a {
  color: var(--rojo);
  font-weight: 600;
  text-decoration: underline;
}

.beta-banner button {
  position: absolute;
  right: 20px;
  top: 16px;
  background: transparent;
  border: none;
  font-size: 1.8rem;
  color: var(--rojo);
  cursor: pointer;
}
/* --- modo oscuro --- */
body.dark-mode {
  --color-fondo: #121212;
  --color-texto: #ddd;
  --color-nav-fondo: #1c1c1c;
  --color-nav-texto: #ddd;
  --rojo: #ff4c1c;
  --rojo-hover: #e04315;
  --color-banner-fondo: #3a2e22;
  --color-banner-texto: #f2d6b3;
  --color-banner-borde: #ff4c1c;
  --badge-fondo: rgba(255, 76, 28, 0.1);
  --badge-sombra: 0 0 6px rgba(255, 76, 28, 0.8);
  --color-libro-estado-bg: #ff4c1c;
}

/* --- proximamente libros --- */
#carrusel-proximamente-container.hidden {
  display: none !important;
}

/* --- Inicio de Sesión --- */
nav #auth-container {
  position: absolute;
  right: 60px;
  top: 4.4%;
  transform: translateY(-50%);
  z-index: 1; /* Asegúrate de que no bloquee otros elementos */
}

/* Ajustes para pantallas pequeñas */
@media (max-width: 768px) {
  nav #auth-container {
    right: 60px; /* Reduce el espacio desde el borde derecho */
    top: 4%; /* Ajusta la posición vertical */
    transform: none; /* Elimina el centrado si no es necesario */
  }
}

/* Ajustes para pantallas muy pequeñas */
@media (max-width: 480px) {
  nav #auth-container {
    right: 50px; /* Reduce aún más el espacio desde el borde derecho */
    top: 2.5%; /* Ajusta la posición vertical */
    font-size: 14px; /* Opcional: ajusta el tamaño del texto o elementos */
  }
}

#login-btn {
  display: inline-block;
  padding: 10px 20px;
  background-color: #ff6f3c;
  color: white;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
  font-size: 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

#login-btn:hover {
  background-color: #0f5dd4;
  transform: translateY(-1px);
}

#login-btn:active {
  background-color: #0b49ab;
  transform: translateY(0);
}

#logout-btn {
  cursor: pointer;
  background-color: transparent;
  border: none;
  padding: 10px;
  font-size: 14px;
}

#logout-btn:hover {
  background-color: var(--rojo-hover);
  color: #fff;
  border-radius: 4px;
}

/* Imagen de usuario cuando ya está logueado */
#user-photo {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  cursor: pointer;
  border: 2px solid #ff6f3c;
  transition: transform 0.2s ease;
}

#user-photo:hover {
  transform: scale(1.05);
}

/* Dropdown estilos */
.dropdown {
  position: absolute;
  top: 50px;
  right: 0;
  background-color: #DDDDDD;
  border: 1px solid var(--color-nav-texto);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  padding: 10px;
  z-index: 1000;
}

/* Ajuste para modo oscuro */
body.dark-mode .dropdown {
  background-color: rgba(44, 44, 44, 0.9); /* Fondo oscuro con transparencia */
  border: 1px solid var(--color-nav-texto); /* Bordes adaptados al modo oscuro */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); /* Sombra más intensa */
}

.dropdown.hidden {
  display: none;
}

.dropdown a,
.dropdown button {
  display: flex;
  align-items: center;
  gap: 8px; /* Espacio entre ícono y texto */
  color: var(--color-nav-texto);
  text-decoration: none;
  padding: 8px 12px;
  font-size: 0.9rem;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
}

.dropdown a:hover,
.dropdown button:hover {
  background-color: var(--rojo-hover);
  color: #fff;
  border-radius: 4px;
}

.dropdown i {
  font-size: 1rem; /* Tamaño del ícono */
}


/* AVISO! */

#maintenance-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(6px);
  background-color: rgba(0, 0, 0, 0.4); /* fondo oscurecido */
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.maintenance-box {
  background-color: #fff;
  color: #222;
  padding: 40px;
  border-radius: 16px;
  text-align: center;
  max-width: 90%;
  box-shadow: 0 0 20px rgba(0,0,0,0.4);
  font-family: 'Montserrat', sans-serif;
}

.maintenance-box h1 {
  font-size: 2rem;
  margin-bottom: 16px;
  color: var(--rojo);
}

.maintenance-box p {
  font-size: 1.1rem;
  line-height: 1.5;
}

body.dark-mode #maintenance-overlay .maintenance-box {
  background-color: #1e1e1e;
  color: #eee;
  box-shadow: 0 0 20px rgba(255, 76, 28, 0.3);
}

