/* ============================================================
   HOLO EXPERIENCE — üç etkileşim özelliğinin görünümü
   ------------------------------------------------------------
   Davranış: js/holo_experience.js
     1) ACTIONS HUB (dynamic panel transition)
     2) Stat hover holografik grafiği
     3) Emoji tepkileri + akan ışık şeridi

   Hub ve stat satırı kuralları [data-theme="holo"] ile kapsanır.
   Katman/popover kuralları kapsanmaz — o düğümler yalnızca holo
   çalışırken zaten oluşturuluyor, kapsamak gereksiz özgüllük
   yükü getirirdi.
   ============================================================ */

/* ── 1) ACTIONS HUB — Dynamic Panel Transition ─────────────── */

/* Slot başlığı hub'ın içine alındı (js: _absorbSlotHeading) — dışarıdaki
   orijinal kutu gizlenir, holo dışı temalarda dokunulmadan kalır. */
[data-theme="holo"] .slot-cockpit-header.hh-absorbed { display: none; }

/* Tek sütun: başlık → yatay sekme şeridi → eylem sahnesi. */
[data-theme="holo"] .holo-hub {
  display: block;
  min-height: 0;
}
[data-theme="holo"] .hh-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

[data-theme="holo"] .hh-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--holo-line);
  cursor: pointer;
  transition: border-color .25s;
}
[data-theme="holo"] .holo-hub:hover .hh-head,
[data-theme="holo"] .holo-hub.is-pinned .hh-head { border-color: rgba(63,216,255,0.45); }
/* Kapalıyken "aç" işareti; açılınca ok yukarı döner */
[data-theme="holo"] .hh-caret {
  flex: none;
  color: var(--clr-primary);
  font-size: 0.8rem;
  line-height: 1;
  transition: transform .28s cubic-bezier(.2,.7,.3,1), opacity .2s;
  opacity: 0.7;
}
[data-theme="holo"] .holo-hub:hover .hh-caret,
[data-theme="holo"] .holo-hub.is-pinned .hh-caret,
[data-theme="holo"] .holo-hub:focus-within .hh-caret {
  transform: rotate(180deg);
  opacity: 1;
}

/* ── Açılır panel ──────────────────────────────────────────────
   Sekmeler + eylem sahnesi varsayılan olarak KAPALI; sadece başlık
   satırı görünüyor. Hub'ın (başlık ya da açılan panelin) üzerine
   gelince aşağı doğru açılıyor — akışta kaldığı için altındaki
   içeriği aşağı kaydırır, üstüne binmez. Fare panelin üzerindeyken
   hub'ın içinde olduğu için panel açık kalır. */
[data-theme="holo"] .hh-drop {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-6px);
  pointer-events: none;
  transition: max-height .3s cubic-bezier(.2,.7,.3,1),
              opacity .22s ease,
              transform .3s cubic-bezier(.2,.7,.3,1),
              margin-top .3s cubic-bezier(.2,.7,.3,1);
  margin-top: 0;
}
[data-theme="holo"] .holo-hub:hover .hh-drop,
[data-theme="holo"] .holo-hub:focus-within .hh-drop,
[data-theme="holo"] .holo-hub.is-pinned .hh-drop {
  /* Sahne 268px ızgara + dolgu + sekme şeridi; tavan cömert tutuldu ki
     kart sayısı arttığında içerik kırpılmasın. */
  max-height: 520px;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  margin-top: 10px;
}
[data-theme="holo"] .hh-head-txt { min-width: 0; }
[data-theme="holo"] .hh-eyebrow {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--clr-primary);
  text-shadow: 0 0 14px rgba(63,216,255,0.55);
}
[data-theme="holo"] .hh-heading {
  margin: 3px 0 0;
  font-size: 1.06rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--clr-text);
}
[data-theme="holo"] .hh-count {
  flex: none;
  font-size: 0.66rem;
  color: var(--clr-text-dim);
  letter-spacing: 0.08em;
}
[data-theme="holo"] .hh-empty {
  padding: 18px;
  font-size: 0.78rem;
  color: var(--clr-text-dim);
  background: var(--holo-glass);
  border: 1px solid var(--holo-line);
  border-radius: var(--radius);
}

