/* =====================================================================
   damage-visual-pro.css
   Versión premium del modal de daño con estilo Genshin Impact
   ===================================================================== */

/* ────────────────────── CONTENEDOR PRINCIPAL ────────────────────── */
#modal-dano {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  overflow-y: auto; /* Mover el scroll al contenedor principal */
  -webkit-overflow-scrolling: touch; /* Mejorar scroll en móviles */
}

#modal-dano .modal-overlay {
  position: fixed; /* Cambiado de absolute a fixed */
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1;
  opacity: 0;
  animation: fadeIn 0.3s ease-out forwards;
  min-height: 100vh; /* Asegura cobertura completa */
  display: flex;
  align-items: center; /* Centra verticalmente el contenido */
  justify-content: center;
  padding: 20px 0; /* Espacio de respiro */
}

@keyframes fadeIn {
  to { opacity: 1; }
}

#modal-dano .modal-contenido {
  position: relative; /* Cambiado de absolute a relative */
  margin: 20px auto; /* Centrado con márgenes */
  z-index: 2;
  background: linear-gradient(135deg, #0a0a1a 0%, #141432 100%);
  padding: 30px;
  border-radius: 14px;
  width: 90%;
  max-width: 750px;
  color: #f0f0f0;
  box-shadow:
    0 0 0 1px rgba(100, 200, 255, 0.4),
    0 0 30px rgba(100, 200, 255, 0.2);
  animation: fadeInZoom 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  border: 1px solid rgba(100, 200, 255, 0.2);
  max-height: 80vh; /* Reduce este valor según necesites (de 90vh a 80vh o menos) */
  overflow-y: auto; /* Asegura scroll interno si el contenido excede la altura */
  margin: 5vh auto; /* Centrado vertical reducido */
}


@keyframes fadeInZoom {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

#modal-dano-body {
  max-height: calc(80vh - 200px); /* Ajusta proporcionalmente */
  overflow-y: auto;
  padding-right: 8px; /* Evita que el contenido se solape con la barra de scroll */
}


/* ────────────────────── TÍTULO ────────────────────── */
#modal-dano-titulo {
  font-size: 1.6rem;
  margin-bottom: 1.2rem;
  background: linear-gradient(to right, #ffd700, #8bc8ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  position: relative;
  display: inline-block;
  padding-bottom: 5px;
  text-align: center;
}

#modal-dano-titulo::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, transparent, rgba(100, 200, 255, 0.6), transparent);
  border-radius: 2px;
}

/* ────────────────────── NOTA DEL VIAJERO (ACTUALIZADO) ────────────────────── */
#modal-dano .bg-warning {
  background: rgba(255, 215, 0, 0.15) !important;
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  font-size: 0.95rem;
  line-height: 1.6;
  backdrop-filter: blur(3px);
  transition: all 0.3s ease;
  width: 100%; /* Aseguramos que ocupe todo el ancho disponible */
  box-sizing: border-box; /* Incluye padding en el ancho total */
}

/* Texto de la nota - Mejor contraste */
#modal-dano .bg-warning, 
#modal-dano .bg-warning em, 
#modal-dano .bg-warning br {
  color: #f8f8f8 !important; /* Texto claro para mejor legibilidad */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Partes destacadas */
#modal-dano .bg-warning strong {
  color: #ffd700 !important; /* Dorado para énfasis */
  font-weight: 600;
}

#modal-dano .bg-warning em {
  font-style: italic;
  color: #8bc8ff !important; /* Azul claro para el texto secundario */
}

/* Icono decorativo */
#modal-dano .bg-warning::before {
  content: "✨";
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
  font-size: 1.1em;
}

/* Efecto hover más pronunciado */
#modal-dano .bg-warning:hover {
  background: rgba(255, 215, 0, 0.2) !important;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
  transform: translateY(-2px);
  border-color: rgba(255, 215, 0, 0.4);
}

/* ────────────────────── CONTENIDO PRINCIPAL ────────────────────── */
.resumen-personaje-modal {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  position: relative;
  z-index: 1;
}

/* ────────────────────── PERSONAJE ────────────────────── */
.personaje-info {
  text-align: center;
  transition: transform 0.3s ease;
}

