/* ============================================================
   HOLO MODE — وضع الهولوجرام اللمسي
   "El Hassan Studio" — شاشة زجاجية متوهجة بألوان السماوي
   ============================================================ */

/* ---------- Vars (self-contained, sky single accent) ---------- */
#holoMode {
  --holo-bg: #020617;
  --holo-panel: rgba(8, 47, 73, 0.28);
  --holo-panel-strong: rgba(2, 6, 23, 0.72);
  --holo-border: rgba(14, 165, 233, 0.45);   /* sky-500 */
  --holo-border-strong: #38BDF8;              /* sky-400 */
  --holo-glow: #38BDF8;                       /* sky-400 */
  --holo-text: #E0F2FE;                       /* sky-100 */
  --holo-text-dim: #38BDF8;
  --holo-text-muted: rgba(186, 230, 253, 0.55);
  --holo-grid: rgba(56, 189, 248, 0.14);
  --holo-accent: #0EA5E9;                     /* sky-500 */
}

/* ---------- Fullscreen layer ---------- */
.holomode {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(14, 165, 233, 0.14), transparent 60%),
    radial-gradient(900px 700px at 85% 110%, rgba(56, 189, 248, 0.10), transparent 60%),
    var(--holo-bg);
  color: var(--holo-text);
  font-family: var(--font-arabic);
  overflow: hidden;
  touch-action: none;
  display: none;
  opacity: 0;
  transition: opacity 0.45s ease;
}
.holomode.holo-on { display: block; opacity: 1; }

/* holographic perspective grid floor */
.holo-grid {
  position: absolute;
  left: -25%;
  right: -25%;
  bottom: -30%;
  height: 55%;
  background-image:
    linear-gradient(rgba(14, 165, 233, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 165, 233, 0.22) 1px, transparent 1px);
  background-size: 44px 44px;
  transform: perspective(460px) rotateX(62deg);
  transform-origin: center top;
  -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 1), transparent 78%);
  mask-image: linear-gradient(to top, rgba(0, 0, 0, 1), transparent 78%);
  animation: holoGridMove 5s linear infinite;
  pointer-events: none;
}
@keyframes holoGridMove { from { background-position: 0 0; } to { background-position: 0 44px; } }

/* floating lintels / particles */
.holo-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.holo-particle {
  position: absolute;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--holo-glow);
  opacity: 0;
  box-shadow: 0 0 6px 1px rgba(56, 189, 248, 0.7);
  animation: holoFloat linear infinite;
}
@keyframes holoFloat {
  0%   { transform: translateY(105vh) translateX(0); opacity: 0; }
  12%  { opacity: .9; }
  88%  { opacity: .9; }
  100% { transform: translateY(-8vh) translateX(18px); opacity: 0; }
}

/* scanline sweep */
.holo-scan {
  position: absolute;
  left: 0; right: 0;
  height: 120px;
  background: linear-gradient(to bottom, transparent, rgba(56, 189, 248, 0.10), rgba(56, 189, 248, 0.22), rgba(56, 189, 248, 0.10), transparent);
  animation: holoScan 6s linear infinite;
  pointer-events: none;
}
@keyframes holoScan { 0% { top: -15%; } 100% { top: 115%; } }

/* subtle CRT scanlines overlay */
.holo-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(56, 189, 248, 0.035) 2px 4px);
  pointer-events: none;
  mix-blend-mode: screen;
}

/* header brand pill */
.holo-brand {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 22px;
  border: 1px solid var(--holo-border);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.14), rgba(2, 6, 23, 0.35));
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.25), inset 0 0 16px rgba(56, 189, 248, 0.12);
  letter-spacing: 1px;
  backdrop-filter: blur(6px);
  font-size: 13px;
  font-weight: 600;
  color: var(--holo-text);
  white-space: nowrap;
}
.holo-brand small {
  color: var(--holo-text-muted);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
}

/* close + speaker chips */
.holo-chip {
  position: absolute;
  top: 22px;
  width: 44px; height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--holo-border);
  border-radius: 14px;
  background: rgba(8, 47, 73, 0.35);
  color: var(--holo-text-dim);
  font-size: 19px;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.18), inset 0 0 10px rgba(56, 189, 248, 0.08);
  backdrop-filter: blur(4px);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.holo-chip { z-index: 100; }
