/* ============================================================
   BASE.CSS — ESTILOS BASE Y COMUNES DEL PROYECTO LIGA ESCOLAR
   Estándar de diseño: Dark Glassmorphism (Referencia: Minivoley)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Outfit:wght@300;400;500;600;700&display=swap');

/* ===== RESET & NORMALIZACIÓN PARA WEB APP MÓVIL ===== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 15px;
  min-height: 100vh;
  font-family: var(--font-body, 'Outfit', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif);
  color: var(--c-text, #f0f4ff);
  background:
    radial-gradient(ellipse 70% 50% at 15% 10%, rgba(106, 17, 203, 0.3) 0%, transparent 55%),
    radial-gradient(ellipse 60% 45% at 85% 85%, rgba(37, 117, 252, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(155, 89, 182, 0.1) 0%, transparent 60%),
    linear-gradient(160deg, #07091c 0%, #0d0a28 40%, #100c30 100%) !important;
  background-attachment: fixed !important;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Optimización táctil para dispositivos móviles */
button,
.btn,
.btn-icon,
.editable,
[role="button"],
a {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button,
.btn,
.btn-icon {
  user-select: none;
  -webkit-user-select: none;
}

/* Contenedor principal de la aplicación */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 10px;
  width: 100%;
}

/* Tipografía de encabezados */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-body, 'Outfit', sans-serif);
  margin-top: 0;
  color: var(--c-text, #ffffff);
}

/* ===== BOTONES FLOTANTES (ESTILO GLASSMORPHISM) ===== */
.floating-home-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 52px;
  height: 52px;
  background: rgba(0, 0, 0, 0.55);
  color: #ffffff !important;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  z-index: 9999;
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
  font-size: 1.3rem;
}

.floating-home-btn i {
  font-size: 1.3rem;
}

