/* ==========================================================================
   Pitching Intelligence OS - Next-Gen Sports Tech & Biomechanics Design System
   Aesthetics: Deep Slate Glassmorphism, Floating Docks, Precision Neon Accents
   ========================================================================== */

:root {
  /* Color Palette - Deep Dark Tech SaaS */
  --bg-base: #07090e;
  --bg-surface: #0d121d;
  --bg-card: rgba(15, 23, 42, 0.72);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-panel: rgba(13, 18, 30, 0.88);
  --bg-input: rgba(5, 8, 15, 0.65);

  /* Borders & Glassmorphism */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.14);
  --border-glow: rgba(56, 189, 248, 0.4);

  /* Curated Vivid Accents */
  --primary: #38bdf8;
  --primary-glow: rgba(56, 189, 248, 0.35);
  --accent-cyan: #00f2fe;
  --accent-blue: #3b82f6;
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.3);
  --accent-amber: #f59e0b;
  --accent-amber-glow: rgba(245, 158, 11, 0.3);
  --accent-rose: #f43f5e;
  --accent-purple: #8b5cf6;

  /* Typography Colors */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-bright: #ffffff;

  /* Geometry & Shadows */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 25px rgba(56, 189, 248, 0.2);

  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-base);
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(56, 189, 248, 0.07) 0%, transparent 45%),
    radial-gradient(circle at 90% 20%, rgba(139, 92, 246, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 50% 90%, rgba(16, 185, 129, 0.04) 0%, transparent 45%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Custom Scrollbar - High Contrast & Clearly Visible */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.6) rgba(10, 15, 26, 0.85);
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
::-webkit-scrollbar-track {
  background: rgba(10, 15, 26, 0.85);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.6);
  border: 1.5px solid rgba(10, 15, 26, 0.9);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.8);
}

/* Glassmorphism Panel Base */

.glass-panel:hover {
  border-color: var(--border-medium);
}

/* ==========================================================================
   Header & Brand Session Navigation
   ========================================================================== */
header.app-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(7, 9, 14, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.btn-close-viewer {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  padding: 6px 14px;
  border-radius: 8px;
  font-family: "Pretendard Variable", Pretendard, sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  text-decoration: none;
  user-select: none;
}

.btn-close-viewer:hover {
  background: rgba(239, 71, 111, 0.18);
  border-color: rgba(239, 71, 111, 0.5);
  color: #ff4d6d;
  box-shadow: 0 0 12px rgba(239, 71, 111, 0.3);
  transform: translateY(-1px);
}

.btn-close-viewer i,
.btn-close-viewer svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.4px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-badge-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #00f2fe 0%, #3b82f6 50%, #8b5cf6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px var(--primary-glow);
  flex-shrink: 0;
}

.brand-badge-icon i,
.brand-badge-icon svg {
  width: 20px;
  height: 20px;
  stroke: #ffffff;
  stroke-width: 2.4px;
}

.brand-info h1 {
  font-family: "Pretendard Variable", Pretendard, sans-serif;
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-version-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.02em;
}

@keyframes pulse-emerald {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ==========================================================================
   Quick Actions & Navigation Panel (Unified with Upload Card Style)
   ========================================================================== */

.app-intro-banner {
  font-size: 0.88rem;
  font-weight: 600;
  color: #e2e8f0;
  text-align: center;
  line-height: 1.5;
  padding: 2px 4px 4px;
  letter-spacing: -0.015em;
}

.nav-btn.highlight:hover {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.25), rgba(59, 130, 246, 0.25));
  border-color: var(--primary);
  box-shadow: 0 0 16px var(--primary-glow);
  transform: translateY(-1px);
}

.nav-btn.sample-btn:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.25));
  border-color: #fbbf24;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.35);
  transform: translateY(-1px);
}

/* ==========================================================================
   Main Application Workspace Layout
   ========================================================================== */
.workspace-container {
  max-width: 1440px;
  width: 96%;
  margin: 12px auto 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

/* ==========================================================================
   Large File Selection & Calibration Bar
   ========================================================================== */

.large-file-btn:hover {
  background: rgba(15, 23, 42, 0.85);
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.25);
  transform: translateY(-1px);
}