.personaje-info:hover {
  transform: translateY(-5px);
}

.img-personaje-modal {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 2px solid rgba(255, 215, 0, 0.7);
  object-fit: cover;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
  transition: all 0.3s ease;
}

.img-personaje-modal:hover {
  transform: scale(1.05);
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.5);
}

.personaje-info h5 {
  margin-top: 8px;
  font-size: 1.1rem;
  color: #8bc8ff;
  text-shadow: 0 0 8px rgba(140, 200, 255, 0.4);
}

/* ────────────────────── EQUIPO (ARMA + SET) ────────────────────── */
.equipo-info {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  flex-grow: 1;
}

.arma-info, .set-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(30, 60, 90, 0.2);
  border: 1px solid rgba(100, 200, 255, 0.1);
  transition: all 0.3s ease;
}

.arma-info:hover, .set-info:hover {
  background: rgba(30, 60, 90, 0.3);
  border-color: rgba(100, 200, 255, 0.2);
  transform: translateX(5px);
}

.equipo-info img {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: contain;
  border: 1px solid rgba(100, 200, 255, 0.3);
  transition: all 0.3s ease;
}

.equipo-info img:hover {
  transform: scale(1.1);
  border-color: rgba(255, 215, 0, 0.5);
}

.arma-info h6, .set-info h6 {
  font-size: 1.05rem;
  margin: 0;
  color: #f0f0f0;
}

.arma-info small, .set-info small {
  color: #8bc8ff;
  font-size: 0.85rem;
  opacity: 0.8;
}

.set-info img {
  width: 64px;
  height: auto;
}

/* ────────────────────── SECCIÓN DE DAÑOS ────────────────────── */
.danos-info {
  min-width: 220px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 1px solid rgba(100, 200, 255, 0.1);
  transition: all 0.3s ease;
}

.danos-info:hover {
  background: rgba(0, 0, 0, 0.3);
  box-shadow: 0 0 15px rgba(100, 200, 255, 0.1);
}

.danos-info h6 {
  font-size: 1.1rem;
  color: #ffd700;
  margin-bottom: 12px;
  text-align: center;
  position: relative;
}

.danos-info h6::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 25%;
  width: 50%;
  height: 1px;
  background: linear-gradient(to right, transparent, #64b5f6, transparent);
  border-radius: 2px;
}

.lista-danos {
  margin: 0;
  padding: 0;
}

.lista-danos li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 6px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  transition: all 0.2s ease;
}

.lista-danos li:hover {
  background: rgba(100, 200, 255, 0.1);
  transform: translateX(3px);
}

.lista-danos .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 1rem;
  color: #ffd700;
}

.lista-danos strong {
  color: #8bc8ff;
  font-weight: 600;
}

.lista-danos .texto {
  color: #f0f0f0;
  font-size: 0.9rem;
}

/* ────────────────────── BOTÓN CERRAR ────────────────────── */
#modal-dano .btn {
  padding: 8px 24px;
  font-size: 0.95rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(100, 180, 255, 0.2) 0%, rgba(100, 180, 255, 0.1) 100%);
  color: #8bc8ff;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(100, 200, 255, 0.3);
}

#modal-dano .btn:hover {
  background: linear-gradient(135deg, rgba(100, 180, 255, 0.3) 0%, rgba(100, 180, 255, 0.2) 100%);
  color: #ffffff;
  box-shadow: 0 0 15px rgba(100, 200, 255, 0.2);
  transform: translateY(-2px);
}

#modal-dano .btn::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to bottom right,
    transparent 45%,
    rgba(100, 200, 255, 0.1) 50%,
    transparent 55%
  );
  transform: rotate(30deg);
  transition: all 0.5s ease;
}

#modal-dano .btn:hover::before {
  left: 100%;
}

