/* Zoka TacticalPad Pro - Black & Orange Studio Theme */
:root {
  --tactical-bg: #09090b;
  --tactical-panel: rgba(18, 18, 21, 0.96);
  --tactical-border: rgba(255, 255, 255, 0.1);
  --tactical-neon: #EF4427;
  --tactical-cyan: #FF6548;
  --tactical-coral: #EF4427;
  --tactical-gold: #FFB800;
  --tactical-home: #EF4427;
  --tactical-away: #27272a;
  --header-h: 46px;
  --timeline-h: 52px;
  --toolbar-w: 46px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: #09090b;
}

/* Custom Scrollbar */
.tactical-scroll::-webkit-scrollbar { width: 5px; height: 5px; }
.tactical-scroll::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); }
.tactical-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 4px; }
.tactical-scroll::-webkit-scrollbar-thumb:hover { background: #EF4427; }

/* ===== CRITICAL MOBILE FIX: Explicit height layout ===== */
/* The app uses a column layout: header (fixed h) + workspace (fill) */
/* workspace = left toolbar + stage + right sidebar */
/* stage = canvas area + timeline (fixed h) */

.tactical-app-body {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  width: 100vw;
  height: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.tactical-header-nav {
  height: var(--header-h);
  min-height: var(--header-h);
  max-height: var(--header-h);
  flex-shrink: 0;
}

.tactical-workspace {
  display: flex;
  flex-direction: row;
  flex: 1 1 0%;
  min-height: 0;
  height: calc(100% - var(--header-h));
  width: 100%;
  overflow: hidden;
  position: relative;
}

.tactical-left-toolbar {
  width: var(--toolbar-w);
  min-width: var(--toolbar-w);
  flex-shrink: 0;
  height: 100%;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
  overscroll-behavior: contain;
}

.tactical-main-stage {
  display: flex;
  flex-direction: column;
  flex: 1 1 0%;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  position: relative;
}

/* Canvas Container — takes all remaining space above timeline */
#tactical-stage-container {
  position: relative;
  width: 100%;
  flex: 1 1 0%;
  min-height: 0;
  overflow: hidden;
  background: #060109;
  user-select: none;
  touch-action: none;
  -webkit-touch-callout: none;
}

.tactical-timeline-dock {
  height: auto;
  min-height: var(--timeline-h);
  flex-shrink: 0;
  background: #0b0210 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.7);
  z-index: 25;
  padding-bottom: max(env(safe-area-inset-bottom, 0px), 8px);
  padding-top: 4px;
}

#tactical-canvas-2d,
#tactical-canvas-3d {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* Glass Panels with Premier League Glow */
.tactical-glass {
  background: var(--tactical-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--tactical-border);
}

.tactical-btn-active {
  background: rgba(0, 255, 133, 0.15) !important;
  border-color: var(--tactical-neon) !important;
  color: var(--tactical-neon) !important;
  box-shadow: 0 0 12px rgba(0, 255, 133, 0.3);
}

/* Mode Switch 2D / 3D pill */
.mode-pill {
  position: relative;
  display: inline-flex;
  padding: 3px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Animation Timeline Frame Capsule */
.timeline-frame-item {
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}
.timeline-frame-item.active {
  border-color: var(--tactical-neon) !important;
  background: rgba(0, 255, 133, 0.2) !important;
  color: #FFFFFF !important;
  box-shadow: 0 0 14px rgba(0, 255, 133, 0.35);
  transform: translateY(-1px);
}

/* ============================================================== */
/* ZEN / PITCH-ONLY PRESENTATION MODE (Ẩn hết thanh công cụ)      */
/* ============================================================== */
body.zen-pitch-mode .tactical-header-nav,
body.zen-pitch-mode .tactical-left-toolbar,
body.zen-pitch-mode .tactical-sidebar,
body.zen-pitch-mode .tactical-timeline-dock {
  display: none !important;
}

body.zen-pitch-mode .tactical-workspace,
body.zen-pitch-mode .tactical-main-stage,
body.zen-pitch-mode #tactical-stage-container {
  width: 100vw !important;
  height: 100% !important;
  height: 100vh !important;
  height: 100dvh !important;
  flex: 1 1 auto !important;
}

/* Mobile Quick Floating Drawer */
@media (max-width: 768px) {
  .tactical-sidebar {
    position: fixed;
    right: 0;
    top: var(--header-h);
    bottom: var(--timeline-h);
    z-index: 40;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.8);
  }
}

@media (max-width: 640px) {
  :root {
    --header-h: 44px;
    --timeline-h: 56px;
    --toolbar-w: 42px;
  }
  .tactical-timeline-dock {
    padding-bottom: max(env(safe-area-inset-bottom, 0px), 16px) !important;
    padding-top: 4px !important;
  }
}

/* Animations */
@keyframes pulse-neon {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
}
.animate-neon-pulse {
  animation: pulse-neon 2s infinite ease-in-out;
}
