/* ════════════════════════════════════════════════════════════════════════
   Live Performance polish — PR-A4 (2026-06-08)

   Kapsam: yalnız /dashboard/canli sayfası.
   1) Header compactness (yüksekliği düşür, üst boşluğu azalt)
   2) Priority Action cards: animated soft glow + premium icon + hover
   3) Reduced motion respect

   Scope: .tm-live-page descendant — diğer sayfaları etkilemez.
   ════════════════════════════════════════════════════════════════════════ */

/* ──────────────────────────────────────────────────────────────────────
   1) HEADER COMPACTNESS
   .tm-live-header gap + .tm-live-stat padding + font-size küçültme
   1440/1280 viewport'ta ATF'ye daha fazla içerik gelsin
   ────────────────────────────────────────────────────────────────────── */
/* Higher specificity zinciri — mevcut .tm-live-stat (specificity 0,1,0)
   ve @media (max-width: 480px) override'larını yenmek için .tm-live-page
   ile zincirleme + !important kritik özelliklerde. */
section.tm-live-page .tm-live-header {
  gap: var(--tm-space-2, 8px) !important;
}
section.tm-live-page .tm-live-pulseline {
  align-items: center;
}
section.tm-live-page .tm-live-pulseline .tm-live-stat {
  padding: 5px var(--tm-space-3, 12px) !important;  /* eski 9px var(--tm-space-4) = 9px 16px */
  gap: 1px !important;
}
section.tm-live-page .tm-live-pulseline .tm-live-stat__label {
  font-size: 9.5px !important;
  letter-spacing: 0.03em !important;
  line-height: 1.1 !important;
}
section.tm-live-page .tm-live-pulseline .tm-live-stat__value {
  font-size: 12.5px !important;
  line-height: 1.2 !important;
  letter-spacing: -0.005em !important;
}
section.tm-live-page .tm-live-header__row {
  gap: 6px !important;
}
section.tm-live-page .tm-live-controls {
  gap: 6px !important;
}

/* Tablet portrait — header dik durumda daha sıkı */
@media (max-width: 720px) {
  section.tm-live-page .tm-live-header {
    gap: 6px !important;
  }
  section.tm-live-page .tm-live-pulseline .tm-live-stat {
    padding: 4px 10px !important;
  }
}

/* ──────────────────────────────────────────────────────────────────────
   2) PRIORITY ACTION CARDS — animated background + premium hover
   ────────────────────────────────────────────────────────────────────── */

/* Soft animated radial glow — ::after pseudo (mevcut ::before severity
   bar'ına dokunmayız). Severity'ye göre renk: critical/warning/oppor/info.
   Default: hafif paper-tinted glow. */
.tm-live-main-grid__sidebar .tm-action-card {
  /* mevcut overflow=visible + position=relative + isolation=isolate korunur */
  --pa-glow-color: rgba(15, 23, 42, 0.04);
  cursor: pointer;
}
.tm-live-main-grid__sidebar .tm-action-card--critical {
  --pa-glow-color: rgba(220, 38, 38, 0.10);
}
.tm-live-main-grid__sidebar .tm-action-card--warning {
  --pa-glow-color: rgba(217, 119, 6, 0.10);
}
.tm-live-main-grid__sidebar .tm-action-card--opportunity {
  --pa-glow-color: rgba(22, 163, 74, 0.10);
}
.tm-live-main-grid__sidebar .tm-action-card--info {
  --pa-glow-color: rgba(2, 132, 199, 0.10);
}

/* ::after animated background — soft radial moving across card.
   pointer-events:none + z-index -1 (kart text üstünde değil altında) */
.tm-live-main-grid__sidebar .tm-action-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(
      120% 80% at var(--pa-glow-x, 30%) var(--pa-glow-y, 20%),
      var(--pa-glow-color) 0%,
      transparent 55%
    );
  opacity: 0.85;
  z-index: 0;
  pointer-events: none;
  animation: pa-glow-drift 12s ease-in-out infinite alternate;
}
/* keep children above the glow */
.tm-live-main-grid__sidebar .tm-action-card > * {
  position: relative;
  z-index: 1;
}

@keyframes pa-glow-drift {
  0%   { --pa-glow-x: 25%;  --pa-glow-y: 18%; opacity: 0.75; }
  50%  { --pa-glow-x: 75%;  --pa-glow-y: 35%; opacity: 0.95; }
  100% { --pa-glow-x: 40%;  --pa-glow-y: 70%; opacity: 0.85; }
}

