/* ════════════════════════════════════════════════════════════
   🥚 LIMPIAAI v12.0 — TITAN EDITION · HEAVY ARSENAL LAYER
   Photo Quality AI • A/B Compare • Spiritual Journal
   Energy Weather • Biorhythm • Activity Heatmap • Command Palette
   Se carga DESPUÉS de style/premium/celestial/quantum
   ════════════════════════════════════════════════════════════ */

/* ═══ PHOTO QUALITY BADGES (pre-analysis QA) ═══ */
.upload-prev-item { position: relative; }
.qa-badge {
  position: absolute; bottom: 4px; left: 4px; right: 4px;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  font-size: .52rem; font-weight: 800; padding: 3px 6px; border-radius: 8px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  letter-spacing: .3px; text-transform: uppercase;
}
.qa-badge.qa-good { background: rgba(16,185,129,.28); color: #6ee7b7; border: 1px solid rgba(16,185,129,.4); }
.qa-badge.qa-warn { background: rgba(245,158,11,.28); color: #fcd34d; border: 1px solid rgba(245,158,11,.4); }
.qa-badge.qa-bad { background: rgba(239,68,68,.3); color: #fca5a5; border: 1px solid rgba(239,68,68,.45); }
.qa-summary {
  display: flex; align-items: center; gap: 10px;
  background: var(--gc); border: 1px solid var(--bd); border-radius: var(--rl);
  padding: 12px 14px; margin-top: 12px; font-size: .72rem; color: var(--t2);
}
.qa-summary i { font-size: 1rem; }
.qa-summary.qa-s-good i { color: var(--okl); }
.qa-summary.qa-s-warn i { color: var(--warnl); }
.qa-summary strong { color: var(--t1); }

/* ═══ A/B COMPARE MODE ═══ */
.cmp-modal {
  position: fixed; inset: 0; z-index: 9600; display: none; flex-direction: column;
  background: radial-gradient(ellipse at 50% 20%, #0e0b30 0%, #030311 65%);
}
.cmp-modal.on { display: flex; }
.cmp-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--st) + 14px) 18px 12px;
}
.cmp-head h3 { font-family: 'Playfair Display', serif; font-size: 1.05rem; color: #ede9fe; }
.cmp-close {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.06); color: var(--t2); border: 1px solid var(--bd);
  display: flex; align-items: center; justify-content: center;
}
.cmp-body { flex: 1; overflow-y: auto; padding: 0 16px calc(var(--sb) + 20px); }
.cmp-pickers { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; margin-bottom: 16px; }
.cmp-select {
  width: 100%; background: var(--gc); border: 1px solid var(--bd); border-radius: var(--rl);
  color: var(--t1); padding: 11px 12px; font-size: .74rem; font-family: inherit;
  appearance: none; -webkit-appearance: none; outline: none;
  transition: border-color var(--tn);
}
.cmp-select:focus { border-color: var(--bda); }
.cmp-vs {
  font-family: 'Playfair Display', serif; font-weight: 900; font-size: 1rem;
  color: var(--ta); text-shadow: 0 0 14px rgba(167,139,250,.4);
}
.cmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cmp-col {
  background: var(--gc); border: 1px solid var(--bd); border-radius: var(--rx);
  padding: 16px 12px; text-align: center;
}
.cmp-col.winner { border-color: rgba(16,185,129,.4); box-shadow: 0 0 24px rgba(16,185,129,.1); }
.cmp-col-date { font-size: .6rem; color: var(--t3); font-family: var(--mono); margin-bottom: 8px; }
.cmp-col-energy { font-family: var(--mono); font-size: 2rem; font-weight: 800; line-height: 1.1; }
.cmp-col-label { font-size: .68rem; font-weight: 700; margin-top: 4px; }
.cmp-col-syms { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin-top: 10px; }
.cmp-col-syms span { font-size: .95rem; }
.cmp-delta {
  margin: 16px 0; padding: 16px; border-radius: var(--rx); text-align: center;
  background: linear-gradient(140deg, rgba(124,58,237,.1), rgba(8,8,32,.9) 60%);
  border: 1px solid rgba(124,58,237,.22);
}
.cmp-delta-val { font-family: var(--mono); font-size: 1.7rem; font-weight: 800; }
.cmp-delta-val.up { color: #34d399; }
.cmp-delta-val.down { color: #f87171; }
.cmp-delta-val.same { color: var(--t2); }
.cmp-delta-msg { font-size: .74rem; color: var(--t2); margin-top: 6px; line-height: 1.55; }
.cmp-bars { margin-top: 14px; }
.cmp-bar-row { display: grid; grid-template-columns: 34px 1fr 1fr; gap: 8px; align-items: center; margin-bottom: 8px; }
.cmp-bar-label { font-size: .58rem; color: var(--t3); text-align: center; }
.cmp-bar-track { height: 8px; border-radius: 99px; background: rgba(148,163,184,.1); overflow: hidden; }
.cmp-bar-track .fillA { height: 100%; background: linear-gradient(90deg, #7c3aed, #3b82f6); border-radius: 99px; float: right; }
.cmp-bar-track .fillB { height: 100%; background: linear-gradient(90deg, #06b6d4, #10b981); border-radius: 99px; }
.cmp-empty { text-align: center; padding: 3rem 1rem; color: var(--t3); font-size: .8rem; }

/* ═══ SPIRITUAL JOURNAL ═══ */
.journal-modal {
  position: fixed; inset: 0; z-index: 9600; display: none;
  align-items: flex-end; justify-content: center;
}
.journal-modal.on { display: flex; }
.journal-backdrop { position: absolute; inset: 0; background: rgba(2,2,12,.8); backdrop-filter: blur(8px); }
.journal-content {
  position: relative; z-index: 1; width: 100%; max-width: var(--appw, 480px);
  background: linear-gradient(170deg, #14103a, #060618);
  border: 1px solid rgba(167,139,250,.2); border-radius: var(--rx) var(--rx) 0 0;
  padding: 20px 18px calc(var(--sb) + 20px); max-height: 84vh; overflow-y: auto;
  animation: journalUp .45s cubic-bezier(.16,1,.3,1);
}
@keyframes journalUp { from { transform: translateY(60px); opacity: 0; } }
.journal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.journal-head h3 { font-family: 'Playfair Display', serif; font-size: 1.02rem; color: #ede9fe; }
.journal-mood-row { display: flex; gap: 8px; justify-content: center; margin-bottom: 14px; }
.journal-mood {
  width: 46px; height: 46px; border-radius: 50%; font-size: 1.35rem;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.03); border: 2px solid transparent;
  transition: all var(--tn); filter: grayscale(.6); opacity: .7;
}
.journal-mood:hover { transform: scale(1.1); filter: none; opacity: 1; }
.journal-mood.sel {
  border-color: var(--pl); filter: none; opacity: 1; transform: scale(1.12);
  box-shadow: 0 0 18px rgba(167,139,250,.3);
}
.journal-textarea {
  width: 100%; min-height: 110px; resize: vertical;
  background: rgba(255,255,255,.03); border: 1px solid var(--bd); border-radius: var(--rl);
  color: var(--t1); padding: 12px 14px; font-family: inherit; font-size: .84rem; line-height: 1.6;
  outline: none; transition: border-color var(--tn);
}
.journal-textarea:focus { border-color: var(--bda); }
.journal-textarea::placeholder { color: var(--t3); }
.journal-save { margin-top: 12px; }
/* Journal entries in history view */
.journal-entry {
  display: flex; gap: 12px; align-items: flex-start;
  background: rgba(255,255,255,.02); border: 1px solid var(--bd); border-radius: var(--rl);
  padding: 12px 14px; margin-top: 10px;
}
.journal-entry-mood { font-size: 1.4rem; flex-shrink: 0; }
.journal-entry-text { font-size: .74rem; color: var(--t2); line-height: 1.6; font-style: italic; }
.journal-entry-date { font-size: .56rem; color: var(--t3); font-family: var(--mono); margin-top: 4px; }
.journal-hint-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 99px; font-size: .72rem; font-weight: 800;
  background: rgba(167,139,250,.1); color: var(--ta); border: 1px solid rgba(167,139,250,.28);
  transition: all var(--tn); margin-top: 10px;
}
.journal-hint-btn:hover { border-color: rgba(167,139,250,.55); box-shadow: 0 0 18px rgba(167,139,250,.15); }

/* ═══ ENERGY WEATHER FORECAST (Home) ═══ */
.weather-card {
  background: var(--gc); border: 1px solid var(--bd); border-radius: var(--rx);
  padding: 16px; margin: 1.2rem 0; position: relative; overflow: hidden;
  backdrop-filter: blur(16px);
}
.weather-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, #f59e0b, #7c3aed, #06b6d4); opacity: .55;
}
.weather-title { display: flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 800; margin-bottom: 12px; }
.weather-title i { color: var(--warnl); }
.weather-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.weather-day {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 2px; border-radius: 12px; transition: all var(--tf);
}
.weather-day.today { background: rgba(124,58,237,.12); border: 1px solid rgba(124,58,237,.3); }
.weather-day-name { font-size: .52rem; font-weight: 800; text-transform: uppercase; color: var(--t3); letter-spacing: .5px; }
.weather-day-icon { font-size: 1.15rem; line-height: 1.2; }
.weather-day-pct { font-family: var(--mono); font-size: .55rem; font-weight: 700; color: var(--ta); }
.weather-desc { font-size: .66rem; color: var(--t2); margin-top: 10px; line-height: 1.55; text-align: center; }

/* ═══ BIORHYTHM WAVES (History) ═══ */
.bio-card {
  background: var(--gc); border: 1px solid var(--bd); border-radius: var(--rx);
  padding: 18px 16px 12px; margin-bottom: 16px; backdrop-filter: blur(16px);
}
.bio-title { display: flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 800; margin-bottom: 4px; }
.bio-title i { color: #f472b6; }
.bio-sub { font-size: .62rem; color: var(--t3); margin-bottom: 10px; }
.bio-svg { width: 100%; height: auto; display: block; }
.bio-legend { display: flex; justify-content: center; gap: 14px; margin-top: 8px; font-size: .6rem; }
.bio-leg { display: flex; align-items: center; gap: 5px; color: var(--t2); font-weight: 600; }
.bio-leg .dot { width: 8px; height: 8px; border-radius: 50%; }

/* ═══ ACTIVITY HEATMAP (GitHub-style, History) ═══ */
.heat-card {
  background: var(--gc); border: 1px solid var(--bd); border-radius: var(--rx);
  padding: 18px 16px 14px; margin-bottom: 16px; backdrop-filter: blur(16px);
}
.heat-title { display: flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 800; margin-bottom: 12px; }
.heat-title i { color: var(--okl); }
.heat-grid-wrap { overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.heat-grid-wrap::-webkit-scrollbar { display: none; }
.heat-grid { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 12px); gap: 3px; width: max-content; }
.heat-cell {
  width: 12px; height: 12px; border-radius: 3px;
  background: rgba(148,163,184,.08); transition: transform var(--tf);
}
.heat-cell:hover { transform: scale(1.35); }
.heat-cell.h1 { background: rgba(124,58,237,.3); }
.heat-cell.h2 { background: rgba(124,58,237,.55); }
.heat-cell.h3 { background: rgba(167,139,250,.85); box-shadow: 0 0 6px rgba(167,139,250,.4); }
.heat-legend { display: flex; align-items: center; gap: 5px; justify-content: flex-end; margin-top: 8px; font-size: .56rem; color: var(--t3); }
.heat-legend .heat-cell { cursor: default; }
.heat-legend .heat-cell:hover { transform: none; }

/* ═══ COMMAND PALETTE (Spotlight-style) ═══ */
.cmdk-modal {
  position: fixed; inset: 0; z-index: 9900; display: none;
  align-items: flex-start; justify-content: center; padding: 12vh 16px 16px;
}
.cmdk-modal.on { display: flex; }
.cmdk-backdrop { position: absolute; inset: 0; background: rgba(2,2,12,.7); backdrop-filter: blur(6px); }
.cmdk-box {
  position: relative; z-index: 1; width: 100%; max-width: 460px;
  background: linear-gradient(165deg, #16123a, #070718);
  border: 1px solid rgba(167,139,250,.28); border-radius: var(--rx);
  overflow: hidden; box-shadow: 0 24px 90px rgba(0,0,0,.7), 0 0 50px rgba(124,58,237,.12);
  animation: modalPop .35s cubic-bezier(.16,1,.3,1);
}
.cmdk-input-row { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--bd); }
.cmdk-input-row i { color: var(--pl); font-size: .85rem; }
.cmdk-input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--t1); font-size: .95rem; font-family: inherit;
}
.cmdk-input::placeholder { color: var(--t3); }
.cmdk-kbd {
  font-family: var(--mono); font-size: .55rem; color: var(--t3);
  background: rgba(255,255,255,.05); border: 1px solid var(--bd);
  padding: 2px 7px; border-radius: 6px;
}
.cmdk-list { max-height: 320px; overflow-y: auto; padding: 6px; }
.cmdk-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 12px; border-radius: 12px; text-align: left;
  font-size: .82rem; color: var(--t1); transition: background var(--tf);
}
.cmdk-item .ck-icon { font-size: 1.05rem; width: 26px; text-align: center; flex-shrink: 0; }
.cmdk-item .ck-label { flex: 1; font-weight: 600; }
.cmdk-item .ck-hint { font-size: .58rem; color: var(--t3); font-family: var(--mono); }
.cmdk-item:hover, .cmdk-item.sel { background: rgba(124,58,237,.14); }
.cmdk-item.sel { box-shadow: inset 0 0 0 1px rgba(124,58,237,.3); }
.cmdk-empty { text-align: center; padding: 2rem 1rem; color: var(--t3); font-size: .76rem; }

/* Header cmdk trigger (desktop) */
.hdr-cmdk {
  display: none; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 99px; font-size: .66rem; color: var(--t3);
  background: rgba(255,255,255,.03); border: 1px solid var(--bd);
  transition: all var(--tn);
}
.hdr-cmdk:hover { border-color: var(--bda); color: var(--ta); }
@media (min-width: 720px) { .hdr-cmdk { display: inline-flex; } }

/* ═══ RESULTS: compare CTA in history ═══ */
.hist-cmp-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 11px; border-radius: var(--rl); margin-bottom: 12px;
  font-size: .74rem; font-weight: 800;
  background: rgba(6,182,212,.08); color: #67e8f9; border: 1px dashed rgba(6,182,212,.35);
  transition: all var(--tn);
}
.hist-cmp-btn:hover { border-style: solid; box-shadow: 0 0 18px rgba(6,182,212,.12); }

/* ═══ RESPONSIVE / MOTION ═══ */
@media (max-width: 340px) {
  .weather-row { grid-template-columns: repeat(4, 1fr); }
  .weather-day:nth-child(n+5) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .journal-content { animation-duration: .01ms !important; }
}
