@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;600&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
:root {
  --color-fondo: #e3f2fd;
  --color-texto: #0d47a1;
  --color-acento: #ff5252;
  --color-boton: #2196f3;
  --color-boton-hover: #1976d2;
  --color-card: #ffffff;
  --color-sombra: rgba(0, 0, 0, 0.2);
}




body {
  font-family: var(--fuente-himnos, 'Quicksand'), sans-serif;
  font-size: var(--tamano-himnos, 18px);
  background-color: var(--color-fondo);
  color: var(--color-texto);
  padding: 1.5rem;
}


body.modo-oscuro {
  background-color: #0d0d0d !important;
  color: #e0e0e0;
}

/* Encabezado */
.encabezado {
  text-align: center;
  margin-bottom: 2rem;
}

.titulo-himnario {
  font-size: 2.4rem;
  font-weight: 600;
  color: #b39ddb;
  margin-bottom: 1rem;
  animation: fadeInTitle 1s ease-out forwards;
  opacity: 0;
  transform: translateY(-10px);
}

/* Buscador */
.search {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 2rem;
  text-align: center;
}

#searchInput {
  width: 90%;
  max-width: 500px;
  padding: 0.75rem;
  font-size: 1rem;
  border: 2px solid #ff6f61;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

body.modo-oscuro #searchInput {
  background-color: #1e1e1e;
  color: #f0f0f0;
  border-color: #ff7043;
}

/* Tarjetas */
.list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
#hymnList .hymn-card {
  font-size: var(--tamano-himnos, 18px);
  font-family: var(--fuente-himnos, 'Quicksand'), sans-serif;
  line-height: 1.6;
}


.hymn-card {
  background-color: var(--color-card);
  color: var(--color-texto);
  box-shadow: 0 6px 12px var(--color-sombra);
  padding: 1rem;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-left: 6px solid #ffd54f;
}

.hymn-card:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 16px rgba(0,0,0,0.15);
  border-left-color: #ff6f61;
}
.hymn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  padding: 1rem;
}


/* En pantallas pequeñas, 2 por fila */
@media (max-width: 480px) {
  .hymn-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}




body.modo-oscuro .hymn-card {
  background-color: #1e1e1e;
  color: #f0f0f0;
}

/* Título del himno */
#hymnTitle {
  font-weight: 600;
  color: #ff6f61;
  margin-bottom: 0rem;

}

body.modo-oscuro #hymnTitle {
  color: #ffd54f;
  margin-bottom: 12px;
}

.author {
  font-style: italic;
  font-size: 0.95rem;
  color: #666;
  margin-top: 0.5rem;
  text-align: center;
}
body.modo-oscuro .author {
  color: #ccc;
}

body.modo-oscuro .author {
  color: #ccc;
}

/* Estrofas y coros */
.estrofa, .coro {
  margin-bottom: 2rem;
  text-align: center;
  line-height: 1.6;
}

.estrofa h3 {
  color: #ff6f61;
  margin-bottom: 0.5rem;
}

.coro {
  font-style: italic;
  color: #0077cc;
}

.coro h3 {
  margin-bottom: 0.5rem;
}

body.modo-oscuro .estrofa {
  color: #e0e0e0;
}

body.modo-oscuro .estrofa h3 {
  color: #ff7043;
}

body.modo-oscuro .coro {
  color: #cfd8dc;
}

body.modo-oscuro .coro h3 {
  color: #80d8ff;
}

/* Contenido del himno */
#hymnContent {
  font-family: inherit;
  font-size: inherit;
  background-color: #ffffff;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 6px 12px rgba(0,0,0,0.08);
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  white-space: pre-wrap;
  line-height: 1.6;
  color: #444;
}

body.modo-oscuro #hymnContent {
  background-color: #1a1a1a;
  color: #f5f5f5;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.05);
  padding: 20px;
}

/* Reproductor */
#audioPlayer {
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 45px;
  padding: 8px;
  margin-top: 1rem;
}

body.modo-oscuro #audioPlayer {
  background-color: #2c2c2c;
  padding: 8px;
  margin-top: 16px;
}

/* Botones */
.nav-btn, .volver-btn, .btn-volver-esquina {
  background-color: var(--color-boton);
  color: white;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  border-radius: 8px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  transition: background-color 0.3s ease;
}

.nav-btn:hover,
.volver-btn:hover,
.btn-volver-esquina:hover {
  background-color: var(--color-boton-hover);
}

body.modo-oscuro .nav-btn,
body.modo-oscuro .volver-btn,
body.modo-oscuro .btn-volver-esquina {
  background-color: #333;
  color: #ffd54f;
}

body.modo-oscuro .nav-btn:hover,
body.modo-oscuro .volver-btn:hover,
body.modo-oscuro .btn-volver-esquina:hover {
  background-color: #444;
}

.btn-volver-esquina {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1000;
  font-family: inherit;
}

/* Botón de favoritos */
.fav-btn {
  float: right;
  background: none;
  border: none;
  font-size: 1.2em;
  cursor: pointer;
  color: #ff7043;
  transition: transform 0.2s ease;
}

.fav-btn:hover {
  transform: scale(1.2);
}

/* Menú hamburguesa moderno */
.menu-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  background-color: var(--color-boton);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  transition: background-color 0.3s ease;
}