/* CSS @property — modern tarayıcılarda glow değişkenlerini animasyonla
   yumuşat. Desteklemeyen tarayıcılarda statik renk fallback. */
@property --pa-glow-x {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 30%;
}
@property --pa-glow-y {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 20%;
}

/* ────── Card hover: subtle lift + shadow glow + chevron drift ────── */
.tm-live-main-grid__sidebar .tm-action-card:hover {
  transform: translateY(-2px);
  border-color: var(--pa-rule-strong, color-mix(in srgb, var(--pa-rule, #e2e8f0) 50%, var(--pa-ink, #0f172a) 6%));
  box-shadow:
    0 6px 16px -4px rgba(15, 23, 42, 0.08),
    0 2px 4px -2px rgba(15, 23, 42, 0.04),
    0 0 0 1px color-mix(in srgb, var(--pa-glow-color) 60%, transparent);
}
.tm-live-main-grid__sidebar .tm-action-card:hover::after {
  opacity: 1;
}
/* Severity ::before bar hover'da hafif belirginleşir */
.tm-live-main-grid__sidebar .tm-action-card:hover::before {
  width: 5px;
  box-shadow: 0 0 8px 0 var(--pa-glow-color);
}
/* CTA / chevron hafif sağa kayma */
.tm-live-main-grid__sidebar .tm-action-card:hover .tm-action-card__cta i,
.tm-live-main-grid__sidebar .tm-action-card:hover .tm-action-card__cta svg,
.tm-live-main-grid__sidebar .tm-action-card:hover .tm-action-card__chevron {
  transform: translateX(2px);
  transition: transform 0.18s cubic-bezier(.4,0,.2,1);
}

/* ────── Icon container premium: soft inner border + subtle gradient ────── */
.tm-live-main-grid__sidebar .tm-action-card__icon {
  background-image: linear-gradient(
    135deg,
    color-mix(in srgb, currentColor 6%, transparent) 0%,
    color-mix(in srgb, currentColor 12%, transparent) 100%
  );
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, currentColor 18%, transparent),
    inset 0 1px 0 color-mix(in srgb, #fff 25%, transparent);
  transition:
    transform 0.18s cubic-bezier(.4,0,.2,1),
    box-shadow 0.18s;
}
.tm-live-main-grid__sidebar .tm-action-card:hover .tm-action-card__icon {
  transform: scale(1.05);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, currentColor 30%, transparent),
    inset 0 1px 0 color-mix(in srgb, #fff 35%, transparent),
    0 2px 8px -2px color-mix(in srgb, currentColor 35%, transparent);
}

/* ──────────────────────────────────────────────────────────────────────
   3) DARK MODE adjustments — glow rengi daha yumuşak olsun
   ────────────────────────────────────────────────────────────────────── */
html.dark-mode .tm-live-main-grid__sidebar .tm-action-card {
  --pa-glow-color: rgba(148, 163, 184, 0.08);
}
html.dark-mode .tm-live-main-grid__sidebar .tm-action-card--critical {
  --pa-glow-color: rgba(248, 113, 113, 0.18);
}
html.dark-mode .tm-live-main-grid__sidebar .tm-action-card--warning {
  --pa-glow-color: rgba(251, 146, 60, 0.18);
}
html.dark-mode .tm-live-main-grid__sidebar .tm-action-card--opportunity {
  --pa-glow-color: rgba(74, 222, 128, 0.18);
}
html.dark-mode .tm-live-main-grid__sidebar .tm-action-card--info {
  --pa-glow-color: rgba(56, 189, 248, 0.18);
}

/* ──────────────────────────────────────────────────────────────────────
   4) REDUCED MOTION — animasyonlar tamamen durur
   ────────────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .tm-live-main-grid__sidebar .tm-action-card::after {
    animation: none !important;
  }
  .tm-live-main-grid__sidebar .tm-action-card:hover {
    transform: none !important;
  }
  .tm-live-main-grid__sidebar .tm-action-card:hover .tm-action-card__icon {
    transform: none !important;
  }
  .tm-live-main-grid__sidebar .tm-action-card:hover .tm-action-card__cta i,
  .tm-live-main-grid__sidebar .tm-action-card:hover .tm-action-card__cta svg,
  .tm-live-main-grid__sidebar .tm-action-card:hover .tm-action-card__chevron {
    transform: none !important;
  }
}
