/* Estilos para la app de voluntarios — fondo único, modal por stages. */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300..800&display=swap');

:root {
  /* Colors */
  --primary: #2b7a63;
  --secondary: #f48024;
  --white: #fff;
  --black: #000;
  --shadow-color: #ccc;
  --dark-text: #333;

  /* Transitions */
  --modal-transition: 0.3s;
  --transition-fast: all 0.2s ease;
  --transition-default: all 0.3s ease;

  /* Borders */
  --border-radius: 24px;
}

html,
body {
  height: 100% !important;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--black) url('../img/bg/bg-body@2x.jpg') center / cover no-repeat fixed;
  font-family: 'Outfit', sans-serif;
}

/* ─── Pantalla principal ─── */
.screen {
  width: 100%;
  height: 100dvh;
  display: flex;
}

.screen-inner {
  width: 100%;
  padding: 18dvh 0 6dvh 0;
}

.video-wrap {
  width: clamp(50%, 55vw, 1200px);
  aspect-ratio: 16 / 9;
  border-radius: calc(var(--border-radius) / 2);
  overflow: hidden;
  margin: auto;
}

@media (max-width: 768px) {
  .video-wrap {
    width: 90% !important;
  }
}

.video-wrap iframe {
  width: 100% !important;
  height: 100% !important;
  border: 0;
  display: block;
}

/* ─── Header Principal ─── */
.app-header {
  position: absolute;
  top: 30px;
  right: clamp(20px, 2vw, 40px);
  left: clamp(20px, 2vw, 40px);
  z-index: 10;
  display: flex;
  align-items: end;
  gap: 16px;
  justify-content: end;
}

.logo-top {
  position: absolute;
  left: 0;
  top: 0;
  width: clamp(72px, 8.2vw, 96px);
  height: auto;
}

.lang-selector {
  position: relative;
  background: var(--white);
  border-radius: 999px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  color: var(--primary);
  font-family: inherit;
  font-weight: 600;
}

.lang-selector select {
  appearance: none;
  border: none;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-weight: inherit;
  font-size: 0.92rem;
  padding-right: 16px;
  outline: none;
  cursor: pointer;
}

.lang-caret {
  position: absolute;
  right: 12px;
  pointer-events: none;
  width: 18px;
  height: 18px;
  background: url('../img/icons/caret-down.svg') no-repeat center;
  background-size: contain;
}

.btn-info-pdf {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--secondary);
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: var(--transition-fast);
}

.btn-info-pdf svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn-info-pdf:hover {
  color: var(--primary);
  transform: scale(1.05);
}

/* ─── Botón Siguiente (Flecha Principal) ─── */
.btn-arrow-next {
  margin-top: auto;
  margin-bottom: clamp(1.2rem, 2vw, 3rem);
  width: 112px;
  height: 48px;
  background: var(--primary);
  border: 4px solid var(--white);
  border-radius: var(--border-radius);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 0 var(--shadow-color);
  cursor: pointer;
  transition: var(--transition-default);
  z-index: 20;
}

.btn-arrow-next:hover {
  background-color: var(--secondary);
  transform: translateY(3px);
  box-shadow: 0 0 0 var(--shadow-color);
}

.btn-arrow-next svg {
  width: 36px;
  height: 36px;
}

.footer-img {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2dvh;
  max-height: 20px;
  opacity: 1;
  pointer-events: none;
  z-index: 99999;
}



/* ─── Modal dinámico ─── */
.app-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.125);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--modal-transition) ease;
}

