/* ==========================================================================
   ESTILOS PEDAGÓGICOS WALDORF - MAESTRA MARÍA
   Inspirado en la filosofía de Rudolf Steiner: Tonos acuarela, calor orgánico,
   texturas suaves, libre de estridencias y respetuoso con la infancia.
   ========================================================================== */

:root {
  --bg-parchment: #fcf9f2;
  --bg-card: #ffffff;
  --bg-soft-gold: #fdf5e6;
  --primary-rose: #d9788f;
  --primary-rose-light: #fcecef;
  --primary-gold: #e2a652;
  --primary-gold-light: #fdf2dc;
  --primary-green: #6c9c6f;
  --primary-green-light: #eaf3ea;
  --primary-blue: #628ecb;
  --primary-blue-light: #e7effa;
  --primary-lavender: #9a81b7;
  --primary-lavender-light: #f2edf9;
  --text-dark: #3f3630;
  --text-muted: #7d7268;
  --border-organic: #ebdccb;
  --border-radius-soft: 22px;
  --border-radius-pill: 50px;
  --shadow-soft: 0 8px 24px rgba(160, 130, 100, 0.08);
  --shadow-glow: 0 12px 32px rgba(226, 166, 82, 0.2);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Quicksand', 'Nunito', Roboto, sans-serif;
  background-color: var(--bg-parchment);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(244, 203, 212, 0.25) 0%, transparent 40%),
    radial-gradient(circle at 90% 10%, rgba(247, 216, 165, 0.3) 0%, transparent 35%),
    radial-gradient(circle at 50% 80%, rgba(212, 229, 206, 0.3) 0%, transparent 45%);
  background-attachment: fixed;
  color: var(--text-dark);
  min-height: 100vh;
  line-height: 1.6;
}

/* Encabezado */
header.waldorf-header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--border-organic);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(180, 150, 120, 0.05);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  color: inherit;
}

.brand-icon {
  font-size: 2.2rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.header-brand h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: -0.5px;
}

.header-brand p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  border-radius: var(--border-radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border-organic);
}

.badge-online {
  background: var(--primary-green-light);
  color: var(--primary-green);
  border-color: #c0dec0;
}

.dot-live {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: var(--primary-green);
  box-shadow: 0 0 0 3px rgba(108, 156, 111, 0.3);
  animation: pulseLive 2s infinite;
}

@keyframes pulseLive {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(108, 156, 111, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(108, 156, 111, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(108, 156, 111, 0); }
}

/* Contenedor Principal */
.main-container {
  max-width: 1200px;
  margin: 1.5rem auto;
  padding: 0 1.2rem 3rem 1.2rem;
}

/* Tarjetas y Contenedores */
.waldorf-card {
  background: var(--bg-card);
  border: 2px solid var(--border-organic);
  border-radius: var(--border-radius-soft);
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
  margin-bottom: 1.8rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.waldorf-card:hover {
  box-shadow: 0 12px 30px rgba(160, 130, 100, 0.12);
}

.card-header-styled {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
  border-bottom: 1.5px dashed var(--border-organic);
  padding-bottom: 0.8rem;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
}

/* Alerta de Convocatoria (Estilo Cálido Waldorf) */
.alert-banner {
  background: linear-gradient(135deg, #fff9f0 0%, #fff0f3 100%);
  border: 3px solid #f3c299;
  border-radius: 26px;
  padding: 1.6rem 2rem;
  box-shadow: var(--shadow-glow);
  margin-bottom: 2.2rem;
  position: relative;
  overflow: hidden;
  animation: gentleBreathe 4s ease-in-out infinite;
}

@keyframes gentleBreathe {
  0%, 100% { transform: scale(1); border-color: #f3c299; }
  50% { transform: scale(1.006); border-color: #e5989b; }
}

.alert-banner-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #f7a072;
  color: white;
  padding: 0.3rem 0.9rem;
  border-radius: var(--border-radius-pill);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.8rem;
}

.alert-banner h2 {
  font-size: 1.6rem;
  color: #78290f;
  margin-bottom: 0.5rem;
  font-weight: 800;
}

.alert-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.2rem 0;
  background: rgba(255, 255, 255, 0.7);
  padding: 1.2rem;
  border-radius: 18px;
  border: 1px solid #fbe3d2;
}

.alert-detail-item {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
}

.alert-detail-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.alert-detail-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: #a06e57;
  font-weight: 700;
}

.alert-detail-val {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-dark);
}

/* Asignación de Tríos / Grupos */
.my-group-box {
  background: linear-gradient(135deg, #fdf8e2 0%, #faeede 100%);
  border: 2px solid #e2b975;
  border-radius: 20px;
  padding: 1.2rem 1.4rem;
  margin-top: 1rem;
}

.my-group-box h3 {
  font-size: 1.1rem;
  color: #8c5b1b;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.group-members-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.8rem 0;
}

.member-chip {
  background: white;
  border: 1.5px solid #dfc6a3;
  padding: 0.4rem 0.9rem;
  border-radius: var(--border-radius-pill);
  font-size: 0.95rem;
  font-weight: 700;
  color: #5c4327;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.member-chip.me {
  background: #fdf0d5;
  border-color: #d4a373;
  color: #78290f;
}

/* Botones con estilo táctil suave */
.btn-waldorf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: var(--primary-rose);
  color: white;
  border: none;
  padding: 0.75rem 1.4rem;
  border-radius: var(--border-radius-pill);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(217, 120, 143, 0.3);
  text-decoration: none;
}

.btn-waldorf:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(217, 120, 143, 0.45);
}