.holo-chip:focus-visible { outline: 2px solid var(--holo-glow); outline-offset: 2px; }
.holo-chip:active { transform: scale(0.9); box-shadow: 0 0 6px rgba(56,189,248,0.5); }
.holo-chip-close { right: 22px; }
body[dir="rtl"] .holo-chip-close { right: auto; left: 22px; }

/* swipe hint */
.holo-hint {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--holo-text-muted);
  display: flex;
  gap: 7px;
  align-items: center;
  letter-spacing: 2px;
  animation: holoHintPulse 2.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes holoHintPulse { 0%,100% { opacity: .5; } 50% { opacity: 1; } }

/* dots for slide position */
.holo-dots {
  position: absolute;
  bottom: 66px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}
.holo-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 1px solid var(--holo-border-strong);
  background: transparent;
  box-shadow: 0 0 8px rgba(56,189,248,0.5);
  transition: all 0.25s ease;
}
.holo-dot.active {
  background: var(--holo-glow);
  box-shadow: 0 0 14px 2px rgba(56, 189, 248, 0.8);
  transform: scale(1.15);
}

/* ---------- Stage: vertical stack of glass panels ---------- */
.holo-stage {
  position: absolute;
  inset: 0;
  transform-origin: center;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s ease;
}
.holo-stage .holo-screen { display: none; }
.holo-stage.go { overflow: hidden; }

.holo-screen {
  position: absolute;
  inset: 0;
  padding: 92px 26px 96px;
  display: none;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  touch-action: pan-y;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.holo-screen.is-active { display: flex; }
.holo-screen.is-active { touch-action: none; }

/* three-glass app feel: title strip + content */
.holo-glass {
  border: 1px solid var(--holo-border);
  border-radius: 20px;
  background:
    linear-gradient(150deg, rgba(56, 189, 248, 0.09), rgba(2, 6, 23, 0.25) 60%);
  box-shadow:
    0 0 26px rgba(56, 189, 248, 0.16),
    inset 0 0 24px rgba(56, 189, 248, 0.06);
  backdrop-filter: blur(10px);
  position: relative;
}
.holo-glass::before {  /* top light-catch edge */
  content: "";
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--holo-border-strong), transparent);
  opacity: .7;
}

.holo-tick {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--holo-text-muted);
  display: flex; align-items: center; gap: 7px;
  padding: 6px 14px;
  border: 1px solid rgba(56,189,248,0.2);
  border-radius: 999px;
  width: fit-content;
  background: rgba(8,47,73,0.25);
}
.holo-screen-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--holo-text);
  text-shadow: 0 0 12px rgba(56,189,248,0.5);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* KPI tiles */
.holo-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.holo-kpi {
  padding: 18px 16px;
  border: 1px solid var(--holo-border);
  border-radius: 18px;
  background: linear-gradient(150deg, rgba(56,189,248,0.10), rgba(2,6,23,0.22));
  box-shadow: 0 0 20px rgba(56,189,248,0.14), inset 0 0 18px rgba(56,189,248,0.05);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.holo-kpi:active { transform: scale(0.96); box-shadow: 0 0 10px rgba(56,189,248,0.5); }
.holo-kpi-icon { font-size: 22px; margin-bottom: 8px; display: block; filter: drop-shadow(0 0 5px rgba(56,189,248,0.6)); }
.holo-kpi-label { font-size: 12px; color: var(--holo-text-muted); }
.holo-kpi-value { font-size: 24px; font-weight: 800; color: var(--holo-text); text-shadow: 0 0 14px rgba(56,189,248,0.55); font-variant-numeric: tabular-nums; }
.holo-kpi-delta { font-size: 11px; color: var(--holo-text-dim); }

/* bar chips (mini charts) */
.holo-bars { display: flex; align-items: flex-end; gap: 10px; height: 130px; padding: 14px 6px 0; }
.holo-bar {
  flex: 1;
  min-width: 14px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(to top, rgba(2,6,23,0.3), rgba(56,189,248,0.65));
  box-shadow: 0 0 12px rgba(56,189,248,0.4);
  animation: holoBarIn 0.6s cubic-bezier(0.22,1,0.36,1) backwards;
}
@keyframes holoBarIn { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.holo-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 12px; }

.holo-menu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 14px;
}
.holo-menu-item {
  padding: 22px 14px;
  border: 1px solid var(--holo-border);
  border-radius: 18px;
  background: linear-gradient(150deg, rgba(56,189,248,0.10), rgba(2,6,23,0.22));
  box-shadow: 0 0 18px rgba(56,189,248,0.14), inset 0 0 16px rgba(56,189,248,0.05);
  text-align: center;
  cursor: pointer;
  transition: transform 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}
