/* ═══════════════════════════════════════════════════════════════
   VIBRA ORACLE · CSS  — Panel de inteligencia predictiva NERHIA
   ═══════════════════════════════════════════════════════════════ */

/* ── Tab button ─────────────────────────────────────────────── */
#tab-oracle .bn-icon { font-size: 22px; }

/* ── Panel container ────────────────────────────────────────── */
#panel-oracle {
  position: fixed;
  inset: 0;
  background: #0a0a14;
  z-index: 900;
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
}
#panel-oracle.active { display: flex; }

/* ── Header ─────────────────────────────────────────────────── */
.vo-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 52px 20px 16px;
  background: linear-gradient(180deg, #0d0d1f 0%, transparent 100%);
  flex-shrink: 0;
}
.vo-header-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  box-shadow: 0 0 20px rgba(124,58,237,.6);
  animation: vo-pulse-icon 2s ease-in-out infinite;
}
@keyframes vo-pulse-icon {
  0%,100% { box-shadow: 0 0 20px rgba(124,58,237,.6); }
  50%      { box-shadow: 0 0 40px rgba(124,58,237,.9), 0 0 60px rgba(37,99,235,.4); }
}
.vo-header-text h2 {
  margin: 0; font-size: 20px; font-weight: 700;
  background: linear-gradient(90deg, #c084fc, #60a5fa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.vo-header-text p {
  margin: 2px 0 0; font-size: 12px; color: rgba(255,255,255,.45);
}
.vo-header-badge {
  margin-left: auto;
  background: rgba(124,58,237,.2);
  border: 1px solid rgba(124,58,237,.4);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
  color: #c084fc;
  letter-spacing: .5px;
}

/* ── Scrollable body ────────────────────────────────────────── */
.vo-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 100px;
  -webkit-overflow-scrolling: touch;
}
.vo-body::-webkit-scrollbar { display: none; }

/* ── Section title ──────────────────────────────────────────── */
.vo-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,.35);
  text-transform: uppercase;
  margin: 20px 0 10px;
}