.btn-waldorf:active {
  transform: translateY(1px);
}

.btn-gold {
  background: var(--primary-gold);
  box-shadow: 0 4px 12px rgba(226, 166, 82, 0.3);
}
.btn-gold:hover {
  box-shadow: 0 6px 16px rgba(226, 166, 82, 0.45);
}

.btn-green {
  background: var(--primary-green);
  box-shadow: 0 4px 12px rgba(108, 156, 111, 0.3);
}
.btn-green:hover {
  box-shadow: 0 6px 16px rgba(108, 156, 111, 0.45);
}

.btn-secondary {
  background: white;
  color: var(--text-dark);
  border: 1.5px solid var(--border-organic);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.btn-secondary:hover {
  background: var(--bg-soft-gold);
  border-color: #dcc2a3;
}

.btn-sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.2rem;
}

/* Grilla de Juegos / Materias */
.category-group {
  margin-bottom: 2rem;
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-organic);
}

.category-title-info {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.category-title-info h3 {
  font-size: 1.2rem;
  color: var(--text-dark);
}

.category-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
}

.game-card {
  background: var(--bg-card);
  border: 2px solid var(--border-organic);
  border-radius: 20px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s ease;
  position: relative;
}

.game-card:hover {
  transform: translateY(-3px);
  border-color: #e0b488;
  box-shadow: 0 8px 20px rgba(180, 140, 100, 0.12);
}

.game-card.disabled-card {
  opacity: 0.55;
  filter: grayscale(40%);
  background: #fbf9f6;
}

.game-card-top {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.game-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--bg-soft-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
  border: 1px solid #ebdccb;
}

.game-card-info h4 {
  font-size: 1.05rem;
  color: var(--text-dark);
  margin-bottom: 0.2rem;
  font-weight: 700;
}

.game-card-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Interruptor Toggle Switch para la Maestra */
.switch-container {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ddcfc0;
  transition: .3s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

input:checked + .slider {
  background-color: var(--primary-green);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

/* Modal de Juego Integrado */
.game-modal {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(45, 35, 30, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.game-modal.open {
  display: flex;
}

.game-modal-content {
  background: var(--bg-parchment);
  width: 100%;
  max-width: 900px;
  max-height: 92vh;
  border-radius: 28px;
  border: 3px solid var(--border-organic);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.game-modal-header {
  padding: 1.2rem 1.6rem;
  background: white;
  border-bottom: 2px solid var(--border-organic);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.game-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.btn-close-modal {
  background: #f0e6da;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dark);
  transition: background 0.2s ease;
}

.btn-close-modal:hover {
  background: #e2d1bf;
}

/* Formularios del Panel de la Maestra */
.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text-dark);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-organic);
  border-radius: 14px;
  font-size: 1rem;
  font-family: inherit;
  background: white;
  color: var(--text-dark);
  outline: none;
  transition: border-color 0.2s ease;
}

.form-control:focus {
  border-color: var(--primary-gold);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Selector de Alumno en Pantalla Alumno */
.student-selector-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  padding: 0.9rem 1.4rem;
  border-radius: var(--border-radius-pill);
  border: 2px solid var(--border-organic);
  margin-bottom: 1.8rem;
  box-shadow: var(--shadow-soft);
}

.student-selector-select {
  padding: 0.4rem 0.8rem;
  border-radius: 12px;
  border: 1.5px solid var(--border-organic);
  font-size: 1rem;
  font-weight: 600;
  background: var(--bg-soft-gold);
  color: var(--text-dark);
  outline: none;
}

/* Responsive */
@media (max-width: 768px) {
  header.waldorf-header {
    flex-direction: column;
    gap: 0.8rem;
    align-items: flex-start;
  }
  .header-status {
    width: 100%;
    justify-content: space-between;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .alert-details-grid {
    grid-template-columns: 1fr;
  }
  .games-grid {
    grid-template-columns: 1fr;
  }
}
