/* ========================================================
   ESTILOS — Píchame algo sintiariel (Duolingo 3D Theme)
   ======================================================== */
:root {
  --bg-main: #0b0f19;
  --bg-card: #151d2f;
  --bg-input: #0f172a;
  --border: #243048;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --color-again: #ef4444;
  --color-again-shadow: #b91c1c;
  --color-hard: #f97316;
  --color-hard-shadow: #c2410c;
  --color-good: #10b981;
  --color-good-shadow: #047857;
  --color-easy: #0ea5e9;
  --color-easy-shadow: #0284c7;
  --color-primary: #8b5cf6;
  --color-primary-shadow: #6d28d9;
  --color-green: #22c55e;
  --color-green-shadow: #15803d;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; -webkit-tap-highlight-color: transparent; }
body { background: var(--bg-main); color: var(--text-primary); min-height: 100vh; display: flex; flex-direction: column; }

/* HEADER */
.app-header { background: rgba(17, 24, 39, 0.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; padding: 12px 18px; }
.header-inner { max-width: 800px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.logo-group { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.logo-img { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4); flex-shrink: 0; }

@keyframes purpleFluctuate {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.logo-text {
  font-weight: 800; font-size: 1.18rem; letter-spacing: -0.4px;
  background: linear-gradient(90deg, #d8b4fe, #a855f7, #c084fc, #9333ea, #e9d5ff);
  background-size: 250% 250%; -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  animation: purpleFluctuate 5s ease infinite;
}

.header-stats { display: flex; align-items: center; gap: 8px; }
.stat-pill { background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px; padding: 4px 10px; font-size: 0.78rem; font-weight: 700; color: var(--text-secondary); }
.stat-pill.due { color: #fb7185; border-color: rgba(251, 113, 133, 0.3); background: rgba(251, 113, 133, 0.1); }
.header-actions { display: flex; gap: 6px; }

/* VISTAS */
.app-view { display: none; max-width: 800px; margin: 0 auto; width: 100%; padding: 16px; flex: 1; }
.app-view.active { display: block; }

/* HEATMAP MINIMALISTA */
.heatmap-container { display: flex; align-items: center; justify-content: space-between; background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 10px 16px; margin-bottom: 16px; }
.heatmap-days { display: flex; gap: 8px; }
.heat-dot { width: 28px; height: 28px; border-radius: 8px; background: #1e293b; display: flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 800; color: var(--text-muted); border: 1px solid var(--border); transition: all 0.2s; }
.heat-dot.active { background: #10b981; color: #fff; border-color: #059669; box-shadow: 0 0 8px rgba(16, 185, 129, 0.4); }
.heat-dot.today { border-color: #8b5cf6; }

/* BOTONES 3D */
.btn-3d { display: inline-flex; align-items: center; justify-content: center; font-weight: 800; border-radius: 12px; border: none; cursor: pointer; transition: all 0.1s; text-transform: uppercase; letter-spacing: 0.5px; padding: 10px 16px; font-size: 0.82rem; user-select: none; }
.btn-3d:active { transform: translateY(3px) !important; box-shadow: 0 1px 0 rgba(0,0,0,0.4) !important; }
.btn-primary { background: var(--color-primary); color: #fff; box-shadow: 0 4px 0 var(--color-primary-shadow); }
.btn-green { background: var(--color-green); color: #fff; box-shadow: 0 4px 0 var(--color-green-shadow); }
.btn-secondary { background: #334155; color: #f1f5f9; box-shadow: 0 4px 0 #1e293b; }
.btn-dark { background: #1e293b; color: #cbd5e1; border: 1px solid var(--border); box-shadow: 0 4px 0 #0f172a; }
.btn-again { background: var(--color-again); color: #fff; box-shadow: 0 4px 0 var(--color-again-shadow); }
.btn-hard { background: var(--color-hard); color: #fff; box-shadow: 0 4px 0 var(--color-hard-shadow); }
.btn-good { background: var(--color-good); color: #fff; box-shadow: 0 4px 0 var(--color-good-shadow); }
.btn-easy { background: var(--color-easy); color: #fff; box-shadow: 0 4px 0 var(--color-easy-shadow); }
.btn-icon { background: var(--bg-card); border: 1px solid var(--border); color: var(--text-primary); width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 0.95rem; }
.btn-icon:hover { border-color: #8b5cf6; }

/* TOGGLE MODO INVERSO */
.mode-toggle-bar { display: flex; gap: 8px; margin-bottom: 16px; }
.btn-mode-toggle { flex: 1; background: #1e293b; border: 1px solid #334155; color: #cbd5e1; padding: 9px 14px; border-radius: 12px; font-weight: 700; font-size: 0.82rem; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 6px; }
.btn-mode-toggle:hover { border-color: #8b5cf6; color: #fff; }

/* DECK CARDS */
.decks-list { display: flex; flex-direction: column; gap: 14px; }
.deck-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; justify-content: space-between; gap: 14px; }
.deck-badge { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; margin-bottom: 4px; }
.deck-title { font-size: 1.15rem; font-weight: 800; color: #fff; }
.deck-desc { font-size: 0.85rem; color: var(--text-secondary); margin-top: 4px; line-height: 1.4; }
.deck-meta { display: flex; gap: 16px; font-size: 0.8rem; color: var(--text-muted); margin-top: 8px; }
.deck-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ESTUDIO */
.study-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.progress-container { flex: 1; margin: 0 10px; height: 10px; background: #1e293b; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #8b5cf6, #c084fc); transition: width 0.3s; }
.streak-pill { background: #1e293b; color: #94a3b8; border: 1px solid var(--border); padding: 4px 10px; border-radius: 12px; font-weight: 800; font-size: 0.8rem; }
.streak-pill.hot { background: rgba(249, 115, 22, 0.15); color: #fb923c; border-color: #f97316; }

/* 3D FLIP CARD */
.card-scene { perspective: 1200px; min-height: 350px; margin-bottom: 16px; cursor: pointer; }
.flip-card-wrapper { width: 100%; min-height: 350px; position: relative; transform-style: preserve-3d; transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1); border-radius: 20px; }
.flip-card-wrapper.is-flipped { transform: rotateY(180deg); }
.card-face { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 20px; backface-visibility: hidden; -webkit-backface-visibility: hidden; padding: 22px; display: flex; flex-direction: column; justify-content: space-between; border: 2px solid var(--border); }
.card-face-front { background: linear-gradient(145deg, #162035, #0f172a); }
.card-face-back { background: linear-gradient(145deg, #1f1a3a, #0e1124); transform: rotateY(180deg); border-color: #a855f7; }
.card-tag { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: #c084fc; text-align: center; }
.verb-big { font-size: 2.1rem; font-weight: 900; color: #fff; text-align: center; letter-spacing: 1px; margin: auto 0 4px 0; }
.mean-text { font-size: 1.05rem; color: #c084fc; text-align: center; font-weight: 600; margin-bottom: 4px; }
.prompt-sub { font-size: 0.8rem; color: var(--text-muted); text-align: center; margin-bottom: 6px; }

/* PISTA Y TRAMPA */
.hint-container { text-align: center; margin-bottom: auto; }
.hint-box { display: none; background: rgba(251, 191, 36, 0.12); border: 1px solid rgba(251, 191, 36, 0.35); color: #fbbf24; border-radius: 10px; padding: 6px 12px; font-size: 0.8rem; font-weight: 700; display: inline-block; }
.btn-hint { background: transparent; border: 1px dashed rgba(251, 191, 36, 0.4); color: #fbbf24; font-size: 0.75rem; font-weight: 700; padding: 4px 10px; border-radius: 10px; cursor: pointer; }
.card-tip-box { background: rgba(244, 63, 94, 0.15); border: 1px solid rgba(244, 63, 94, 0.35); color: #fda4af; font-size: 0.76rem; border-radius: 8px; padding: 6px 10px; text-align: center; margin-bottom: 6px; }

/* FORMAS Y MICRO-CONTEXTO */
.forms-box { margin: auto 0; display: flex; flex-direction: column; gap: 6px; }
.form-row { background: rgba(0,0,0,0.3); border-radius: 10px; padding: 6px 12px; display: flex; align-items: center; justify-content: space-between; }
.form-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; font-weight: 800; }
.form-val { font-size: 1.25rem; font-weight: 800; color: #34d399; }
.pron-text { font-size: 0.8rem; color: #fbbf24; text-align: center; font-style: italic; }
.card-example-box { background: rgba(0, 0, 0, 0.25); border-left: 3px solid #8b5cf6; padding: 8px 12px; border-radius: 8px; margin-top: 6px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-example-text { font-size: 0.82rem; color: #e2e8f0; font-style: italic; line-height: 1.35; }
.card-tap-hint { font-size: 0.74rem; color: var(--text-muted); text-align: center; }

/* BOTONES RATING */
.rating-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.btn-rate { padding: 10px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.time-hint { font-size: 0.7rem; opacity: 0.9; font-weight: 700; }
.label-hint { font-size: 0.75rem; }

/* MODALES */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.75); backdrop-filter: blur(6px); z-index: 100; align-items: center; justify-content: center; padding: 16px; }
.modal-overlay.open { display: flex; }
.modal-box { background: #111827; border: 1px solid var(--border); border-radius: 20px; width: 100%; max-width: 540px; max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 1.1rem; font-weight: 800; color: #fff; }
.modal-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* TUTORIAL CARDS */
.tutorial-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.tutorial-card-title { font-weight: 800; font-size: 0.92rem; color: #c084fc; margin-bottom: 4px; }
.tutorial-card-desc { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.45; }

/* EXPLORADOR DE VERBOS */
.explorer-verbs-list { display: flex; flex-direction: column; gap: 8px; }
.explorer-verb-row { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* SUMMARY & CONTROLES */
.summary-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 16px 0; }
.summary-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 14px; text-align: center; }
.summary-value { font-size: 1.6rem; font-weight: 900; color: #c084fc; }
.summary-label { font-size: 0.74rem; color: var(--text-secondary); font-weight: 700; margin-top: 2px; }
.interval-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.interval-label { width: 80px; font-size: 0.82rem; font-weight: 700; }
.preview-pill { background: #1e293b; border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; font-size: 0.75rem; font-weight: 700; color: #c084fc; min-width: 50px; text-align: center; }
.form-group { margin-bottom: 14px; }
.form-input, .form-select { width: 100%; background: var(--bg-input); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; color: #fff; font-size: 0.9rem; outline: none; }

@media (max-width: 600px) {
  .rating-grid { grid-template-columns: repeat(2, 1fr); }
  .card-scene { min-height: 330px; }
  .verb-big { font-size: 1.8rem; }
  .form-val { font-size: 1.15rem; }
}
