/**
 * Syntro Health — Loom Player & 16:9 Motion Graphics Stylesheet
 * Architectural Standard: emil-design-eng & high-end-visual-design
 * Strict: 16:9 Aspect Ratio Lock · Obsidian Theme · Fluid Typography
 */

/* Modal Backdrop */
.loom-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10500;
  background: rgba(3, 4, 8, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 1;
  animation: loomFadeIn 240ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes loomFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

/* Modal Dialog Box */
.loom-modal-dialog {
  width: 100%;
  max-width: 1140px;
  background: #07090e;
  border: 1px solid rgba(51, 65, 85, 0.7);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 40px rgba(16, 185, 129, 0.12);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Header */
.loom-modal-header {
  padding: 0.85rem 1.25rem;
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.loom-live-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 10px #10b981;
  animation: loomPulse 2s infinite ease-in-out;
}

@keyframes loomPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.loom-brand-title {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.loom-badge-ratio {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10b981;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.loom-badge-vnb {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: #06b6d4;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.loom-btn-close {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 160ms ease-out, background 160ms ease-out;
}

.loom-btn-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  transform: scale(1.05);
}

.loom-btn-close:active {
  transform: scale(0.95);
}

/* 16:9 Stage Aspect Box */
.loom-stage-wrapper {
  background: #020306;
  width: 100%;
}

.loom-stage-aspect-box {
  width: 100%;
  aspect-ratio: 16 / 9; /* CRITICAL: Locks strict 16:9 Full HD ratio, eradicating distortion */
  position: relative;
  overflow: hidden;
  background: #07090e;
}

.loom-motion-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.loom-native-video {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Prevents stretching */
  background: #000000;
}

/* Floating HUD Overlay */
.loom-hud-overlay {
  position: absolute;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.loom-hud-chip {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(51, 65, 85, 0.8);
  backdrop-filter: blur(8px);
  padding: 0.5rem 0.85rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

.loom-chip-badge {
  background: #10b981;
  color: #07090e;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
}

.loom-chip-text strong {
  display: block;
  color: #ffffff;
  font-size: 0.85rem;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  line-height: 1.2;
}

.loom-chip-text small {
  display: block;
  color: #94a3b8;
  font-size: 0.72rem;
  line-height: 1.2;
}

.loom-hud-watermark {
  background: rgba(2, 6, 23, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  color: #64748b;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
}

/* Controls Bar */
.loom-controls-bar {
  padding: 0.85rem 1.25rem;
  background: #0f172a;
  border-top: 1px solid rgba(51, 65, 85, 0.6);
}

.loom-progress-track {
  width: 100%;
  height: 6px;
  background: #1e293b;
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  transition: height 160ms ease-out;
}

.loom-progress-track:hover {
  height: 8px;
}

.loom-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #06b6d4);
  border-radius: 3px;
  position: relative;
}

.loom-progress-fill::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background: #ffffff;
  border: 2px solid #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.loom-marker {
  position: absolute;
  top: -2px;
  width: 3px;
  height: 10px;
  background: rgba(255, 255, 255, 0.3);
  pointer-events: none;
}

.loom-control-btn {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 160ms ease-out, background 160ms ease-out;
}

.loom-control-btn:hover {
  background: #1e293b;
  color: #10b981;
  transform: scale(1.05);
}

.loom-control-btn:active {
  transform: scale(0.95);
}

.loom-time-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: #10b981;
  font-weight: 600;
  margin-left: 0.5rem;
}

.loom-pill-btn {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 0.75rem;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 160ms ease-out;
}

.loom-pill-btn:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(51, 65, 85, 0.6);
}

.loom-pill-btn.active {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #10b981;
  font-weight: 700;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .loom-modal-backdrop {
    padding: 0.5rem;
  }
  .loom-chapter-pills {
    display: none !important;
  }
  .loom-badge-ratio, .loom-badge-vnb {
    display: none;
  }
  .loom-hud-chip {
    padding: 0.35rem 0.6rem;
  }
  .loom-chip-text strong {
    font-size: 0.75rem;
  }
  .loom-chip-text small {
    display: none;
  }
}