.setting-item {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.arm-slot-title {
  margin-left: 8px;
}

/* Phones: one setting per line (height / arm slot / camera distance) */
@media (max-width: 640px) {

  .setting-item .height-title {
    min-width: 64px;
    margin-left: 0;
  }
}

.arm-slot-select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 4px 6px;
}

.arm-slot-select option {
  background: #0b1220;
  color: #ffffff;
}

.height-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Input Control Dock */

.file-input-custom:focus {
  outline: none;
  border-color: var(--primary);
}

.height-input-field {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: right;
  padding: 5px 2px;
}

.height-input-field:focus {
  outline: none;
}

.height-unit-tag {
  font-size: 0.74rem;
  color: var(--text-dim);
  margin-left: 4px;
}

.btn-sample-dock:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-bright);
}

.btn-analyze-dock:hover {
  box-shadow: 0 0 24px rgba(0, 242, 254, 0.6);
  transform: translateY(-1px);
}

/* ==========================================================================
   2-Column Studio Grid: Left Visualizer Stage | Right Intelligence Panel
   ========================================================================== */

/* Left Column: Visualizer Stage */

.btn-mode-pill.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--primary);
  color: var(--primary);
}

/* Canvas & Video Viewport */

/* Empty Viewport Placeholder (Reserved for Ads / Clean State) */

.video-placeholder.hidden {
  display: none;
}

/* Loading Overlay */

.loading-overlay.active {
  display: flex;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* NLE Precision Playback Controller */

/* Event Jump Bar */

.btn-event-jump:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.btn-event-jump.pkh:hover { border-color: #00f2fe; }
.btn-event-jump.fp:hover  { border-color: #ffd166; }
.btn-event-jump.br:hover  { border-color: #ff4d6d; }

/* Controls Row */

.btn-ctrl:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-ctrl.primary-btn:hover {
  background: #38bdf8;
  color: #04060a;
}

/* Timeline Scrubber & Time Bar (Bottom Row - Matching Elite 3D Viewer) */

.timeline-scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.timeline-scrubber::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

/* Right Column: Intelligence & KPI Hub */

/* Speed Hero Widget */

/* Radar Score Widget */

/* AI Coaching Briefing Box */

/* ==========================================================================
   Tabbed Deep Analytics Hub (Kinetic Chart / Table / Drills)
   ========================================================================== */

.analytics-tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-2px);
}

.analytics-tab-btn:hover .tab-text {
  color: var(--text-bright);
}

.analytics-tab-btn:hover .tab-icon,
.analytics-tab-btn:hover .tab-icon svg {
  stroke: var(--text-bright);
}

.analytics-tab-btn.active {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.18), rgba(59, 130, 246, 0.18));
  border-color: var(--primary);
  box-shadow: 0 0 16px var(--primary-glow);
  transform: translateY(-1px);
}

.analytics-tab-btn.active .tab-icon,
.analytics-tab-btn.active .tab-icon svg {
  stroke: var(--primary);
  filter: drop-shadow(0 0 8px var(--primary));
  transform: scale(1.1);
}

.analytics-tab-btn.active .tab-text {
  color: #ffffff;
  font-weight: 800;
}

.tab-content-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Comparison Table */

.comparison-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Coaching & Drill Cards */

.coaching-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-2px);
}

/* ==========================================================================
   Floating Action Dock (Downloads & Utilities)
   ========================================================================== */

.btn-dock-action:hover {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.18), rgba(59, 130, 246, 0.18));
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 0 16px var(--primary-glow);
  transform: translateY(-2px);
}

/* ==========================================================================
   Minimal Data Attribution Footer (Mandatory License Notice)
   ========================================================================== */

.app-minimal-footer a:hover {
  color: var(--text-bright);
}

/* ==========================================================================
   Modal Dialogs (About & System Info)
   ========================================================================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(5, 8, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow-y: auto;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  animation: modalScale 0.2s ease;
}

@keyframes modalScale {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-family: "Pretendard Variable", Pretendard, sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-dim);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.modal-close-btn:hover {
  background: rgba(244, 63, 94, 0.16);
  border-color: rgba(244, 63, 94, 0.4);
  color: var(--accent-rose);
  transform: scale(1.06);
}

.modal-close-btn svg,
.modal-close-btn i {
  pointer-events: none;
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.22);
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.modal-bottom-close-btn {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 8px 24px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-bottom-close-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
  transform: translateY(-1px);
}

.modal-body {
  padding: 20px 22px;
  max-height: 70vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 0.86rem;
  line-height: 1.6;
}

.modal-section-title {
  font-family: "Pretendard Variable", Pretendard, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 768px) {
  header.app-header {
    padding: 10px 14px;
    flex-wrap: wrap;
  }

}

/* 폰 가로 모드 (Landscape) 대응 */

