* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    color: #333;
    margin: 0;
    
    background-color: #e4f0fc; /* Fondo azul pastel suave */
}

/* Fondo con imagen */
.background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -2; /* siempre detrás */
}

.background img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(250px) brightness(1.5); /* blur intenso + oscurecer */
  transform: scale(1.1); /* para evitar bordes feos por el blur */
}

/* Contenido principal por encima */
main, footer {
  position: relative;
  z-index: 1;
  color: #fff; /* contraste sobre el fondo */
}


.container {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

h1 {
    font-size: 2.5em;
    font-family: "Rubik", sans-serif;
    background-color: #ffffff80;
    backdrop-filter: blur(2px);
    padding: 10px;
    border-radius: 15px;
    color: #2a5d84; /* Tono azul pastel más oscuro */
    max-width: 700px;
    margin: auto;
    margin-bottom: 29px;
    margin-top: 20px;
}

/* Ajuste para el contenedor principal */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    width: 100%;
    margin: auto;
    padding: 20px;
    justify-items: center;
}

/* Estilo para las categorías de cards */
.card-category {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    width: 100%;
}

/* Estilo para cada card */
.card {
    text-decoration: none;
    background-color: #ffffff80;
    backdrop-filter: blur(2px);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease;
    padding: 1rem;
    width: 100%;
    max-width: 300px;
}

/* Efecto hover para la card */
.card:hover {
    transform: translateY(-5px);
}

/* Estilo para la imagen dentro de la card */
.card img {
    width: 10rem;
    height: 220px;
    object-fit: cover;
    border-radius: 15px;
}

.card img:hover {
    cursor: pointer;
}

/* Estilo para el título dentro de la card */
.card-title {
    padding: 15px;
    font-size: 1.2em;
    color: #2a5d84;
    text-align: center;
    text-transform: uppercase;
}

/* Estilo para los botones dentro de la card */
.card-buttons a {
    background-color: #4a90e2; /* Azul pastel */
    color: white;
    padding: 8px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
    margin: 5px;
}

.card-buttons a:visited {
    color: white;
}

.card-buttons a:hover {
    background-color: #357abd; /* Azul pastel más oscuro */
}

footer {
  background: #e4f0fc; /* fondo oscuro semi-transparente */
  color: #2a5d84;
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 3rem;
  border-top: 2px solid rgba(255, 255, 255, 0.1);
}

footer .contactContainer {
  max-width: 900px;
  margin: 0 auto 1.5rem;
}

footer .socialMediaContainer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3rem; /* espacio entre columnas */
  flex-wrap: wrap;
}

footer .socialMedia {
  display: flex;
  gap: 1rem;
}

footer .socialMedia a {
  color: #2a5d84;
  font-size: 1.8rem;
  transition: all 0.3s ease;
}

footer .socialMedia a:hover {
  color: #1e90ff; /* color de acento al pasar el mouse */
  transform: scale(1.2);
}

footer .logo img {
  height: 80px;
  filter: drop-shadow(0 0 5px rgba(255,255,255,0.3));
  border-radius: 25px;
}

footer p {
  margin: 1rem 0;
  font-size: 0.9rem;
  opacity: 0.8;
}

footer .footer-credit a {
  color: #1e90ff;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

footer .footer-credit a:hover {
  color: #1e90ff;
}

@media (max-width: 600px) {
  footer .socialMediaContainer {
    flex-direction: column;
    gap: 1.5rem;
  }
}


#searchBar {
    width: 85%;
    padding: 10px;
    margin-bottom: 20px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    background-color: #ffffff80;
    border: solid 1px #39617f;
}

/* Animación de desvanecimiento */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Estilo para las tarjetas al aparecer */
.card {
    opacity: 0;
    animation: fadeIn 0.5s forwards;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Estilo para ocultar las tarjetas */
.card.hidden {
    display: none;
}

/* Estilos para el preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #e4f0fc;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.book {
    width: 100vw;
    height: 100vh;
    position: relative;
    transform-style: preserve-3d;
    transform-origin: left center;
    animation: openBook 3s forwards;
}

.book .cover,
.book .back {
    width: 100%;
    height: 100%;
    background: #4a90e2;
    position: absolute;
    left: 0;
    top: 0;
    transform-origin: left center;
}

.book .pages {
    width: calc(100% - 10px);
    height: calc(100% - 10px);
    background: #ffffff;
    position: absolute;
    left: 5px;
    top: 5px;
    transform-origin: left center;
}

/* Animación para abrir el libro */
@keyframes openBook {
    0% {
        transform: rotateY(0deg);
    }
    100% {
        transform: rotateY(-140deg);
    }
}

/* Ocultar preloader después de la carga */
.hidden {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#about {
    background-color: #ffffff70;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin: 40px auto;
    max-width: 800px;
    text-align: center;
}

#about h2 {
    font-size: 2em;
    font-family: "Rubik", sans-serif;
    color: #2a5d84;
    margin-bottom: 20px;
}

#about p {
    font-size: 1em;
    color: #333;
    line-height: 1.6;
    margin-bottom: 20px;
}

#about a {
    color: #4a90e2;
    text-decoration: none;
    font-weight: bold;
}

#about a:hover {
    text-decoration: underline;
}

/* Estilos para los botones de categoría */
#category-buttons {
    text-align: center;
    margin-bottom: 20px;
}

.category-button {
    background-color: #4a90e2;
    border: none;
    color: white;
    padding: 10px 20px;
    margin: 5px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.category-button:hover {
    background-color: #357abd;
}

.category-button.active {
    background-color: #357a38;
    font-weight: bold;
}

.no-results {
    text-align: center;
    color: #ff0000;
    font-weight: bold;
    margin-top: 20px;
}

/* Ajuste responsivo para dispositivos móviles */
@media (max-width: 768px) {
    .category-button {
        padding: 8px 16px;
        font-size: 14px;
    }
}