/* ── KPI Grid ───────────────────────────────────────────────── */
.vo-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.vo-kpi {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 16px;
  padding: 14px 10px;
  text-align: center;
  transition: transform .2s, box-shadow .2s;
  cursor: default;
}
.vo-kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}
.vo-kpi-emoji { font-size: 20px; margin-bottom: 4px; }
.vo-kpi-value {
  font-size: 22px; font-weight: 800;
  background: linear-gradient(135deg, #fff, rgba(255,255,255,.7));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.vo-kpi-label {
  font-size: 10px; color: rgba(255,255,255,.4);
  margin-top: 2px; letter-spacing: .5px;
}
.vo-kpi-delta {
  font-size: 11px; font-weight: 600; margin-top: 4px;
}
.vo-kpi-delta.up   { color: #4ade80; }
.vo-kpi-delta.down { color: #f87171; }
.vo-kpi-delta.flat { color: rgba(255,255,255,.3); }

/* ── Prediction Cards ───────────────────────────────────────── */
.vo-predictions { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }

.vo-pred-card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 18px;
  padding: 16px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s, border-color .2s;
}
.vo-pred-card:active { transform: scale(.98); }
.vo-pred-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  border-radius: 18px 18px 0 0;
}
.vo-pred-card[data-dept="mobility"]::before { background: linear-gradient(90deg, #3b82f6, #06b6d4); }
.vo-pred-card[data-dept="culture"]::before  { background: linear-gradient(90deg, #ec4899, #f43f5e); }
.vo-pred-card[data-dept="economy"]::before  { background: linear-gradient(90deg, #f59e0b, #f97316); }
.vo-pred-card[data-dept="energy"]::before   { background: linear-gradient(90deg, #10b981, #22c55e); }
.vo-pred-card[data-dept="vitality"]::before { background: linear-gradient(90deg, #ef4444, #f97316); }
.vo-pred-card[data-dept="nerhia"]::before   { background: linear-gradient(90deg, #7c3aed, #2563eb); }

.vo-pred-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.vo-pred-emoji { font-size: 24px; flex-shrink: 0; }
.vo-pred-meta { flex: 1; }
.vo-pred-dept {
  font-size: 11px; font-weight: 600; letter-spacing: .8px;
  text-transform: uppercase; color: rgba(255,255,255,.5);
}
.vo-pred-title { font-size: 14px; font-weight: 700; color: #fff; margin-top: 2px; }
.vo-pred-confidence {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 700; color: #4ade80;
  flex-shrink: 0;
}
.vo-pred-confidence .vo-conf-bar {
  width: 36px; height: 4px;
  background: rgba(255,255,255,.1);
  border-radius: 2px;
  overflow: hidden;
}
.vo-pred-confidence .vo-conf-fill {
  height: 100%;
  border-radius: 2px;
  background: #4ade80;
  transition: width .8s ease;
}

.vo-pred-desc {
  font-size: 13px; color: rgba(255,255,255,.6);
  line-height: 1.5; margin-bottom: 10px;
}

/* Mini chart inside card */
.vo-mini-chart {
  height: 50px;
  position: relative;
  margin-bottom: 8px;
}
.vo-mini-chart canvas { width: 100% !important; }

.vo-pred-footer {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: rgba(255,255,255,.3);
}
.vo-pred-time { margin-left: auto; }

/* ── Forecast Chart ─────────────────────────────────────────── */
.vo-forecast-wrap {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 20px;
}
.vo-forecast-tabs {
  display: flex; gap: 6px; margin-bottom: 14px; overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.vo-forecast-tabs::-webkit-scrollbar { display: none; }
.vo-ftab {
  flex-shrink: 0;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.1);
  background: transparent;
  color: rgba(255,255,255,.4);
  font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all .2s;
}
.vo-ftab.active {
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 12px rgba(124,58,237,.4);
}
.vo-forecast-canvas-wrap { position: relative; height: 160px; }
.vo-forecast-canvas-wrap canvas { width: 100% !important; height: 160px !important; }

/* ── Anomaly Alerts ─────────────────────────────────────────── */
.vo-alerts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.vo-alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  animation: vo-alert-in .4s ease;
}
@keyframes vo-alert-in {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}
.vo-alert.critical  { background: rgba(239,68,68,.1);  border-color: rgba(239,68,68,.25);  }
.vo-alert.warning   { background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.25); }
.vo-alert.info      { background: rgba(96,165,250,.1); border-color: rgba(96,165,250,.25); }
.vo-alert.success   { background: rgba(74,222,128,.1); border-color: rgba(74,222,128,.25); }

.vo-alert-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.vo-alert-body { flex: 1; }
.vo-alert-title { font-size: 13px; font-weight: 600; color: #fff; }
.vo-alert-desc  { font-size: 12px; color: rgba(255,255,255,.5); margin-top: 2px; line-height: 1.4; }
.vo-alert-time  { font-size: 11px; color: rgba(255,255,255,.3); flex-shrink: 0; }

/* ── Oracle Insight (big bottom card) ──────────────────────── */
.vo-insight {
  background: linear-gradient(135deg, rgba(124,58,237,.15), rgba(37,99,235,.1));
  border: 1px solid rgba(124,58,237,.3);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
.vo-insight::after {
  content: '🔮';
  position: absolute;
  right: -10px; top: -10px;
  font-size: 80px;
  opacity: .07;
}
.vo-insight-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: #c084fc; margin-bottom: 8px;
}
.vo-insight-text {
  font-size: 15px; color: rgba(255,255,255,.85); line-height: 1.6;
}
.vo-insight-cta {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 14px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  border-radius: 20px;
  font-size: 13px; font-weight: 600; color: #fff;
  border: none; cursor: pointer;
  box-shadow: 0 4px 16px rgba(124,58,237,.4);
  transition: transform .2s, box-shadow .2s;
}
.vo-insight-cta:active {
  transform: scale(.96);
  box-shadow: 0 2px 8px rgba(124,58,237,.3);
}

/* ── Scanning animation overlay ─────────────────────────────── */
.vo-scanning {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(124,58,237,.05) 50%, transparent 100%);
  animation: vo-scan 3s linear infinite;
  pointer-events: none;
}
@keyframes vo-scan {
  0%   { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

/* ── Responsive tweaks ──────────────────────────────────────── */
@media (max-width: 380px) {
  .vo-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .vo-kpi-value { font-size: 20px; }
}