/* Sekme şeridi — "Ana Eylemler / İkincil / Sosyal", açılır panelin en üstünde
   yatay tek sıra. Sekmeler KÜÇÜLTÜLMÜYOR: etiketleriyle tam boy duruyorlar;
   gizlenmeleri zaten panelin kapalı olmasıyla sağlanıyor. */
[data-theme="holo"] .hh-rail {
  flex: none;
  margin-bottom: 10px;
}
[data-theme="holo"] .hh-tabs {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  width: max-content;
  max-width: 100%;
  padding: 5px 7px;
  border-radius: 999px;
  border: 1px solid var(--holo-line);
  background: var(--holo-glass);
  backdrop-filter: blur(var(--holo-blur)) saturate(1.2);
  -webkit-backdrop-filter: blur(var(--holo-blur)) saturate(1.2);
  box-shadow: inset 0 1px 0 rgba(63,216,255,0.14), 0 8px 26px rgba(0,0,0,0.3);
}
[data-theme="holo"] .hh-tab-label,
[data-theme="holo"] .hh-tab-n { white-space: nowrap; }
[data-theme="holo"] .hh-tab {
  position: relative;
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--clr-text-muted);
  font-size: 0.74rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: color .2s, border-color .2s, box-shadow .25s, background .2s;
}
[data-theme="holo"] .hh-tab:hover {
  color: var(--clr-text);
  border-color: rgba(63,216,255,0.3);
  background: rgba(63,216,255,0.05);
}
[data-theme="holo"] .hh-tab.is-active {
  color: var(--clr-text);
  border-color: rgba(63,216,255,0.5);
  background: rgba(63,216,255,0.10);
  box-shadow: inset 0 0 22px rgba(63,216,255,0.14);
}
/* Aktif sekmenin altındaki ışık çizgisi (yatay sırada alt kenar) */
[data-theme="holo"] .hh-tab::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--clr-primary);
  box-shadow: 0 0 12px var(--holo-glow);
  transform: translateX(-50%);
  transition: width .25s ease;
}
[data-theme="holo"] .hh-tab.is-active::before { width: 16px; }
[data-theme="holo"] .hh-tab-icon { font-size: 0.85rem; line-height: 1; }
[data-theme="holo"] .hh-tab-label { text-overflow: ellipsis; }
[data-theme="holo"] .hh-tab-n {
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(63,216,255,0.14);
  color: var(--clr-primary);
  font-size: 0.64rem;
  text-align: center;
}

/* Aktif sekmenin dönen ışık halkası */
[data-theme="holo"] .hh-tab-ring {
  position: absolute;
  inset: -1px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  background: conic-gradient(from 0deg, transparent 0 62%, rgba(63,216,255,0.75) 78%, transparent 92%);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  padding: 1px;
  transition: opacity .3s;
}
/* Halka SÜREKLİ dönmüyor: panel kapalıyken zaten görünmüyor. Panel
   açıldığında seçili sekmede başlar, ayrıca üzerine gelinen sekmede de
   görünür — sabit bir arka plan hareketi değil, ilgiye cevap veren işaret. */
[data-theme="holo"] .holo-hub:hover .hh-tab.is-active .hh-tab-ring,
[data-theme="holo"] .holo-hub.is-pinned .hh-tab.is-active .hh-tab-ring,
[data-theme="holo"] .hh-tabs:focus-within .hh-tab.is-active .hh-tab-ring,
[data-theme="holo"] .hh-tab:hover .hh-tab-ring,
[data-theme="holo"] .hh-tab:focus-visible .hh-tab-ring {
  opacity: 1;
  animation: hh-ring 3.4s linear infinite;
}
@keyframes hh-ring { to { transform: rotate(360deg); } }

/* Sahne — sabit yükseklik korunur, ızgara içeride kayar.
   (Deste görünümünün var oluş sebebi buydu: konteyner uzamamalı.) */
