/* ════════════════════════════════════════════════════════════
   🥚 LIMPIAAI v10.0 — CELESTIAL EDITION · TRANSCENDENCE LAYER
   Lunar Widget • Daily Affirmation • Achievements • Radar Chart
   Share Card • Breathing Mode • History Search • Streaks
   Se carga DESPUÉS de style.css y premium.css
   ════════════════════════════════════════════════════════════ */

/* ═══ LUNAR PHASE WIDGET (Home) ═══ */
.lunar-card {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, rgba(30,27,75,.55), rgba(8,8,32,.85));
  border: 1px solid rgba(148,163,184,.1); border-radius: var(--rx);
  padding: 14px 16px; margin: 1.2rem 0; position: relative; overflow: hidden;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.lunar-card::before {
  content: ''; position: absolute; top: -40px; right: -40px; width: 140px; height: 140px;
  background: radial-gradient(circle, rgba(148,163,255,.14), transparent 65%);
  border-radius: 50%; pointer-events: none;
}
.lunar-moon {
  font-size: 2.6rem; line-height: 1; flex-shrink: 0;
  filter: drop-shadow(0 0 18px rgba(191,219,254,.45));
  animation: moonBreathe 5s ease-in-out infinite;
}
@keyframes moonBreathe { 50% { filter: drop-shadow(0 0 30px rgba(191,219,254,.7)); transform: scale(1.04); } }
.lunar-info { flex: 1; min-width: 0; }
.lunar-phase-name { font-size: .92rem; font-weight: 800; color: #dbeafe; }
.lunar-detail { font-size: .68rem; color: var(--t2); margin-top: 2px; line-height: 1.45; }
.lunar-pct {
  font-family: var(--mono); font-size: .62rem; font-weight: 700;
  color: #93c5fd; background: rgba(59,130,246,.12); border: 1px solid rgba(59,130,246,.22);
  padding: 3px 9px; border-radius: 99px; white-space: nowrap; flex-shrink: 0;
}

/* ═══ DAILY AFFIRMATION CARD ═══ */
.affirm-card {
  position: relative; text-align: center; overflow: hidden;
  background: linear-gradient(150deg, rgba(124,58,237,.14), rgba(8,8,32,.9) 55%);
  border: 1px solid rgba(124,58,237,.2); border-radius: var(--rx);
  padding: 22px 20px 18px; margin: 1.2rem 0;
}
.affirm-card::after {
  content: '❝'; position: absolute; top: -14px; left: 10px;
  font-size: 5rem; color: rgba(167,139,250,.09); font-family: Georgia, serif;
  pointer-events: none;
}
.affirm-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .6rem; font-weight: 800; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--ta); margin-bottom: 10px;
}
.affirm-text {
  font-family: 'Playfair Display', serif; font-size: 1.05rem; font-weight: 700;
  line-height: 1.55; color: #ede9fe;
}
.affirm-author { font-size: .64rem; color: var(--t3); margin-top: 10px; font-style: italic; }
.affirm-refresh {
  position: absolute; top: 10px; right: 10px; width: 32px; height: 32px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: var(--t3); background: rgba(255,255,255,.03); border: 1px solid var(--bd);
  transition: all var(--tn); font-size: .75rem;
}
.affirm-refresh:hover { color: var(--pl); transform: rotate(180deg); border-color: var(--bda); }
html[dir="rtl"] .affirm-refresh { right: auto; left: 10px; }

/* ═══ STREAK BADGE (header area / home) ═══ */
.streak-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 99px; font-size: .68rem; font-weight: 800;
  color: #fbbf24; background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.28);
  animation: streakGlow 3s ease-in-out infinite;
}
@keyframes streakGlow { 50% { box-shadow: 0 0 16px rgba(245,158,11,.25); } }