.menu-toggle:hover {
  background-color: var(--color-boton-hover);
}

.line {
  width: 24px;
  height: 3px;
  background-color: white;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

body.modo-oscuro .menu-toggle {
  background-color: #333;
}

body.modo-oscuro .line {
  background-color: #ffd54f;
}

/* Menú desplegable */
.menu-opciones {
  position: fixed;
  top: 3.5rem;
  right: 1rem;
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
  padding: 1rem;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 999;
  width: 220px;
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  display: flex;
}

.menu-opciones.visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.menu-opciones button {
  background-color: var(--color-boton);
  color: white;
  font-family: inherit;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
}

.menu-opciones button:hover {
  background-color: var(--color-boton-hover);
}

/* Animaciones */
@keyframes fadeInTitle {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeInUp 1s ease-out forwards;
  opacity: 0;
  transform: translateY(20px);
}

.fade-transition {
  animation: fadeInUp 0.6s ease-out forwards;
}

/* Mensaje de "no se encontraron himnos" */
.no-results {
  text-align: center;
  font-style: italic;
  color: #999;
  margin-top: 2rem;
}

/* Créditos */
.creditos-footer {
  position: fixed;
  bottom: 10px;
  left: 10px;
  font-size: 0.9rem;
  color: #555;
  background-color: rgba(255, 255, 255, 0.8);
  padding: 6px 12px;
  border-radius: 6px;
  box-shadow: 0 0 5px rgba(0,0,0,0.1);
  z-index: 100;
}

/* Fondo animado */
#fondoAnimado {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}

/* Panel de configuración */
.panel-config {
  display: none;
  position: fixed;
  top: 80px;
  right: 20px;
  background-color: #ffffff;
  color: #000;
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 200;
  width: 250px;
}

.panel-config label {
  display: block;
  margin-top: 1rem;
  font-weight: bold;
}

.panel-config select {
  width: 100%;
  padding: 0.4rem;
  margin-top: 0.3rem;
  border-radius: 6px;
  font-size: 1rem;
}

.menu-opciones {
  position: fixed;
  top: 3.5rem;
  right: 1rem;
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
  padding: 1rem;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 999;
  width: 220px;
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  display: flex;
}

.menu-opciones.visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}
.pagination-controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 1rem;
  gap: 0.5rem;
}

.pagination-controls button {
  padding: 0.5rem 1rem;
  background-color: var(--color-boton);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  transition: background-color 0.3s ease;
}

.pagination-controls button:hover {
  background-color: var(--color-boton-hover);
}

.pagination-controls span {
  font-weight: bold;
  margin-left: 0.5rem;
}

body.modo-oscuro .pagination-controls button {
  background-color: #333;
  color: #ffd54f;
}

body.modo-oscuro .pagination-controls button:hover {
  background-color: #444;
}

.compartir-container {
  position: relative;
  display: flex;
  justify-content: flex-end;
  margin-top: 2rem;
  padding-right: 1rem;
}

.btn-compartir-principal {
  background: none;
  border: none;
  color: #666;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: underline;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.btn-compartir-principal:hover {
  opacity: 1;
  color: #2e7d32;
}

.compartir-container {
  position: relative;
  display: flex;
  justify-content: flex-end;
  margin-top: 2rem;
  padding-right: 1rem;
}

.btn-compartir-principal {
  background: none;
  border: none;
  color: #666;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: underline;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.btn-compartir-principal:hover {
  opacity: 1;
  color: #2e7d32;
}

#hymnContent {
  position: relative;
}

.compartir-wrapper {
  position: absolute;
  top: 1rem;
  left: -2rem;
  z-index: 500;
}

.btn-icono {
  background: none;
  border: none;
  padding: 0.3rem;
  cursor: pointer;
}

.btn-icono img {
  width: 24px;
  height: 24px;
}

.menu-compartir {
  position: absolute;
  top: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  z-index: 999;
}

.menu-compartir button {
  background: none;
  border: none;
  padding: 0.3rem;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.menu-compartir button:hover {
  background: #eef3f2;
}

.menu-compartir img {
  width: 22px;
  height: 22px;
}

.oculto {
  display: none;
}

body.modo-oscuro .btn-icono {
  background-color: transparent;
  border: none;
}

body.modo-oscuro .btn-icono img {
  filter: brightness(1.2) invert(1); /* aclara y convierte a tonos claros */
}

/* Menú desplegable en modo oscuro */
body.modo-oscuro .menu-compartir {
  background-color: #2c2c2c;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.05);
}

body.modo-oscuro .menu-compartir button:hover {
  background-color: #3a3a3a;
}
body.modo-oscuro .menu-compartir img[alt="Copiar"] {
  filter: brightness(1.2) invert(1);
}

.logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.logo-himnario {
  height: 48px;
  width: auto;
  object-fit: contain;
}


@media (max-width: 480px) {
  .logo-himnario {
    height: 36px;
  }
}
.btn-proyector {
  background: none;
  border: none;
  padding: 0.3rem;
  cursor: pointer;
  margin-right: 0.5rem;
}
.btn-proyector img {
  width: 24px;
  height: 24px; 
}

body.modo-oscuro .btn-proyector img {
  filter: brightness(1.2) invert(1);
}