[data-theme="holo"] .hh-stage {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--holo-line);
  background: var(--holo-glass);
  backdrop-filter: blur(var(--holo-blur)) saturate(1.2);
  -webkit-backdrop-filter: blur(var(--holo-blur)) saturate(1.2);
  box-shadow: inset 0 1px 0 rgba(63,216,255,0.14), 0 10px 40px rgba(0,0,0,0.4);
  padding: 12px;
  min-height: 0;
}
[data-theme="holo"] .hh-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
  max-height: 268px;
  overflow-y: auto;
  padding-right: 4px;
  transition: transform .15s ease, opacity .15s ease;
}
/* Ray dikey olduğu için ızgara da dikeyde kayıyor: aşağıdaki sekmeye
   geçerken eski liste yukarı süzülür, yenisi aşağıdan gelir. */
[data-theme="holo"] .hh-out-l { transform: translateX(-22px); opacity: 0; }
[data-theme="holo"] .hh-out-r { transform: translateX(22px);  opacity: 0; }
[data-theme="holo"] .hh-in-l  { animation: hh-slide-in-l .26s ease-out; }
[data-theme="holo"] .hh-in-r  { animation: hh-slide-in-r .26s ease-out; }
@keyframes hh-slide-in-l {
  from { transform: translateY(-22px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
@keyframes hh-slide-in-r {
  from { transform: translateY(22px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

/* Kart — ikon + başlık + açıklama + çipler (referanstaki hub kartı) */
[data-theme="holo"] .hh-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 11px 12px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--holo-line);
  background:
    linear-gradient(180deg, rgba(63,216,255,0.06), transparent 58%),
    var(--holo-glass-2);
  cursor: pointer;
  overflow: hidden;
  animation: hh-card-in .34s ease-out backwards;
  animation-delay: calc(var(--i, 0) * 28ms);
  transition: border-color .2s, box-shadow .25s, transform .18s;
}
@keyframes hh-card-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

[data-theme="holo"] .hh-card:hover,
[data-theme="holo"] .hh-card:focus-visible {
  border-color: var(--clr-primary);
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px var(--holo-glow), 0 10px 32px rgba(63,216,255,0.24);
  outline: none;
}
[data-theme="holo"] .hh-card.is-locked {
  opacity: 0.45;
  cursor: not-allowed;
}
[data-theme="holo"] .hh-card.is-locked:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--holo-line);
}

/* Kartın üstünden geçen ışık çizgisi (hover'da akar) */
[data-theme="holo"] .hh-card-edge {
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(63,216,255,0.9), transparent);
  opacity: 0;
}
[data-theme="holo"] .hh-card:hover .hh-card-edge {
  opacity: 1;
  animation: hh-edge 1.1s ease-in-out infinite;
}
@keyframes hh-edge {
  from { left: -40%; }
  to   { left: 100%; }
}

[data-theme="holo"] .hh-card-top { display: flex; align-items: center; gap: 8px; }
[data-theme="holo"] .hh-card-icon {
  font-size: 1.05rem;
  filter: drop-shadow(0 0 8px rgba(63,216,255,0.45));
}
[data-theme="holo"] .hh-card-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--clr-text);
  line-height: 1.2;
}
[data-theme="holo"] .hh-card-desc {
  font-size: 0.68rem;
  line-height: 1.42;
  color: var(--clr-text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
[data-theme="holo"] .hh-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: auto;
}
[data-theme="holo"] .hh-chip {
  font-size: 0.6rem;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid transparent;
  white-space: nowrap;
}
[data-theme="holo"] .hh-chip-cost {
  background: rgba(255,95,126,0.12);
  border-color: rgba(255,95,126,0.28);
  color: #ffb3c1;
}
[data-theme="holo"] .hh-chip-reward {
  background: rgba(63,240,212,0.12);
  border-color: rgba(63,240,212,0.28);
  color: #8ff5e3;
}
[data-theme="holo"] .hh-chip-time {
  background: rgba(63,216,255,0.10);
  border-color: rgba(63,216,255,0.26);
  color: #9fe3ff;
}

[data-theme="holo"] .hh-card-lock,
[data-theme="holo"] .hh-card-group {
  position: absolute;
  top: 8px;
  right: 9px;
  font-size: 0.62rem;
}
[data-theme="holo"] .hh-card-group { color: #9fe3ff; }

/* ── 2) STAT VISUALIZATION — hover holografik grafik ────────── */

[data-theme="holo"] #stats-list .stat-row {
  cursor: help;
  border-radius: 8px;
  transition: background .18s;
}
[data-theme="holo"] #stats-list .stat-row:hover {
  background: rgba(63,216,255,0.07);
}