.holo-menu-item:active { transform: scale(0.95); }
.holo-menu-icon { font-size: 26px; display: block; margin-bottom: 8px; filter: drop-shadow(0 0 6px rgba(56,189,248,0.6)); }
.holo-menu-title { font-size: 13px; font-weight: 700; color: var(--holo-text); }
.holo-menu-sub { font-size: 11px; color: var(--holo-text-muted); margin-top: 3px; }

/* toggle switch (touch) */
.holo-toggle-btn { position: relative; }
.holo-toggle-btn .holo-toggle-label {
  display: inline-block;
  width: 24px; height: 24px;
  line-height: 24px;
  text-align: center;
  border-radius: 8px;
  border: 1px solid var(--brand-accent, #0EA5E9);
  color: var(--brand-accent, #0EA5E9);
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 0 10px rgba(14,165,233,0.35);
  transition: all .2s ease;
}
.holo-toggle-btn:hover .holo-toggle-label,
.holo-toggle-btn.holo-on .holo-toggle-label {
  background: var(--brand-accent, #0EA5E9);
  color: #fff;
}
.holo-toggle-btn.holo-on { color: var(--brand-accent, #0EA5E9); }

/* toggle switch (touch) */
.holo-switch {
  display: flex;
  width: 100%;
  max-width: 130px;
  margin: 0 auto 4px;
  padding: 46px 0;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.holo-switch-track {
  width: 86px; height: 46px;
  border-radius: 999px;
  border: 1px solid var(--holo-border);
  background: rgba(8,47,73,0.3);
  position: relative;
  cursor: pointer;
  box-shadow: inset 0 0 14px rgba(56,189,248,0.12);
  transition: background 0.25s ease;
}
.holo-switch-knob {
  position: absolute;
  top: 4px; left: 4px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #7DD3FC, var(--holo-accent));
  box-shadow: 0 0 14px rgba(56,189,248,0.8);
  transition: transform 0.25s cubic-bezier(0.22,1,0.36,1);
}
.holo-switch-track.on { background: rgba(14,165,233,0.3); }
.holo-switch-track.on .holo-switch-knob { transform: translateX(42px); }

/* spinner / loading */
.holo-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--holo-text-dim);
}
.holo-ring {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 2px solid rgba(56,189,248,0.2);
  border-top-color: var(--holo-glow);
  animation: holoSpin 0.9s linear infinite;
}
@keyframes holoSpin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .holo-grid, .holo-scan, .holo-particles, .holo-hint { animation: none; }
}

/* ---------- screen kicker + title ---------- */
.holo-kicker {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--holo-text-dim);
  margin-top: 4px;
}
.holo-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--holo-text);
  text-shadow: 0 0 16px rgba(56, 189, 248, 0.55);
  margin-bottom: 4px;
}

/* ---------- panels ---------- */
.holo-panel {
  padding: 18px 18px 14px;
}
.holo-panel + .holo-panel { margin-top: 14px; }
.holo-panel-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--holo-text-dim);
  letter-spacing: 0.04em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.holo-muted { color: var(--holo-text-muted); font-size: 12px; }

