:root {
  --bg-color: #f0f7f4;
  --primary-color: #4cc9f0;
  --secondary-color: #4895ef;
  --accent-mat: #ff7096; /* Matemática - Rosa/Rojo */
  --accent-com: #ffb703; /* Comunicación - Amarillo/Naranja */
  --accent-cie: #4ad66d; /* Ciencia - Verde */
  --accent-soc: #9b5de5; /* Personal Social - Morado */
  --accent-art: #f15bb5; /* Arte y Cultura - Magenta */
  --text-color: #2b2d42;
  --card-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
  --border-radius: 20px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Quicksand", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  overflow-x: hidden;
  padding-bottom: 60px;
}

/* Header & Navegación */
.main-header {
  background-color: #fff;
  padding: 15px 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-placeholder {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  width: 45px;
  height: 45px;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
}

.logo-container h1 {
  font-family: "Fredoka One", cursive;
  font-size: 1.4rem;
  color: var(--secondary-color);
}

.main-nav {
  display: flex;
  gap: 15px;
}

.nav-link {
  text-decoration: none;
  color: #6c757d;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 30px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link.active,
.nav-link:hover {
  background-color: var(--primary-color);
  color: white;
}

/* Contenedor General */
.container {
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 20px;
}

/* Control de Pestañas (Tabs) */
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
  animation: fadeIn 0.5s ease;
}

/* Banner Principal */
.hero-banner {
  background: linear-gradient(135deg, #a8dede 0%, #ffd3b6 100%);
  border-radius: var(--border-radius);
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
  box-shadow: var(--card-shadow);
}

.hero-text h2 {
  font-family: "Fredoka One", cursive;
  font-size: 2.5rem;
  color: #2b2d42;
  margin-bottom: 15px;
}

.hero-text p {
  font-size: 1.2rem;
  margin-bottom: 25px;
  max-width: 600px;
  line-height: 1.6;
}

.btn-cta {
  background-color: #ff477e;
  color: white;
  border: none;
  padding: 15px 30px;
  font-family: "Fredoka One", cursive;
  font-size: 1.1rem;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 6px 0 #b91c47;
  transition: all 0.1s ease;
}

.btn-cta:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #b91c47;
}

.hero-image {
  font-size: 4rem;
  letter-spacing: 10px;
}

/* Buscador */
.search-box-container {
  margin-bottom: 40px;
}

.search-wrapper {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.search-wrapper input {
  width: 100%;
  padding: 18px 20px 18px 55px;
  border-radius: 50px;
  border: 3px solid #e2e8f0;
  font-size: 1.1rem;
  font-family: "Quicksand", sans-serif;
  font-weight: 700;
  outline: none;
  transition: all 0.3s;
}

.search-wrapper input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 15px rgba(76, 201, 240, 0.2);
}

.search-icon {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  color: #a0aec0;
}

/* Títulos */
.section-title {
  font-family: "Fredoka One", cursive;
  font-size: 1.8rem;
  margin-bottom: 20px;
}
.text-center {
  text-align: center;
}

/* Grid de Áreas */
.grid-areas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 25px;
  margin-bottom: 40px;
}

.area-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--card-shadow);
  transition:
    transform 0.3s,
    box-shadow 0.3s;
  border-bottom: 6px solid #ddd;
}

.area-card:hover {
  transform: translateY(-8px);
}

.area-card i {
  font-size: 3rem;
  margin-bottom: 15px;
}

.area-card h4 {
  font-family: "Fredoka One", cursive;
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.area-count {
  background-color: #f7fafc;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 700;
}

/* Clases de colores dinámicas para las áreas */
.mat-card {
  border-color: var(--accent-mat);
  color: var(--accent-mat);
}
.com-card {
  border-color: var(--accent-com);
  color: var(--accent-com);
}
.cie-card {
  border-color: var(--accent-cie);
  color: var(--accent-cie);
}
.soc-card {
  border-color: var(--accent-soc);
  color: var(--accent-soc);
}
.art-card {
  border-color: var(--accent-art);
  color: var(--accent-art);
}

/* Grid de Actividades */
.grid-activities {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 25px;
}

.activity-card {
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}

.activity-card:hover {
  transform: scale(1.03);
}

.activity-tag {
  padding: 8px 15px;
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.activity-body {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.activity-body h4 {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.activity-body p {
  font-size: 0.95rem;
  color: #64748b;
  margin-bottom: 15px;
}

.btn-play {
  background-color: #4ad66d;
  color: white;
  border: none;
  padding: 10px;
  font-family: "Fredoka One", cursive;
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 4px 0 #2b9d45;
}

.btn-play:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #2b9d45;
}

/* Sección Visor Ocultable */
.activities-viewer-container {
  background-color: white;
  padding: 30px;
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  margin-top: 20px;
}

.viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  border-bottom: 2px dashed #e2e8f0;
  padding-bottom: 15px;
}

.btn-back {
  background: #edf2f7;
  border: none;
  padding: 10px 20px;
  border-radius: 30px;
  font-weight: 700;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

/* MODAL DEL JUEGO (IFRAME) */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: white;
  width: 90%;
  max-width: 950px;
  height: 85vh;
  border-radius: var(--border-radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  padding: 15px 25px;
  background-color: #f8fafc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
  font-family: "Fredoka One", cursive;
  color: var(--secondary-color);
}

.close-modal {
  background-color: #ff477e;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 700;
  cursor: pointer;
}

.modal-body {
  flex-grow: 1;
  background-color: #000;
}

.modal-body iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Info Card */
.about-card {
  background: white;
  padding: 40px;
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
}
.about-card h3 {
  font-family: "Fredoka One", cursive;
  margin-bottom: 15px;
}
.about-card p {
  margin-bottom: 10px;
  font-size: 1.1rem;
}

/* Footer */
.main-footer {
  text-align: center;
  padding: 20px;
  background: #fff;
  position: fixed;
  bottom: 0;
  width: 100%;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.02);
  font-size: 0.9rem;
}

/* Animaciones */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsivo */
@media (max-width: 768px) {
  .main-header {
    flex-direction: column;
    gap: 15px;
  }
  .hero-banner {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }
  .hero-image {
    display: none;
  }
  .modal-content {
    height: 95vh;
    width: 98%;
  }
}