/* ═══ ACHIEVEMENTS SYSTEM ═══ */
.ach-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.ach-card {
  text-align: center; padding: 14px 8px 12px; border-radius: var(--rl);
  background: var(--gc); border: 1px solid var(--bd);
  transition: transform var(--tn), border-color var(--tn);
  position: relative; overflow: hidden;
}
.ach-card.unlocked {
  border-color: rgba(245,158,11,.35);
  background: linear-gradient(160deg, rgba(245,158,11,.08), rgba(8,8,32,.9) 60%);
}
.ach-card.unlocked::before {
  content: ''; position: absolute; inset: -50%;
  background: conic-gradient(from 0deg, transparent 78%, rgba(251,191,36,.12), transparent 92%);
  animation: achSweep 5s linear infinite; pointer-events: none;
}
@keyframes achSweep { to { transform: rotate(360deg); } }
.ach-card.locked { opacity: .45; filter: grayscale(.9); }
.ach-card:hover { transform: translateY(-2px); }
.ach-icon { font-size: 1.7rem; line-height: 1; margin-bottom: 6px; }
.ach-card.unlocked .ach-icon { filter: drop-shadow(0 0 10px rgba(251,191,36,.5)); }
.ach-name { font-size: .62rem; font-weight: 800; color: var(--t1); line-height: 1.3; }
.ach-desc { font-size: .55rem; color: var(--t3); margin-top: 3px; line-height: 1.35; }

/* Achievement unlock toast (special) */
.ach-toast {
  position: fixed; top: calc(var(--hh) + var(--st) + 12px); left: 50%;
  transform: translateX(-50%) translateY(-140%);
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, rgba(30,20,60,.97), rgba(15,10,40,.97));
  border: 1px solid rgba(251,191,36,.4); border-radius: var(--rx);
  padding: 12px 20px; z-index: 9500; box-shadow: 0 12px 48px rgba(0,0,0,.6), 0 0 40px rgba(251,191,36,.15);
  backdrop-filter: blur(20px); transition: transform .6s cubic-bezier(.34,1.56,.64,1);
  max-width: min(92vw, 380px);
}
.ach-toast.show { transform: translateX(-50%) translateY(0); }
.ach-toast-icon { font-size: 2rem; filter: drop-shadow(0 0 12px rgba(251,191,36,.6)); }
.ach-toast-label { font-size: .58rem; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: #fbbf24; }
.ach-toast-name { font-size: .85rem; font-weight: 800; color: #fff; margin-top: 1px; }

/* ═══ ENERGY RADAR CHART (Results) ═══ */
.radar-wrap { display: flex; flex-direction: column; align-items: center; padding: 6px 0 2px; }
.radar-svg { width: 100%; max-width: 300px; height: auto; }
.radar-legend {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 12px; margin-top: 8px;
}
.radar-leg-item { display: flex; align-items: center; gap: 5px; font-size: .6rem; color: var(--t2); font-weight: 600; }
.radar-leg-val { font-family: var(--mono); color: var(--ta); font-weight: 800; }

/* ═══ SHARE CARD MODAL ═══ */
.sharecard-modal {
  position: fixed; inset: 0; z-index: 9600; display: none;
  align-items: center; justify-content: center; padding: 20px;
}
.sharecard-modal.on { display: flex; }
.sharecard-backdrop { position: absolute; inset: 0; background: rgba(2,2,12,.85); backdrop-filter: blur(10px); }
.sharecard-content {
  position: relative; z-index: 1; width: 100%; max-width: 380px;
  display: flex; flex-direction: column; gap: 14px; align-items: center;
  animation: modalPop .5s cubic-bezier(.16,1,.3,1);
}
.sharecard-img {
  width: 100%; border-radius: var(--rx); box-shadow: 0 24px 80px rgba(0,0,0,.7), 0 0 60px rgba(124,58,237,.2);
  border: 1px solid rgba(167,139,250,.25);
}
.sharecard-actions { display: flex; gap: 10px; width: 100%; }
.sharecard-actions .btn-primary, .sharecard-actions .btn-outline { flex: 1; min-height: 46px; font-size: .82rem; padding: 10px; }
.sharecard-close {
  position: absolute; top: -46px; right: 0; width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.08); color: #fff; display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.12); z-index: 2;
}

/* ═══ BREATHING MODE (Zen) ═══ */
.breathe-modal {
  position: fixed; inset: 0; z-index: 9700; display: none;
  align-items: center; justify-content: center; flex-direction: column; gap: 2.2rem;
  background: radial-gradient(ellipse at 50% 40%, #0c0a2e 0%, #030311 70%);
}
.breathe-modal.on { display: flex; }
.breathe-orb-wrap { position: relative; width: 240px; height: 240px; display: flex; align-items: center; justify-content: center; }
.breathe-orb {
  width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(196,181,253,.9), rgba(124,58,237,.55) 45%, rgba(59,130,246,.3) 80%);
  box-shadow: 0 0 60px rgba(124,58,237,.5), 0 0 140px rgba(124,58,237,.25), inset 0 0 40px rgba(255,255,255,.15);
  transition: transform 4s cubic-bezier(.4,0,.2,1);
}
.breathe-orb.inhale { transform: scale(1.85); }
.breathe-orb.hold { transform: scale(1.85); }
.breathe-orb.exhale { transform: scale(1); }
.breathe-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1px dashed rgba(167,139,250,.25);
  animation: portalSpin 30s linear infinite;
}
.breathe-phase {
  font-family: 'Playfair Display', serif; font-size: 1.5rem; font-weight: 800;
  color: #ede9fe; text-align: center; min-height: 2.2rem;
  transition: opacity .5s;
}
.breathe-count { font-family: var(--mono); font-size: .85rem; color: var(--ta); text-align: center; }
.breathe-hint { font-size: .68rem; color: var(--t3); text-align: center; max-width: 260px; line-height: 1.6; }
.breathe-close {
  position: absolute; top: calc(var(--st) + 18px); right: 18px;
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255,255,255,.06); color: var(--t2);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--bd);
}
.breathe-cycles { display: flex; gap: 7px; }
.breathe-cycle-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(148,163,184,.18); transition: all var(--tn);
}
.breathe-cycle-dot.done { background: var(--pl); box-shadow: 0 0 8px rgba(167,139,250,.6); }

