/* ============================================
   ESTILOS GLOBALES
   ============================================ */

* {
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding-top: 20px;
  background: linear-gradient(135deg, #1f1c2c, #928dab);
  color: #0d0d0d;
}

/* ============================================
   APLICACIÓN PRINCIPAL (index.html)
   ============================================ */

#container {
  width: 95%;
  max-width: 640px;
  text-align: center;
}

#app {
  display: block;
  margin: auto;
  width: 95%;
  background: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 16px;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.3);
  text-align: center;
}

#logout-section {
  margin: 1em auto;
  width: 80%;
}

#logout-btn {
  background: #ff5252;
  border: none;
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  display: none;
}

#logout-btn:hover {
  background: #e04646;
}

#logo {
  width: 120px;
  height: auto;
  border-radius: 12px;
  transition: width 0.3s ease, opacity 0.3s ease;
}

#logo.mini {
  width: 60px;
  opacity: 0.8;
}

h1 {
  color: aliceblue;
  margin-top: 10px;
  margin-bottom: 20px;
  font-size: 1.7rem;
}

input {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  outline: none;
  font-size: 1rem;
  margin-bottom: 12px;
  text-align: center;
}

#login-btn {
  display: block;
  margin: 0 auto;
  width: 50%;
}

#codigo {
  margin-top: 1em;
  margin-bottom: 1em;
}

button {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background-color: #ff9800;
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease;
}

button:hover {
  background-color: #e68900;
}

#error-msg {
  color: #800000;
  font-size: 1.1rem;
  margin-top: 10px;
  opacity: 0;
  transition: opacity 0.4s ease;
}

#error-msg.show {
  opacity: 1;
}

#songs {
  margin-top: 8px;
}

#title-song {
  font-weight: 600;
  margin-bottom: 8px;
}

.text-duration {
  font-weight: 300;
  font-size: 0.85em;
}

.song {
  margin: 10px 0;
  background: rgba(255, 255, 255, 0.15);
  padding: 10px;
  border-radius: 8px;
  transition: transform 0.2s ease;
}

.song:hover {
  transform: scale(1.03);
}

.elapsed {
  font-weight: 400;
  font-size: 0.8em;
}

#terms-box {
  margin-top: 1.5em;
  margin-bottom: 2em;
  display: block;
  width: 100%;
}

#terms-box input {
  display: inline-block;
  margin-bottom: 5px;
  width: 16px;
}

#terms-box label {
  display: inline-block;
  font-size: 0.95rem;
  color: #fff;
}

#title-terms {
  color: #f4f4f4;
}

.text-terms {
  text-align: justify;
}

.genre-accordion {
  margin: 10px 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.1);
}

.genre-accordion summary {
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.genre-accordion[open] {
  background: rgba(255, 255, 255, 0.2);
}

.songs-list {
  margin-top: 10px;
}

.playing-genre {
  background: linear-gradient(90deg, #0a84ff, #33c1ff);
  color: white;
  font-weight: bold;
  border-radius: 6px;
  padding: 4px 8px;
  transition: background 0.3s;
}

/* ============================================
   ADMIN PANEL (admin.html)
   ============================================ */

#candado a {
  color: inherit;
  text-decoration: none;
}

#candado a:visited {
  color: inherit;
  text-decoration: none;
}

/* Contenedor principal del admin */
.container {
  width: 95%;
  max-width: 640px;
  margin: 0 auto;
}

/* Sección de formulario */
.form-section {
  width: 95%;
  max-width: 640px;
  background: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 16px;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.3);
  text-align: center;
  margin: 0 auto;
}

/* Grupos de formulario */
.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  color: #fff;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.form-group input {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  outline: none;
  font-size: 1rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.9);
}