.holo-viz-pop {
  position: fixed;
  z-index: 1200;
  width: 480px;
  max-width: calc(100vw - 20px);
  opacity: 0;
  transform: translateX(-8px) scale(0.98);
  transition: opacity .18s ease, transform .18s ease;
}
.holo-viz-pop.is-left { transform: translateX(8px) scale(0.98); }
.holo-viz-pop.is-open { opacity: 1; transform: none; }

.holo-viz-pop .holo-viz {
  position: relative;
  padding: 14px 16px 13px;
  border-radius: 16px;
  border: 1px solid rgba(63,216,255,0.34);
  background: rgba(8,18,32,0.90);
  backdrop-filter: blur(22px) saturate(1.3);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  box-shadow:
    0 24px 70px rgba(0,0,0,0.62),
    0 0 0 1px rgba(63,216,255,0.10),
    inset 0 1px 0 rgba(63,216,255,0.22);
  color: #e8f6ff;
}

.holo-viz .hv-head {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-bottom: 9px;
}
.holo-viz .hv-eyebrow {
  font-size: 0.56rem;
  letter-spacing: 0.24em;
  font-weight: 700;
  color: #3fd8ff;
  text-shadow: 0 0 12px rgba(63,216,255,0.6);
}
.holo-viz .hv-title { font-size: 0.98rem; font-weight: 700; }

.holo-viz .hv-figs { display: flex; gap: 8px; margin-bottom: 9px; }
.holo-viz .hv-fig {
  flex: 1;
  padding: 7px 9px;
  border-radius: 10px;
  border: 1px solid rgba(63,216,255,0.18);
  background: rgba(16,32,54,0.6);
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.holo-viz .hv-fig-proj {
  border-color: rgba(63,240,212,0.32);
  background: rgba(63,240,212,0.08);
}
.holo-viz .hv-fig-n { font-size: 1.02rem; font-weight: 700; line-height: 1; }
.holo-viz .hv-fig-l {
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  color: #8fb4cf;
  text-transform: uppercase;
}

.holo-viz .hv-chart { position: relative; margin: 2px 0 8px; }
.holo-viz .hv-svg { width: 100%; height: 168px; display: block; overflow: visible; }
.holo-viz .hv-grid { stroke: rgba(63,216,255,0.10); stroke-width: 1; }
.holo-viz .hv-line {
  fill: none;
  stroke: #3fd8ff;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 8px rgba(63,216,255,0.7));
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: hv-draw 900ms ease-out forwards;
}
@keyframes hv-draw { to { stroke-dashoffset: 0; } }
.holo-viz .hv-band {
  stroke: none;
  opacity: 0;
  animation: hv-fade 700ms 380ms ease-out forwards;
}
@keyframes hv-fade { to { opacity: 1; } }
.holo-viz .hv-now { fill: #ffffff; stroke: #3fd8ff; stroke-width: 2; }
.holo-viz .hv-peak {
  fill: #9d7bff;
  stroke: #dcd0ff;
  stroke-width: 2;
  filter: drop-shadow(0 0 10px rgba(157,123,255,0.85));
}
.holo-viz .hv-peak-stem {
  stroke: rgba(157,123,255,0.55);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}
.holo-viz .hv-peak-tag {
  position: absolute;
  transform: translateX(-50%);
  font-size: 0.6rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(157,123,255,0.18);
  border: 1px solid rgba(157,123,255,0.45);
  color: #dcd0ff;
  white-space: nowrap;
}

.holo-viz .hv-meter {
  height: 5px;
  border-radius: 999px;
  background: rgba(63,216,255,0.10);
  overflow: hidden;
  margin-bottom: 11px;
}
.holo-viz .hv-meter-fill {
  height: 100%;
  background: linear-gradient(90deg, #2bb8e8, #3fd8ff 60%, #7ee7ff);
  box-shadow: 0 0 10px rgba(63,216,255,0.5);
}

.holo-viz .hv-src-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8fb4cf;
  margin-bottom: 5px;
}
.holo-viz .hv-srcs { display: flex; flex-direction: column; gap: 3px; }
.holo-viz .hv-src {
  display: grid;
  grid-template-columns: 18px 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(16,32,54,0.55);
  border: 1px solid transparent;
  font-size: 0.7rem;
}
.holo-viz .hv-src.is-best {
  border-color: rgba(63,240,212,0.4);
  background: rgba(63,240,212,0.08);
}
.holo-viz .hv-src.is-locked { opacity: 0.45; }
.holo-viz .hv-src-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.holo-viz .hv-src-en {
  font-size: 0.62rem;
  color: #9fe3ff;
  min-width: 26px;
  text-align: right;
}
.holo-viz .hv-src-gain { font-weight: 700; color: #8ff5e3; }
.holo-viz .hv-none { font-size: 0.7rem; color: #8fb4cf; padding: 6px 2px; }
.holo-viz .hv-note {
  margin-top: 9px;
  font-size: 0.58rem;
  line-height: 1.5;
  color: #7396b3;
}

/* ── 3) REAL-TIME FEEDBACK — emoji + ışık şeridi ────────────── */

#holo-fx-layer {
  position: fixed;
  inset: 0;
  z-index: 1100;
  pointer-events: none;
  overflow: hidden;
}

.holo-emoji {
  position: absolute;
  font-size: 1.5rem;
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
  animation: holo-emoji-fly 1.8s cubic-bezier(.22,.7,.3,1) forwards;
  filter: drop-shadow(0 0 12px rgba(63,216,255,0.6));
}
@keyframes holo-emoji-fly {
  0%   { opacity: 0; transform: translate(-50%,-50%) scale(0.5); }
  18%  { opacity: 1; transform: translate(-50%,-50%) scale(1.15); }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, -140px)))
               scale(0.95) rotate(var(--rot, 0deg));
  }
}