@media (max-width: 640px) {

  /* 폰 화면 4열 너비 최적화 */

  /* 폰에 한해서 단위를 숫자 아래에 줄바꿈 표시 */

  /* 폰 화면 탭 줄바꿈 지원 및 가독성 개선 */

}

/* Arm Slot Matching Banner */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Top Announcement Bar (상단 슬림 공지 띠배너)
   ========================================================================== */

.top-announcement-bar.hidden {
  display: none !important;
}

.announcement-link:hover {
  background: #f0f9ff;
  color: #0284c7;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.announcement-close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-50%) scale(1.1);
}

/* =========================================================================
   Global Expansion & Unit Conversion Styles (km/h ⇄ mph & KR ⇄ EN)
   ========================================================================= */

.unit-pill-btn:hover {
  color: #ffffff;
}

.unit-pill-btn.active {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.45);
}

.header-right-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-toggle-wrap {
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.75) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  border-radius: 20px !important;
  padding: 3px !important;
  gap: 3px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35) !important;
}

.lang-btn {
  background: transparent !important;
  border: none !important;
  color: #94a3b8 !important;
  font-size: 0.76rem !important;
  font-weight: 800 !important;
  padding: 3px 10px !important;
  border-radius: 14px !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  line-height: 1.25 !important;
}

.lang-btn:hover {
  color: #ffffff !important;
}

.lang-btn.active {
  background: #00f2fe !important;
  color: #050b14 !important;
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.5) !important;
}

/* ==========================================================================
   Google AdSense & In-House Sponsorship Placements
   ========================================================================== */

/* 1. Loading In-Feed Ad Slot (300x250 square responsive inside loading overlay) */

.ad-fallback-card:hover {
  transform: translateY(-1px);
  border-color: rgba(56, 189, 248, 0.5);
}

/* 2. Leaderboard Banner (728x90 desktop / 320x100 mobile) at bottom of results */

.ad-lb-cta:hover {
  background: #38bdf8;
  color: #070b12;
}

/* ==========================================================================
   JHSmotionlab Standard Unified Footer
   ========================================================================== */
.app-unified-footer {
  width: 100%;
  max-width: 1440px;
  margin: 24px auto 20px;
  padding: 24px 20px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(5, 11, 20, 0.65);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  box-sizing: border-box;
  text-align: center;
}

.footer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 1100px;
  margin: 0 auto;
}

.footer-company-brand {
  font-family: "Pretendard Variable", Pretendard, -apple-system, sans-serif;
  font-size: 0.96rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.footer-company-desc {
  font-size: 0.84rem;
  font-weight: 500;
  color: #94a3b8;
  line-height: 1.5;
  word-break: keep-all;
}

.footer-contact-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 0.80rem;
  margin-top: 2px;
}

.footer-contact-row a {
  color: #38bdf8;
  text-decoration: none;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.footer-contact-row a:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

.footer-nav-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 0.82rem;
  margin-top: 6px;
}

.footer-nav-link {
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.footer-nav-link:hover {
  color: #38bdf8;
}

.footer-attribution-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 0.74rem;
  color: #64748b;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  width: 100%;
}

.footer-attribution-row a {
  color: #94a3b8;
  text-decoration: underline;
}

.footer-attribution-row strong {
  color: #cbd5e1;
  font-weight: 700;
}

.footer-sep {
  color: rgba(255, 255, 255, 0.18);
  font-size: 0.75rem;
  user-select: none;
}

@media (max-width: 680px) {
  .app-unified-footer {
    padding: 18px 14px 16px;
    margin: 16px auto 14px;
    border-radius: 12px;
  }
  .footer-company-brand {
    font-size: 0.90rem;
  }
  .footer-company-desc {
    font-size: 0.78rem;
  }
  .footer-contact-row, .footer-nav-row {
    font-size: 0.76rem;
    gap: 4px 8px;
  }
  .footer-attribution-row {
    font-size: 0.70rem;
    gap: 3px 6px;
  }
}