.floating-home-btn:hover {
  transform: scale(1.1) translateY(-2px);
  background: linear-gradient(135deg, #7d3c98, #9b59b6);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 24px rgba(155, 89, 182, 0.45);
}

.floating-home-btn:active {
  transform: scale(0.95);
}

.floating-help-btn {
  position: fixed;
  top: 85px; /* Debajo del botón de inicio */
  left: 20px;
  width: 52px;
  height: 52px;
  background: rgba(0, 0, 0, 0.55);
  color: #ffffff !important;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  z-index: 9999;
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
  font-size: 1.3rem;
}

.floating-help-btn i {
  font-size: 1.3rem;
}

.floating-help-btn:hover {
  transform: scale(1.1) translateY(-2px);
  background: linear-gradient(135deg, #1a5276, #2980b9);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 24px rgba(41, 128, 185, 0.45);
}

.floating-help-btn:active {
  transform: scale(0.95);
}

/* Botón flotante Feedback */
.floating-feedback-btn {
  position: fixed;
  top: 150px;
  left: 20px;
  width: 52px;
  height: 52px;
  background: linear-gradient(145deg, #00b894, #00cec9);
  color: #ffffff !important;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(0, 184, 148, 0.4);
  z-index: 9999;
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  font-size: 1.25rem;
  cursor: pointer;
  font-family: inherit;
}

.floating-feedback-btn i {
  font-size: 1.25rem;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.floating-feedback-btn:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 184, 148, 0.55);
  background: linear-gradient(145deg, #00cec9, #00b894);
}

.floating-feedback-btn:active {
  transform: scale(0.95);
}

/* En página principal solo hay botón feedback */
.floating-feedback-btn-single {
  top: 85px;
}

/* ===== BOTÓN FLOTANTE PWA ===== */
.floating-pwa-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #9b59b6, #8e44ad);
  color: white;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 1.4rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(142, 68, 173, 0.4);
  z-index: 10002;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  backdrop-filter: blur(8px);
}

.floating-pwa-btn:hover {
  transform: scale(1.1) translateY(-2px);
  background: linear-gradient(135deg, #8e44ad, #7d3c98);
  box-shadow: 0 8px 24px rgba(142, 68, 173, 0.55);
}

.floating-pwa-btn:active {
  transform: scale(0.95);
}

/* ===== BOTÓN FLOTANTE / HEADER TEMA (CLARO/OSCURO) ===== */
.theme-toggle-btn,
.floating-theme-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 52px;
  height: 52px;
  background: rgba(0, 0, 0, 0.55);
  color: #ffd700 !important;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  z-index: 9999;
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
  font-size: 1.25rem;
  cursor: pointer;
}

.theme-toggle-btn:hover,
.floating-theme-btn:hover {
  transform: scale(1.1) translateY(-2px);
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 24px rgba(255, 215, 0, 0.35);
}

.theme-toggle-btn:active,
.floating-theme-btn:active {
  transform: scale(0.95);
}

body.light-mode .theme-toggle-btn,
body.light-mode .floating-theme-btn {
  background: rgba(255, 255, 255, 0.9) !important;
  color: #6a11cb !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1) !important;
}

body.light-mode .theme-toggle-btn:hover,
body.light-mode .floating-theme-btn:hover {
  background: #ffffff !important;
  color: #2575fc !important;
  box-shadow: 0 8px 24px rgba(37, 117, 252, 0.25) !important;
}

/* ===== RESPONSIVE PARA MÓVILES (BOTONES FLOTANTES) ===== */
@media (max-width: 768px) {
  .floating-home-btn,
  .floating-help-btn,
  .floating-feedback-btn,
  .floating-pwa-btn,
  .theme-toggle-btn,
  .floating-theme-btn {
    width: 46px;
    height: 46px;
    font-size: 1.15rem;
  }

  .floating-home-btn i,
  .floating-help-btn i,
  .floating-feedback-btn i,
  .floating-pwa-btn i,
  .theme-toggle-btn i,
  .floating-theme-btn i {
    font-size: 1.15rem;
  }

  .floating-home-btn {
    top: 15px;
    left: 15px;
  }

  .floating-help-btn {
    top: 70px;
    left: 15px;
  }

  .floating-feedback-btn {
    top: 125px;
    left: 15px;
  }

  .floating-feedback-btn-single {
    top: 70px;
  }

  .theme-toggle-btn,
  .floating-theme-btn {
    top: 15px;
    right: 15px;
  }

  .floating-pwa-btn {
    bottom: 15px;
    right: 15px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 10px 8px;
  }

  .floating-home-btn,
  .floating-help-btn,
  .floating-feedback-btn,
  .floating-pwa-btn,
  .theme-toggle-btn,
  .floating-theme-btn {
    width: 42px;
    height: 42px;
    font-size: 1.05rem;
  }

  .floating-home-btn i,
  .floating-help-btn i,
  .floating-feedback-btn i,
  .floating-pwa-btn i,
  .theme-toggle-btn i,
  .floating-theme-btn i {
    font-size: 1.05rem;
  }

  .floating-home-btn {
    top: 12px;
    left: 12px;
  }

  .floating-help-btn {
    top: 62px;
    left: 12px;
  }

  .floating-feedback-btn {
    top: 112px;
    left: 12px;
  }

  .floating-feedback-btn-single {
    top: 62px;
  }

  .theme-toggle-btn,
  .floating-theme-btn {
    top: 12px;
    right: 12px;
  }

  .floating-pwa-btn {
    bottom: 10px;
    right: 10px;
  }
}

/* Pantallas grandes */
@media (min-width: 1400px) {
  .floating-home-btn,
  .floating-help-btn,
  .floating-feedback-btn,
  .floating-pwa-btn {
    width: 56px;
    height: 56px;
    font-size: 1.4rem;
  }

  .floating-home-btn {
    left: 25px;
  }

  .floating-help-btn {
    left: 25px;
    top: 95px;
  }

  .floating-feedback-btn {
    left: 25px;
    top: 165px;
  }

  .floating-feedback-btn-single {
    top: 95px;
  }
}

/* ===== MEJORAS PARA PWA (STANDALONE) ===== */
@media (display-mode: standalone) {
  body {
    padding-top: max(15px, env(safe-area-inset-top));
    padding-bottom: max(15px, env(safe-area-inset-bottom));
    padding-left: max(15px, env(safe-area-inset-left));
    padding-right: max(15px, env(safe-area-inset-right));
  }

  .floating-home-btn {
    top: calc(15px + env(safe-area-inset-top));
    left: calc(15px + env(safe-area-inset-left));
  }

  .floating-help-btn {
    top: calc(75px + env(safe-area-inset-top));
    left: calc(15px + env(safe-area-inset-left));
  }

  .floating-feedback-btn {
    top: calc(135px + env(safe-area-inset-top));
    left: calc(15px + env(safe-area-inset-left));
  }

  .floating-feedback-btn-single {
    top: calc(75px + env(safe-area-inset-top));
    left: calc(15px + env(safe-area-inset-left));
  }

  .floating-pwa-btn {
    bottom: calc(15px + env(safe-area-inset-bottom));
    right: calc(15px + env(safe-area-inset-right));
  }
}

/* ===== ESTILOS PARA INSTALACIÓN PWA ===== */
#pwa-install-prompt {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(160deg, #141030, #0d0a28);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--c-text, #f0f4ff);
  padding: 18px 22px;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  z-index: 10001;
  display: none;
  max-width: 420px;
  width: 90%;
  text-align: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

#pwa-install-prompt.show {
  display: block;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translate(-50%, 100%);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

.pwa-install-buttons {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  justify-content: center;
}

.pwa-install-buttons button {
  padding: 9px 18px;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 700;
  font-family: inherit;
  font-size: 0.85rem;
  transition: transform 0.15s, opacity 0.2s;
}

.pwa-install-buttons button:hover {
  transform: translateY(-1px);
}

#pwa-install-accept {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: white;
  box-shadow: 0 4px 12px rgba(46, 204, 113, 0.35);
}

#pwa-install-decline {
  background: rgba(255, 255, 255, 0.1);
  color: var(--c-muted, rgba(240, 244, 255, 0.7));
  border: 1px solid rgba(255, 255, 255, 0.15);
}