.holo-ribbon {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transition: opacity .55s ease;
}
.holo-ribbon path {
  fill: none;
  stroke: #3fd8ff;
  stroke-width: 2.2;
  stroke-linecap: round;
  filter: drop-shadow(0 0 10px rgba(63,216,255,0.85));
  opacity: 0.85;
}
.holo-ribbon.is-fading { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  [data-theme="holo"] .hh-card,
  [data-theme="holo"] .hh-tab-ring,
  [data-theme="holo"] .hh-card:hover .hh-card-edge,
  .holo-viz .hv-line,
  .holo-viz .hv-band { animation: none; }
  /* Panel açılışı animasyonsuz — ama açılmayı kapatmıyoruz, hover'da
     içerik yine görünür olmalı. */
  [data-theme="holo"] .hh-drop,
  [data-theme="holo"] .hh-caret { transition: none; }
  .holo-viz .hv-line { stroke-dashoffset: 0; }
  .holo-viz .hv-band { opacity: 1; }
}

@media (max-width: 900px) {
  [data-theme="holo"] .hh-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    max-height: 240px;
  }
  /* Dokunmatikte hover yok: panel varsayılan olarak AÇIK gelir; başlığa
     dokunmak `is-pinned` ile kapatıp açar (JS'teki toggle). */
  [data-theme="holo"] .hh-drop {
    max-height: 520px;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    margin-top: 10px;
  }
  [data-theme="holo"] .holo-hub.is-pinned .hh-drop {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    pointer-events: none;
  }
  [data-theme="holo"] .hh-caret { transform: rotate(180deg); }
  [data-theme="holo"] .holo-hub.is-pinned .hh-caret { transform: none; }
  [data-theme="holo"] .hh-tabs {
    flex-wrap: wrap;
    width: auto;
    max-width: none;
    border-radius: var(--radius);
    padding: 8px;
  }
  [data-theme="holo"] .hh-tab { padding: 8px 12px; }
  .holo-viz-pop { width: calc(100vw - 20px); }
}