.form-group input:focus {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Botones */
.btn-primary {
  display: block;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background-color: #ff9800;
  color: white;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.1s ease;
  margin: 10px 0;
}

.btn-primary:hover {
  background-color: #e68900;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  display: block;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background-color: #FF6467;
  color: white;
  font-weight: bold;
  font-size: 1rem;
  max-width: 320px;
  cursor: pointer;
  margin: 10px auto;
  transition: background 0.3s ease, transform 0.1s ease;
}

.btn-secondary:hover {
  background-color: #D10003;
}

.btn-secondary:active {
  transform: scale(0.98);
}

.btn-danger {
  display: block;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background-color: #FF2E31;
  color: white;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.1s ease;
  margin: 10px 0;
}

.btn-danger:hover {
  background-color: #D10003;
}

.btn-danger:active {
  transform: scale(0.98);
}

.btn-success {
  background-color: #28a745 !important;
}

.btn-success:hover {
  background-color: #218838 !important;
}

/* Mensajes de estado */
.status {
  padding: 12px;
  border-radius: 8px;
  margin: 15px 0;
  font-weight: 500;
  display: none;
  animation: slideIn 0.3s ease;
}

.status-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Caja de código */
.codigo-box {
  background: rgba(255, 255, 255, 0.15);
  padding: 20px;
  border-radius: 8px;
  margin: 20px 0;
  border: 2px solid rgba(255, 255, 255, 0.3);
  animation: slideIn 0.3s ease;
}

.codigo-label {
  color: #e0e0e0;
  font-size: 0.9rem;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.codigo {
  font-size: 48px;
  font-weight: bold;
  color: #4CAF50;
  font-family: "Courier New", monospace;
  letter-spacing: 3px;
  margin: 15px 0;
  text-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

.fecha {
  color: #b0b0b0;
  font-size: 0.95rem;
  margin: 8px 0;
}

.expiracion {
  color: #ffc107;
  font-size: 0.95rem;
  margin: 8px 0;
  font-weight: 600;
}

/* Información de usuario */
.usuario-info {
  color: #4CAF50;
  font-size: 0.95rem;
  margin: 8px 0;
  font-weight: 600;
}

/* Sección de código premium */
.codigo-temporal-section {
  background: rgba(156, 39, 176, 0.1);
  padding: 20px;
  border-radius: 8px;
  margin: 20px 0;
  border: 1px solid rgba(156, 39, 176, 0.3);
}

.codigo-temporal-section h3 {
  margin: 0 0 15px 0;
}

/* Select personalizado */
.select-duracion {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  outline: none;
  font-size: 1rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-weight: 600;
  color: #333;
}

.select-duracion:focus {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 0 10px rgba(156, 39, 176, 0.3);
}

.select-duracion option {
  padding: 10px;
  font-weight: 600;
}

/* Información de sesión */
.session-info {
  background: rgba(255, 255, 255, 0.1);
  padding: 15px;
  border-radius: 8px;
  margin: 20px 0;
  text-align: left;
  font-size: 0.9rem;
  color: #e0e0e0;
}

.session-info p {
  margin: 8px 0;
  display: flex;
  justify-content: space-between;
}

.session-info strong {
  color: #fff;
}

/* Sección de logout */
.logout-section {
  margin-top: 8px;
  padding-top: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* Botón flotante WhatsApp */
.whatsapp-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 1000;
  transition: transform 0.3s ease;
  text-decoration: none;
}

.whatsapp-float:hover {
  transform: scale(1.1);
}

/* Imagen del ícono */
.whatsapp-icon {
  width: 100%;
  height: 100%;
  display: block; 
}

/* Botón pequeño de cerrar */
.close-wa {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #f44336;
  color: white;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 12px;
  cursor: pointer;
  line-height: 16px;
  text-align: center;
  padding: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Información de contacto */
.contact-info {
  text-align: center;
  color: #fff;
  font-size: 0.9rem;
  margin: 20px auto;
  max-width: 640px;
  opacity: 0.8;
}

.contact-info a {
  color: #4CAF50;
  text-decoration: none;
  font-weight: 600;
}

.contact-info a:hover {
  text-decoration: underline;
}

/* ============================================
   RESPONSIVE - Pantallas menores a 420px
   ============================================ */

@media (max-width: 420px) {

  h1 {
    font-size: 24px;
  }

  #container {
    width: 98%;
  }

  #app {
    width: 99%;
  }

  #logout-section {
    width: 98%;
  }

  #songs {
    margin-left: -2px;
  }

  #terms-box {
    margin-bottom: 10px;
  }

  #login-btn {
    margin-top: 2em;
    width: 99%;
  }

  #btn-clipboard {
    width: 80%;
  }

  /* Admin Panel Responsive */
  .container {
    width: 98%;
  }

  .form-section {
    width: 99%;
    padding: 15px;
  }

  .codigo {
    font-size: 36px;
    letter-spacing: 2px;
  }

  .btn-primary,
  .btn-secondary,
  .btn-danger {
    padding: 10px;
    font-size: 0.9rem;
  }

  .session-info {
    font-size: 0.85rem;
  }

  .codigo-box {
    padding: 15px;
  }

  /* Código Premium Responsive */
  .codigo-temporal-section {
    padding: 15px;
  }

  .codigo-temporal-section h3 {
    font-size: 1rem;
  }

  .select-duracion {
    font-size: 0.9rem;
    padding: 10px;
  }

  .whatsapp-float {
    width: 50px;
    height: 50px;
    font-size: 28px;
    bottom: 15px;
    right: 15px;
  }

}