/* ---------- warning KPI ---------- */
.holo-kpi-warn {
  border-color: rgba(248, 113, 113, 0.6);
  box-shadow: 0 0 22px rgba(248, 113, 113, 0.28), inset 0 0 18px rgba(248, 113, 113, 0.1);
}
.holo-kpi-warn .holo-kpi-value { color: #FCA5A5; text-shadow: 0 0 14px rgba(248, 113, 113, 0.7); }

/* ---------- bar labels + tips ---------- */
.holo-bars {
  position: relative;
  padding-top: 20px;
}
.holo-bar { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.holo-bar-tip {
  position: absolute;
  bottom: calc(100% + 4px);
  font-size: 10px;
  color: var(--holo-text-dim);
  white-space: nowrap;
  transform: rotate(-45deg);
  transform-origin: bottom right;
}
.holo-bar-label {
  font-size: 9px;
  color: var(--holo-text-muted);
  margin-top: 6px;
  text-align: center;
  line-height: 1.15;
  max-width: 70px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- AI insights ---------- */
.holo-insights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}
.holo-insight { padding: 16px 16px 14px; }
.holo-insight.is-warning {
  border-color: rgba(248, 113, 113, 0.55);
  box-shadow: 0 0 20px rgba(248, 113, 113, 0.2), inset 0 0 16px rgba(248, 113, 113, 0.08);
}
.holo-insight-icon { font-size: 24px; margin-bottom: 8px; display: block; filter: drop-shadow(0 0 6px rgba(56,189,248,0.6)); }
.holo-insight-title { font-size: 12px; font-weight: 700; color: var(--holo-text); }
.holo-insight-value { font-size: 20px; font-weight: 800; margin-top: 6px; color: var(--holo-text); text-shadow: 0 0 12px rgba(56,189,248,0.5); }
.holo-insight-type { font-size: 10px; font-weight: 400; color: var(--holo-text-muted); text-shadow: none; }
.holo-insight-detail { font-size: 11px; color: var(--holo-text-muted); margin-top: 6px; line-height: 1.5; }

/* ---------- stat meters ---------- */
.holo-stat { margin-bottom: 12px; }
.holo-stat:last-child { margin-bottom: 0; }
.holo-stat-top { display: flex; justify-content: space-between; align-items: center; font-size: 12px; margin-bottom: 6px; color: var(--holo-text); }
.holo-stat-top b { color: var(--holo-text-dim); }
.holo-meter {
  height: 8px;
  border-radius: 999px;
  background: rgba(8, 47, 73, 0.45);
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.2);
}
.holo-meter span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(56,189,248,0.55), var(--holo-glow));
  box-shadow: 0 0 10px rgba(56,189,248,0.6);
  transition: width 0.6s cubic-bezier(0.22,1,0.36,1);
}
.holo-meter.over span { background: linear-gradient(90deg, rgba(248,113,113,0.6), #F87171); box-shadow: 0 0 10px rgba(248,113,113,0.6); }

/* ---------- budget vs spent ---------- */
.holo-vs { margin-bottom: 14px; }
.holo-vs:last-child { margin-bottom: 0; }
.holo-vs-top { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--holo-text); margin-bottom: 6px; gap: 12px; }
.holo-vs-top b { color: var(--holo-text-dim); white-space: nowrap; }

/* ---------- roles ---------- */
.holo-roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.holo-role { display: flex; justify-content: space-between; align-items: center; font-size: 12px; padding: 8px 10px; border-radius: 10px; background: rgba(8,47,73,0.28); border: 1px solid rgba(56,189,248,0.14); }
.holo-role-name { color: var(--holo-text); }
.holo-role-val { color: var(--holo-text-dim); font-weight: 700; }

/* ---------- list items ---------- */
.holo-list { display: flex; flex-direction: column; gap: 8px; }
.holo-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(8, 47, 73, 0.28);
  border: 1px solid rgba(56, 189, 248, 0.14);
  font-size: 12px;
}
.holo-dot-mini { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--holo-glow); box-shadow: 0 0 8px rgba(56,189,248,0.7); }
.holo-dot-mini[data-st="done"] { background: #34D399; box-shadow: 0 0 8px rgba(52,211,153,0.7); }
.holo-dot-mini[data-st="in_progress"], .holo-dot-mini[data-st="in-progress"] { background: #38BDF8; box-shadow: 0 0 8px rgba(56,189,248,0.7); }
.holo-dot-mini[data-st="pending"], .holo-dot-mini[data-st="review"] { background: #FBBF24; box-shadow: 0 0 8px rgba(251,191,36,0.7); }
.holo-list-title { font-weight: 700; color: var(--holo-text); flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.holo-list-sub { color: var(--holo-text-muted); font-size: 11px; flex: none; max-width: 38%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.holo-list-tag { flex: none; font-size: 11px; font-weight: 700; color: var(--holo-text-dim); border: 1px solid rgba(56,189,248,0.3); border-radius: 8px; padding: 2px 8px; background: rgba(8,47,73,0.3); }

/* ---------- weather stats + impact ---------- */
.holo-wstats { margin-bottom: 4px; }
.holo-impact-text { font-size: 13px; line-height: 1.6; color: var(--holo-text); }