.app-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.app-modal-dialog {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-stage {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modal-stage--hidden {
  display: none;
}

/* Efecto de goma (spring bounce) al aparecer contenido en un stage activo */
@keyframes springPop {
  0% {
    transform: scale(0.92);
    opacity: 0;
  }

  50% {
    transform: scale(1.02);
    opacity: 1;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-stage:not(.modal-stage--hidden)>* {
  animation: springPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Botones Home/volver */
.modal-btn-close,
.modal-btn-back {
  position: absolute;
  top: 16px;
  left: 16px;
  background: #f0f0f0;
  border: 0;
  border-radius: 999px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  z-index: 10;
}

.modal-btn-close:hover,
.modal-btn-back:hover {
  background: #e0e0e0;
  transform: scale(1.05);
}

.modal-btn-close img,
.modal-btn-back img {
  width: 20px;
  height: 20px;
  opacity: 0.7;
}

/* ─── Pill card (Stages 1 y 2) ─── */
.pill-card {
  position: relative;
  width: min(800px, 92vw);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(238, 238, 238, 0.64) 100%);
  border-radius: var(--border-radius);
  padding: clamp(1.5rem, 4dvh, 2.5rem);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(10px);
}

.pill-title {
  margin-bottom: clamp(1.5rem, 4dvh, 2.5rem);
}

.stage-title {
  font-size: clamp(1.5rem, 4dvh, 2.5rem);
  font-weight: 800;
  color: var(--primary);
  margin: 0;
}

/* Stage 1: Opciones */
.choices-row {
  display: flex;
  gap: 30px;
  justify-content: center;
}

.choice-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.choice-img {
  width: 100%;
  max-width: 280px;
  height: auto;
  margin-bottom: 20px;
  object-fit: contain;
}

.choice-btn {
  width: 100%;
  max-width: 240px;
  border: 4px solid var(--white);
  border-radius: 999px;
  background: var(--primary);
  color: var(--white);
  font-weight: 700;
  font-size: 1.3rem;
  padding: 12px 24px;
  box-shadow: 0 4px 0 var(--shadow-color);
  transition: var(--transition-default);
}

.choice-btn:hover {
  background-color: var(--secondary) !important;
  transform: translateY(3px) !important;
  box-shadow: 0 0 0 var(--shadow-color) !important;
}

/* Stage 2: Niveles */
.pill-card-level {
  width: min(600px, 92vw);
}

.levels-row {
  display: flex;
  gap: 20px;
}

.level-card {
  flex: 1;
  border: 2px solid var(--white);
  background: var(--primary);
  color: var(--white);
  border-radius: var(--border-radius);
  padding: 40px 20px;
  box-shadow: 0 12px 24px rgba(43, 122, 99, 0.25);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}

.level-label {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.level-number {
  font-size: 8rem;
  font-weight: 900;
  line-height: 1;
}

.level-card:hover,
.choice-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(43, 122, 99, 0.4);
  filter: brightness(1.1);
}

/* ─── Stage 3: Juego Interactivo / Iframe ─── */
.iframe-view {
  position: relative;
  width: min(1200px, 95vw);
  height: 90vh;
  /* Ocupa casi toda la altura para genially */
  background: rgba(255, 255, 255, 0.95);
  border-radius: 32px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.iframe-view .modal-btn-back {
  top: 16px;
  left: 16px;
  z-index: 10;
}

.iframe-container {
  flex: 1;
  /* Coge todo el espacio restante */
  width: 100%;
  padding-top: 60px;
  /* para dejar hueco al botón volver */
  border-radius: 32px 32px 0 0;
}

.iframe-container iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.iframe-footer {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: flex-end;
  width: auto;
  position: absolute;
  bottom: 0;
  right: 0;
  border-radius: var(--border-radius) 0 0 0;
  box-shadow: 0 -2px 16px rgba(43, 122, 99, 0.3);
}

.btn-continue-iframe {
  border: 2px solid var(--white);
  background: var(--primary);
  color: var(--white);
  font-weight: 700;
  font-size: 0.8rem;
  border-radius: 999px;
  padding: 8px 24px;
  box-shadow: 0 8px 16px rgba(43, 122, 99, 0.3);
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
  cursor: pointer;
}

.btn-continue-iframe:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(43, 122, 99, 0.4);
  filter: brightness(1.1);
}

/* ─── Stage 4: Info (Anterior Stage 3) ─── */
.info-view {
  position: relative;
  width: clamp(75%, 65vw, 80%);
  max-height: 90dvh;
  margin-bottom: 2dvh;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(238, 238, 238, 0.64) 100%);
  border-radius: var(--border-radius);
  padding: clamp(1.5rem, 4dvh, 2.5rem) clamp(4rem, 8dvh, 4rem);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(var(--blur-default));
}

.info-view .modal-btn-back {
  top: 24px;
  left: 24px;
}

.info-content-html {
  text-align: center;
  color: var(--dark-text);
}

.info-stage-title {
  font-size: clamp(1.6rem, 2vw, 2.4rem);
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 1rem;
}

.info-content-html p {
  font-size: clamp(0.78rem, 1.25vw, 1.05rem);
  line-height: 1.4;
  margin-bottom: clamp(0.5rem, 1vw, 0.75rem);
}

.info-content-html .subtitle {
  font-size: clamp(1.125rem, 1.5vw, 1.4rem);
  font-weight: 800;
  color: var(--primary);
  margin: clamp(1rem, 2vw, 1.5rem) 0 clamp(0.5rem, 1vw, 1rem);
}

.info-bottom-layout {
  display: flex;
  align-items: center;
  gap: 30px;
  margin-top: 30px;
  text-align: left;
}

.info-list {
  flex: 1;
  list-style: none;
  padding: 0;
  margin: 0 0 0 2.5vw !important;
}

.info-list li {
  position: relative;
  margin-bottom: clamp(0.5rem, 1vw, 1rem);
  font-size: clamp(0.78rem, 1.25vw, 1.05rem);
  line-height: 1.4;
}

.info-list li::before {
  content: "•";
  position: absolute;
  left: -0.5rem;
  color: var(--dark-text);
  font-weight: bold;
}

.info-image-wrapper {
  flex: 1;
  max-width: 20vw;
}

.info-image-wrapper img {
  width: 100%;
  height: auto;
}

.info-end-text {
  font-size: clamp(0.78rem, 1.25vw, 1.05rem);
  line-height: 1.4;
  font-weight: 600;
  margin-top: 24px;
  text-align: center;
  padding: 0 2rem;
}


/* ─── Avatar Energía (Stage 4) ─── */
.avatar-energia {
  position: fixed;
  bottom: 10%;
  left: 9%;
  transform: translateX(-50%) scale(0.1);
  width: clamp(72px, 16vw, 220px) !important;
  height: auto !important;
  z-index: 100000;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.avatar-energia.is-visible {
  visibility: visible;
  opacity: 1;
  animation: flashAvatar 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes flashAvatar {
  0% {
    transform: translateX(-50%) scale(0.1) translateY(100px);
    opacity: 0;
  }

  50% {
    opacity: 1;
  }

  100% {
    transform: translateX(-50%) scale(1) translateY(0);
    opacity: 1;
  }
}