/* ============================
   EnglishPro - Light Pastel Design
   Default: Light  •  Toggle: Dark Mode (modo noche)
   ============================ */

:root {
  --bg-primary: #f8f9fc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f3f9;
  --bg-input: #f1f3f9;
  --bg-nav: #ffffff;
  --border-light: #e2e8f0;
  --border-medium: #cbd5e1;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 14px rgba(0,0,0,0.08);
}

.dark {
  --bg-primary: #0b0f19;
  --bg-secondary: #0f172a;
  --bg-card: rgba(22, 31, 48, 0.85);
  --bg-card-hover: rgba(30, 41, 59, 0.9);
  --bg-input: #1e293b;
  --bg-nav: rgba(15, 23, 42, 0.95);
  --border-light: rgba(255,255,255,0.08);
  --border-medium: rgba(255,255,255,0.12);
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-lg: 0 4px 14px rgba(0,0,0,0.4);
}

body {
  font-family: 'Inter', sans-serif;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: background 0.3s, color 0.3s;
}

h1, h2, h3, .font-heading {
  font-family: 'Outfit', sans-serif;
}

/* ============================
   Glass Card (adapts to mode)
   ============================ */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-card);
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.dark .glass-card {
  backdrop-filter: blur(14px);
}

/* Boss Glow */
.boss-glow {
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.15);
}
.dark .boss-glow {
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.3);
}

/* Hide Scrollbars */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Safe mobile padding */
.safe-bottom { padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px)); }

/* ============================
   Animations
   ============================ */
@keyframes floatAnim {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.float-item { animation: floatAnim 3s ease-in-out infinite; }

@keyframes soundWave {
  0%, 100% { height: 6px; }
  50% { height: 24px; }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 5px rgba(99, 102, 241, 0.2); }
  50% { box-shadow: 0 0 18px rgba(99, 102, 241, 0.4); }
}
.pulse-glow { animation: pulseGlow 2s ease-in-out infinite; }

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.shake-error { animation: shakeError 0.4s ease-in-out; }

@keyframes popIn {
  0% { transform: scale(0.5); opacity: 0; }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}
.pop-in { animation: popIn 0.35s ease-out forwards; }

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.slide-up { animation: slideUp 0.3s ease-out forwards; }

/* ============================
   Pastel Color Palette
   ============================ */