/* ═══ HISTORY SEARCH + FILTERS ═══ */
.hist-tools { margin-bottom: 14px; }
.hist-search {
  display: flex; align-items: center; gap: 10px;
  background: var(--gc); border: 1px solid var(--bd); border-radius: var(--rl);
  padding: 10px 14px; margin-bottom: 10px;
  transition: border-color var(--tn), box-shadow var(--tn);
}
.hist-search:focus-within { border-color: var(--bda); box-shadow: 0 0 0 3px rgba(124,58,237,.12); }
.hist-search i { color: var(--t3); font-size: .8rem; }
.hist-search input {
  flex: 1; background: none; border: none; outline: none; font-size: .85rem; min-width: 0;
}
.hist-search input::placeholder { color: var(--t3); }
.hist-filters { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.hist-filters::-webkit-scrollbar { display: none; }
.hist-filter-chip {
  flex-shrink: 0; padding: 6px 14px; border-radius: 99px;
  font-size: .66rem; font-weight: 700; white-space: nowrap;
  background: rgba(255,255,255,.03); color: var(--t2); border: 1px solid var(--bd);
  transition: all var(--tf);
}
.hist-filter-chip.active {
  background: rgba(124,58,237,.16); color: var(--ta); border-color: rgba(124,58,237,.4);
  box-shadow: 0 0 14px rgba(124,58,237,.12);
}

/* ═══ SECTION HEADING v10 accent ═══ */
.section-heading { position: relative; }

/* ═══ RESULTS: reading number chip ═══ */
.res-reading-num {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: .6rem; font-weight: 700; letter-spacing: 1px;
  color: var(--t3); background: rgba(255,255,255,.03); border: 1px solid var(--bd);
  padding: 3px 10px; border-radius: 99px; margin-bottom: 10px;
}

/* ═══ ZEN FLOATING BUTTON in home ═══ */
.zen-banner {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, rgba(6,182,212,.09), rgba(8,8,32,.9) 60%);
  border: 1px solid rgba(6,182,212,.2); border-radius: var(--rx);
  padding: 14px 16px; margin: 1.2rem 0; cursor: pointer;
  transition: transform var(--tn), border-color var(--tn), box-shadow var(--tn);
}
.zen-banner:hover { transform: translateY(-2px); border-color: rgba(6,182,212,.45); box-shadow: 0 8px 28px rgba(6,182,212,.12); }
.zen-banner-icon {
  font-size: 1.9rem; flex-shrink: 0;
  animation: zenFloat 4s ease-in-out infinite;
}
@keyframes zenFloat { 50% { transform: translateY(-4px); } }
.zen-banner-info { flex: 1; min-width: 0; }
.zen-banner-title { font-size: .85rem; font-weight: 800; color: #a5f3fc; }
.zen-banner-sub { font-size: .65rem; color: var(--t2); margin-top: 2px; }
.zen-banner-arrow { color: rgba(165,243,252,.5); font-size: .8rem; }
html[dir="rtl"] .zen-banner-arrow { transform: scaleX(-1); }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 360px) {
  .ach-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .ach-grid { grid-template-columns: repeat(6, 1fr); }
}

/* ═══ REDUCED MOTION ═══ */
@media (prefers-reduced-motion: reduce) {
  .breathe-orb { transition-duration: .2s !important; }
}