/* ────────────────────── EFECTOS ESPECIALES ────────────────────── */
.star-effect {
  position: absolute;
  width: 2px;
  height: 2px;
  background-color: #8bc8ff;
  border-radius: 50%;
  animation: twinkle 3s ease-in-out infinite;
  opacity: 0;
  filter: drop-shadow(0 0 3px #64b5f6);
}

@keyframes twinkle {
  0%, 100% { opacity: 0; }
  50% { opacity: 0.8; }
}


/* ────────────────────── REACCIONES ELEMENTALES ────────────────────── */
.reacciones-info {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  background: rgba(30, 60, 90, 0.2);
  border: 1px solid rgba(100, 200, 255, 0.1);
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.reacciones-info:hover {
  background: rgba(30, 60, 90, 0.3);
  border-color: rgba(100, 200, 255, 0.2);
}

.reacciones-info legend {
  color: #ffd700;
  padding: 0 8px;
  font-size: 0.95rem;
  font-weight: 600;
}

.form-check-inline {
  margin-right: 12px;
}

.form-check-input {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(100, 200, 255, 0.5);
  border-radius: 50%;
  background-color: transparent;
  position: relative;
  margin-right: 6px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.form-check-input:checked {
  border-color: #ffd700;
  background-color: rgba(255, 215, 0, 0.2);
}

.form-check-input:checked::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffd700;
  box-shadow: 0 0 5px #ffd700;
}

.form-check-label {
  color: #f0f0f0;
  cursor: pointer;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.form-check-input:hover {
  border-color: #8bc8ff;
}

.form-check-input:checked:hover {
  border-color: #ffd700;
}

.form-check-input:focus {
  box-shadow: 0 0 0 0.25rem rgba(255, 215, 0, 0.25);
  outline: none;
}

/* ────────────────────── BUFOS ACTIVOS ────────────────────── */
.buffs-info {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  background: rgba(40, 70, 80, 0.2); /* Tono ligeramente diferente */
  border: 1px solid rgba(100, 255, 200, 0.1); /* Borde más verdoso */
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.buffs-info:hover {
  background: rgba(40, 70, 80, 0.3);
  border-color: rgba(100, 255, 200, 0.2);
}

.buffs-info legend {
  color: #4caf50; /* Verde para diferenciar de las reacciones */
  padding: 0 8px;
  font-size: 0.95rem;
  font-weight: 600;
}

/* Estilos para los checkboxes (diferente de los radio buttons) */
.buffs-info .form-check-input {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(100, 255, 200, 0.5); /* Borde verdoso */
  border-radius: 4px; /* Esquinas cuadradas para checkboxes */
  background-color: transparent;
  position: relative;
  margin-right: 6px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.buffs-info .form-check-input:checked {
  border-color: #4caf50;
  background-color: rgba(76, 175, 80, 0.2);
}

.buffs-info .form-check-input:checked::after {
  content: '✓';
  position: absolute;
  top: -2px;
  left: 1px;
  width: 100%;
  height: 100%;
  color: #4caf50;
  font-size: 0.8rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

.buffs-info .form-check-label {
  color: #f0f0f0;
  cursor: pointer;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.buffs-info .form-check-input:hover {
  border-color: #81c784; /* Verde más claro al hover */
}

.buffs-info .form-check-input:checked:hover {
  border-color: #4caf50;
}

.buffs-info .form-check-input:focus {
  box-shadow: 0 0 0 0.25rem rgba(76, 175, 80, 0.25);
  outline: none;
}

/* ────────────────────── RESPONSIVE ────────────────────── */
@media (max-width: 768px) {
  #modal-dano {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }

  #modal-dano .modal-contenido {
    position: relative;
    top: 0;
    left: 0;
    transform: none;
    margin: 0 auto;
    padding: 20px;
    width: 95%;
    max-width: 95vw;
    max-height: calc(100vh - 40px);
    box-sizing: border-box;
    overflow-y: auto;
    animation: none;
  }

  .resumen-personaje-modal {
    flex-direction: column;
    align-items: center;
    max-width: 100%;
    overflow: hidden;
  }

  .equipo-info {
    width: 100%;
  }

  .danos-info {
    width: 100%;
    text-align: center;
  }

  .lista-danos li {
    justify-content: center;
    word-break: break-word;
  }
}

@media (max-width: 480px) {
  #modal-dano-titulo {
    font-size: 1.4rem;
  }

  .img-personaje-modal {
    width: 80px;
    height: 80px;
  }

  .equipo-info img {
    width: 48px;
    height: 48px;
  }

  .set-info img {
    width: 56px;
  }
}