/* Light mode pastel utilities */
.pastel-indigo   { background: #eef2ff; color: #4f46e5; border-color: #c7d2fe; }
.pastel-emerald  { background: #ecfdf5; color: #059669; border-color: #a7f3d0; }
.pastel-pink     { background: #fdf2f8; color: #db2777; border-color: #fbcfe8; }
.pastel-cyan     { background: #ecfeff; color: #0891b2; border-color: #a5f3fc; }
.pastel-amber    { background: #fffbeb; color: #d97706; border-color: #fde68a; }
.pastel-purple   { background: #faf5ff; color: #9333ea; border-color: #e9d5ff; }
.pastel-rose     { background: #fff1f2; color: #e11d48; border-color: #fecdd3; }

.dark .pastel-indigo   { background: rgba(99,102,241,0.15); color: #a5b4fc; border-color: rgba(99,102,241,0.3); }
.dark .pastel-emerald  { background: rgba(16,185,129,0.15); color: #6ee7b7; border-color: rgba(16,185,129,0.3); }
.dark .pastel-pink     { background: rgba(236,72,153,0.15); color: #f9a8d4; border-color: rgba(236,72,153,0.3); }
.dark .pastel-cyan     { background: rgba(6,182,212,0.15); color: #67e8f9; border-color: rgba(6,182,212,0.3); }
.dark .pastel-amber    { background: rgba(245,158,11,0.15); color: #fcd34d; border-color: rgba(245,158,11,0.3); }
.dark .pastel-purple   { background: rgba(147,51,234,0.15); color: #d8b4fe; border-color: rgba(147,51,234,0.3); }
.dark .pastel-rose     { background: rgba(225,29,72,0.15); color: #fda4af; border-color: rgba(225,29,72,0.3); }

/* ============================
   Adventure Map
   ============================ */
.map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}
@media (min-width: 640px) {
  .map-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
}

.map-node {
  position: relative;
  border-radius: 1.25rem;
  padding: 1.25rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 2px solid var(--border-light);
  background: var(--bg-card);
}
.map-node:hover:not(.map-node-locked) {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.map-node:active:not(.map-node-locked) { transform: scale(0.97); }
.map-node-locked { opacity: 0.4; cursor: not-allowed; filter: grayscale(0.4); }
.map-node-current { animation: pulseGlow 2s ease-in-out infinite; }
.map-node-stars { display: flex; align-items: center; justify-content: center; gap: 2px; margin-top: 0.5rem; }

/* ============================
   Exercise Components
   ============================ */
.match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.match-item {
  padding: 0.75rem; border-radius: 0.75rem; text-align: center;
  cursor: pointer; font-weight: 700; font-size: 0.8rem;
  transition: all 0.2s; min-height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-input); border: 2px solid var(--border-light);
  color: var(--text-primary);
}
.match-item:active { transform: scale(0.95); }
.match-item-selected { border-color: #818cf8 !important; background: #eef2ff !important; }
.dark .match-item-selected { background: rgba(99,102,241,0.15) !important; }
.match-item-correct { border-color: #34d399 !important; background: #ecfdf5 !important; pointer-events: none; }
.dark .match-item-correct { background: rgba(16,185,129,0.15) !important; }
.match-item-wrong { border-color: #fb7185 !important; background: #fff1f2 !important; }
.dark .match-item-wrong { background: rgba(239,68,68,0.1) !important; }

.error-word {
  display: inline-block; padding: 0.25rem 0.5rem; margin: 0.15rem;
  border-radius: 0.5rem; cursor: pointer; transition: all 0.15s;
  font-weight: 700; border: 2px solid transparent;
}
.error-word:hover { background: #eef2ff; border-color: #c7d2fe; }
.dark .error-word:hover { background: rgba(99,102,241,0.15); border-color: rgba(99,102,241,0.4); }
.error-word-selected { background: #fffbeb !important; border-color: #fbbf24 !important; color: #b45309 !important; }
.dark .error-word-selected { background: rgba(245,158,11,0.2) !important; color: #fbbf24 !important; }
.error-word-correct { background: #ecfdf5 !important; border-color: #34d399 !important; color: #059669 !important; text-decoration: line-through; }
.dark .error-word-correct { background: rgba(16,185,129,0.2) !important; color: #34d399 !important; }

.type-input {
  background: var(--bg-input); border: 2px solid var(--border-medium);
  border-radius: 0.75rem; padding: 0.75rem 1rem;
  color: var(--text-primary); font-weight: 700; font-size: 1rem;
  width: 100%; outline: none; transition: border-color 0.2s;
}
.type-input:focus { border-color: #818cf8; }
.type-input-correct { border-color: #34d399 !important; background: #ecfdf5 !important; }
.dark .type-input-correct { background: rgba(16,185,129,0.05) !important; }
.type-input-wrong { border-color: #fb7185 !important; background: #fff1f2 !important; }
.dark .type-input-wrong { background: rgba(239,68,68,0.05) !important; }

.scramble-dropzone {
  min-height: 56px; border: 2px dashed var(--border-medium);
  border-radius: 1rem; display: flex; flex-wrap: wrap;
  align-items: center; justify-content: center; gap: 0.5rem; padding: 0.75rem;
  transition: border-color 0.2s; background: var(--bg-input);
}

.vocab-card { transition: all 0.2s; }
.vocab-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.exercise-type-badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.25rem 0.625rem; border-radius: 9999px;
  font-size: 0.625rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.05em;
}

/* ============================
   Header & Nav (Light)
   ============================ */
.app-header {
  background: var(--bg-nav);
  border-bottom: 1px solid var(--border-light);
  transition: background 0.3s, border-color 0.3s;
}
.dark .app-header {
  background: rgba(15,23,42,0.95);
  backdrop-filter: blur(12px);
}

.app-nav {
  background: var(--bg-nav);
  border-bottom: 1px solid var(--border-light);
}
.dark .app-nav {
  background: rgba(15,23,42,0.8);
}

.mobile-nav {
  background: var(--bg-nav);
  border-top: 1px solid var(--border-light);
}
.dark .mobile-nav {
  background: rgba(15,23,42,0.95);
  backdrop-filter: blur(12px);
}

/* ============================
   Responsive
   ============================ */
@media (max-width: 380px) {
  .map-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .map-node { padding: 1rem 0.75rem; }
}
