/**
 * HorlogeTV v2 - Styles de base
 */

/* Reset */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Couleurs principales - Luxury Noir */
  --bg-dark: #0d0d0d;
  --bg-panel: #1a1a1a;
  --bg-card: #222222;
  --bg-hover: #2a2a2a;

  /* Bordures */
  --border-color: #2a2a2a;
  --border-light: #3a3a3a;

  /* Texte */
  --text-primary: #e5e5e5;
  --text-secondary: #888888;
  --text-muted: #666666;

  /* Accent - Luxury Gold */
  --accent: #ffd700;
  --accent-hover: #ffaa00;
  --accent-glow: rgba(255, 215, 0, 0.3);
  --accent-gradient: linear-gradient(135deg, #b8860b 0%, #ffd700 100%);

  /* États */
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  /* Dimensions */
  --header-height: 60px;
  --timeline-height: 250px;
  --sidebar-width: 320px;

  /* Animations */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  background: var(--bg-dark);
  color: var(--text-primary);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Background clock image - subtle watermark */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('../assets/clock-bg.jpg') center/cover no-repeat;
  opacity: 0.07;
  z-index: -1;
  pointer-events: none;
}

/* Hide background in demo/client/preview modes (fullscreen clock) */
body.mode-demo::before,
body.mode-client::before,
body.mode-preview::before,
body.kiosk-mode::before {
  display: none;
}

/* ============================================
   HEADER
   ============================================ */
#header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-color);
  height: var(--header-height);
  position: relative;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.header-right .header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-right .btn {
  padding: 6px 10px;
  font-size: 11px;
  gap: 5px;
  white-space: nowrap;
}

.header-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
}

.logo svg {
  flex-shrink: 0;
}

.logo .logo-text {
  letter-spacing: 1px;
}

.version {
  font-size: 11px;
  color: var(--text-muted);
  padding: 2px 6px;
  background: var(--bg-card);
  border-radius: 4px;
}

.theme-select {
  padding: 4px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
}

.theme-select:hover {
  border-color: var(--accent);
}

.time-display {
  font-size: 36px;
  font-weight: 600;
  font-family: 'Orbitron', monospace;
  color: var(--accent);
  letter-spacing: 2px;
  text-shadow: 0 0 20px var(--accent-glow);
}

.mode-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 4px 10px;
  background: linear-gradient(135deg, #b8860b, #ffd700);
  color: #0d0d0d;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #b8860b, #ffd700);
  color: #0d0d0d;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.btn:hover {
  background: linear-gradient(135deg, #ffd700, #ffaa00);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.btn:active {
  transform: translateY(0);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-small {
  padding: 4px 10px;
  font-size: 11px;
}

.btn-icon:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-light);
}

/* ============================================
   PREVIEW CONTAINER
   ============================================ */
#preview-container {
  position: relative;
  width: 100%;
  height: calc(100vh - var(--header-height) - var(--timeline-height));
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Theme Loading Overlay */
#theme-loading-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 99990;
  transition: opacity 0.5s ease;
}

.theme-loading-inner {
  width: 40vw;
  min-width: 280px;
  max-width: 600px;
  text-align: center;
}

.theme-loading-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2vw;
  margin-bottom: 4vh;
}

.theme-loading-icon {
  opacity: 0.9;
  flex-shrink: 0;
}

.theme-loading-logo {
  color: #fff;
  font-size: 5vw;
  font-weight: 300;
  letter-spacing: 4px;
}

.theme-loading-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.theme-loading-fill {
  height: 100%;
  width: 0%;
  background: #f5a623;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.theme-loading-label {
  margin-top: 2vh;
  color: rgba(255, 255, 255, 0.4);
  font-size: 2vw;
  letter-spacing: 0.5px;
}

#clock-layers {
  position: relative;
  width: auto;
  height: 100%;
  aspect-ratio: 16 / 9;
  max-width: 100%;
  background: #111;
  overflow: hidden;
}

/* Format vertical 9:16 (portrait) */
#clock-layers.vertical,
body.format-vertical #clock-layers {
  aspect-ratio: 9 / 16;
  height: 100%;
  width: auto;
  max-width: 50%; /* Limite la largeur pour ne pas déborder */
}

/* Format carré 1:1 */
#clock-layers.square,
body.format-square #clock-layers {
  aspect-ratio: 1 / 1;
  height: 100%;
  width: auto;
  max-width: 100%;
}

#background-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  min-width: 100%;
  min-height: 100%;
  object-fit: cover;
  z-index: 0;
}

.needle {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.needle.loaded {
  opacity: 1;
}

#needle-hours { z-index: 100; }
#needle-minutes { z-index: 110; }
#needle-seconds { z-index: 120; }

/* Quality canvas — rend les aiguilles à la résolution _bitmapSize */
#quality-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 125; /* au-dessus des aiguilles */
  display: none; /* caché jusqu'à l'activation */
}

/* Quand le canvas est actif, les <img> needles sont masqués */
#clock-layers.quality-canvas-active .needle {
  visibility: hidden;
}

#clock-layers.quality-canvas-active #quality-canvas {
  display: block;
}

/* Animation Layer - peut contenir plusieurs animations avec z-index variable */
#animation-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 200;
  pointer-events: none;
}

/* Alarm Animation Layer - animation dédiée à l'alarme */
#alarm-animation-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 850;
  pointer-events: none;
}

/* Image Layer - images PNG fixes ou avec effets */
.image-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.dynamic-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#overlay-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3000;
  pointer-events: none;
}

/* Loading Indicator */
.loading-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--text-secondary);
  z-index: 1001;
}

.loading-indicator.hidden {
  display: none;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner-small {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

/* ============================================
   TIMELINE
   ============================================ */
#timeline-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--timeline-height);
  min-height: 40px;
  max-height: 70vh;
  background: var(--bg-panel);
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 50;
}

#timeline-resize-handle {
  position: absolute;
  top: -5px;
  left: 0;
  right: 0;
  height: 10px;
  cursor: ns-resize;
  background: transparent;
  z-index: 60;
}

#timeline-resize-handle:hover,
#timeline-resize-handle.active {
  background: linear-gradient(to bottom, rgba(255, 215, 0, 0.4), transparent);
}

#timeline-resize-handle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 4px;
  background: var(--border-color);
  border-radius: 2px;
}

#timeline-resize-handle:hover::before {
  background: var(--accent);
}


#timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  height: 32px;
  min-height: 32px;
}

.timeline-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}

.timeline-controls button {
  width: 30px;
  height: 30px;
  padding: 0;
  font-size: 16px;
}

#zoom-level {
  font-size: 12px;
  color: var(--text-secondary);
  min-width: 50px;
  text-align: center;
}

.timeline-time {
  font-family: 'Orbitron', monospace;
  font-size: 14px;
  color: var(--accent);
}

#timeline-body {
  flex: 1;
  overflow-x: auto;
  overflow-y: auto;
  position: relative;
}

#time-ruler {
  position: relative;
  height: 24px !important;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  z-index: 10;
  margin-left: 150px;
  overflow: visible;
}

#tracks-container {
  min-width: 100%;
}

/* Track */
.track {
  display: flex !important;
  visibility: visible !important;
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  border-bottom: 1px solid var(--border-color);
  overflow: visible;
}

.track.selected {
  background: rgba(255, 215, 0, 0.15) !important;
  border-left: 4px solid #ffd700;
  box-shadow: inset 0 0 10px rgba(255, 215, 0, 0.2);
}

.track.dragging {
  opacity: 0.4;
}

.track.drag-over {
  border-top: 2px solid #3b82f6;
}

.track-header {
  width: 200px;
  min-width: 200px;
  display: flex;
  align-items: center;
  padding: 2px 6px !important;
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  gap: 4px;
  position: sticky;
  left: 0;
  font-size: 11px !important;
  z-index: 5;
}

.track-controls {
  display: flex;
  gap: 2px;
}

.track-btn {
  width: 18px;
  height: 18px;
  padding: 0;
  font-size: 8px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 2px;
  cursor: pointer;
  opacity: 0.5;
  color: var(--text-primary);
}

.track-btn:hover {
  opacity: 0.8;
}

.track-btn.active {
  background: #22c55e !important;
  opacity: 1 !important;
  color: white !important;
}

.track-btn .icon {
  font-size: 12px;
}

.track-name {
  flex: 1;
  font-size: 10px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.track-header-resizer {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  cursor: col-resize;
  z-index: 6;
}
.track-header-resizer:hover,
.track-header-resizer.dragging {
  background: var(--accent);
  opacity: 0.5;
}

.track-info {
  font-size: 10px;
  color: var(--text-secondary);
}

.track-timeline {
  flex: 1;
  position: relative;
  background: rgba(0, 0, 0, 0.2);
  overflow: hidden;
  height: 100%;
}

/* Segment */
.segment {
  position: absolute;
  top: 2px;
  height: calc(100% - 4px);
  min-width: 4px;
  border-radius: 3px;
  cursor: move;
  display: flex;
  align-items: center;
  padding: 0 4px;
  font-size: 9px;
  color: white;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.2s;
  z-index: 1;
}

.segment:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.segment.selected {
  box-shadow: 0 0 0 2px var(--accent), 0 2px 8px rgba(0, 0, 0, 0.5);
}

.segment-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Track Thumbnails */
.track-thumbnails {
  display: none;
}

.track-thumb {
  position: absolute;
  top: 50%;
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%);
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 4px;
  padding: 1px;
  box-sizing: border-box;
  overflow: hidden;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 20;
}

.track-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 2px;
  transform: scale(1.5);
}
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.track:hover .track-thumb {
  opacity: 1 !important;
  transform: translateX(-50%) scale(1.1);
}

/* Z-Depth Track Styles */
.track-zdepth {
  background: linear-gradient(90deg, #2a2a2a 0%, #1a1a1a 100%) !important;
  border-left: 3px solid #666 !important;
  margin-left: 20px;
  opacity: 0.9;
  min-height: 32px;
}

.track-zdepth .track-header {
  padding-left: 8px;
}

.track-zdepth .track-name {
  font-style: italic;
  color: #aaa !important;
}

.track-zdepth .track-timeline {
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 5px,
    rgba(102, 102, 102, 0.1) 5px,
    rgba(102, 102, 102, 0.1) 10px
  ) !important;
}

.track-zdepth:hover {
  background: linear-gradient(90deg, #333 0%, #222 100%) !important;
}

/* Playhead */
#playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ef4444;
  z-index: 100;
  pointer-events: none;
  left: 200px;
}

#playhead::before {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  width: 12px;
  height: 12px;
  background: #ef4444;
  border-radius: 50%;
}

#playhead-time {
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 10px;
  font-family: 'Orbitron', monospace;
  color: #ffd700;
  background: rgba(0,0,0,0.7);
  padding: 2px 4px;
  border-radius: 3px;
  white-space: nowrap;
  pointer-events: none;
}

/* ============================================
   PROPERTIES PANEL
   ============================================ */
#properties-panel {
  position: fixed;
  top: 60px;
  right: 0;
  width: 320px;
  height: calc(100vh - 60px);
  background: var(--bg-panel);
  border-left: 1px solid var(--border-color);
  z-index: 60;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#properties-panel.hidden {
  display: none;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
}

.panel-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

#panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

#panel-content input[type="range"] {
  -webkit-appearance: auto;
  appearance: auto;
  pointer-events: auto;
  touch-action: none;
  cursor: pointer;
}

#panel-content hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 15px 0;
}

.property-group {
  margin-bottom: 16px;
}

.property-group label {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  text-transform: uppercase;
}

.property-group input,
.property-group select {
  width: 100%;
  padding: 8px;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 13px;
  pointer-events: auto !important;
  cursor: text;
}

#panel-content input,
#panel-content select,
#panel-content button {
  pointer-events: auto !important;
  position: relative;
  z-index: 10;
}

.property-group input[type="checkbox"] {
  width: auto;
}

.property-group textarea {
  width: 100%;
  padding: 8px;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
}

.property-group input[type="color"] {
  height: 36px;
  padding: 2px;
  cursor: pointer;
}

.property-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.property-row > * {
  flex: 1;
}

/* ============================================
   SIDEBAR
   ============================================ */
#sidebar {
  position: fixed;
  top: var(--header-height);
  right: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height) - var(--timeline-height));
  background: var(--bg-panel);
  border-left: 1px solid var(--border-color);
  z-index: 40;
  transform: translateX(0);
  transition: transform var(--transition-normal);
}

#sidebar.sidebar-hidden {
  transform: translateX(100%);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-header h3 {
  font-size: 14px;
  font-weight: 600;
}

#sidebar-content {
  padding: 16px;
  overflow-y: auto;
  height: calc(100% - 56px);
}

/* ============================================
   UTILITIES
   ============================================ */
.hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Mode-specific visibility - geree par JS */

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

/* Selection */
::selection {
  background: var(--accent);
  color: white;
}

/* ============================================
   ALARMES - Variables CSS par defaut
   ============================================ */
.alarm-overlay {
  --pulse-duration: 0.6s;
  --pulse-scale: 1.08;
  --shake-duration: 0.1s;
  --shake-offset: 10px;
  --flash-duration: 0.5s;
  --flash-brightness: 1.4;
  --bounce-duration: 0.3s;
  --bounce-offset: 20px;
}

/* Effet Pulsation - scale avec variable */
@keyframes alarmOverlayPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(var(--pulse-scale, 1.08)); }
}

/* Effet Vibration - shake horizontal avec variable */
@keyframes alarmOverlayShake {
  0%, 100% { transform: translate(-50%, -50%) translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translate(-50%, -50%) translateX(calc(-1 * var(--shake-offset, 10px))); }
  20%, 40%, 60%, 80% { transform: translate(-50%, -50%) translateX(var(--shake-offset, 10px)); }
}

/* Effet Flash - luminosite avec variable */
@keyframes alarmOverlayFlash {
  0%, 100% { filter: brightness(1); box-shadow: 0 0 50px currentColor; }
  50% { filter: brightness(var(--flash-brightness, 1.4)); box-shadow: 0 0 80px currentColor, 0 0 120px currentColor; }
}

/* Effet Rebond - bounce vertical avec variable */
@keyframes alarmOverlayBounce {
  0%, 100% { transform: translate(-50%, -50%) translateY(0); }
  25% { transform: translate(-50%, -50%) translateY(calc(-1 * var(--bounce-offset, 20px))); }
  50% { transform: translate(-50%, -50%) translateY(0); }
  75% { transform: translate(-50%, -50%) translateY(calc(-0.5 * var(--bounce-offset, 20px))); }
}

/* Effet Rainbow - rotation teinte */
@keyframes alarmRainbow {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

/* Classes CSS pour effets overlay avec durees dynamiques */
.alarm-overlay.effect-pulse {
  animation: alarmOverlayPulse var(--pulse-duration, 0.6s) ease-in-out infinite !important;
}

.alarm-overlay.effect-shake {
  animation: alarmOverlayShake var(--shake-duration, 0.1s) ease-in-out infinite !important;
}

.alarm-overlay.effect-flash {
  animation: alarmOverlayFlash var(--flash-duration, 0.5s) ease-in-out infinite !important;
}

.alarm-overlay.effect-bounce {
  animation: alarmOverlayBounce var(--bounce-duration, 0.3s) ease-in-out infinite !important;
}

/* Combinaisons d'effets multiples */
.alarm-overlay.effect-pulse.effect-shake {
  animation: alarmOverlayPulse var(--pulse-duration, 0.6s) ease-in-out infinite,
             alarmOverlayShake var(--shake-duration, 0.1s) ease-in-out infinite !important;
}

.alarm-overlay.effect-pulse.effect-flash {
  animation: alarmOverlayPulse var(--pulse-duration, 0.6s) ease-in-out infinite,
             alarmOverlayFlash var(--flash-duration, 0.5s) ease-in-out infinite !important;
}

.alarm-overlay.effect-shake.effect-flash {
  animation: alarmOverlayShake var(--shake-duration, 0.1s) ease-in-out infinite,
             alarmOverlayFlash var(--flash-duration, 0.5s) ease-in-out infinite !important;
}

.alarm-overlay.effect-pulse.effect-bounce {
  animation: alarmOverlayPulse var(--pulse-duration, 0.6s) ease-in-out infinite,
             alarmOverlayBounce var(--bounce-duration, 0.3s) ease-in-out infinite !important;
}

/* Legacy - garder compatibilite */
@keyframes alarmPulse {
  from { transform: translate(-50%, -50%) scale(1); }
  to { transform: translate(-50%, -50%) scale(1.03); }
}

@keyframes alarmShake {
  0%, 100% { transform: rotate(-10deg); }
  50% { transform: rotate(10deg); }
}

/* ============================================
   MESSAGES
   ============================================ */
@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) translateY(0);
  }
}

@keyframes messageSlideOut {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) translateY(0);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -50%) translateY(-20px);
  }
}

/* ============================================
   EVENEMENTS
   ============================================ */
@keyframes eventSlideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes eventSlideOut {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
}

/* ============================================
   EXPORT VIDEO
   ============================================ */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Focus */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ============================================
   TIMELINE RULER
   ============================================ */
.ruler-hour {
  position: absolute;
  top: 0;
  height: 100%;
  border-left: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

.ruler-label {
  font-size: 9px;
  color: var(--text-secondary);
  padding-left: 2px;
  user-select: none;
  white-space: nowrap;
}

/* ============================================
   MODE-SPECIFIC STYLES
   ============================================ */
body.mode-admin #timeline-container {
  display: flex !important;
}

body.mode-admin #sidebar {
  display: block;
}

/* Mode Preview (fenetre separee) — zero UI, plein ecran absolu */
body.preview-mode {
  margin: 0 !important;
  padding: 0 !important;
  background: #000 !important;
  overflow: hidden !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

body.preview-mode.cursor-hidden {
  cursor: none !important;
}

/* Mode client : curseur toujours visible partout */
body.mode-client {
  cursor: default !important;
}

body.preview-mode #preview-container {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.preview-mode #clock-layers {
  max-width: 100vw;
  max-height: 100vh;
  overflow: hidden;
}

/* Mode Editeur (preview detache) */
body.editor-mode {
  overflow-x: hidden !important;
  max-width: 100vw !important;
}

body.editor-mode #preview-container {
  display: none !important;
}

body.editor-mode #timeline-container {
  position: fixed !important;
  top: 60px !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  height: auto !important;
  max-height: none !important;
  width: 100% !important;
  max-width: 100vw !important;
  overflow: hidden !important;
}

body.editor-mode #timeline-body {
  width: 100% !important;
  max-width: calc(100vw - 20px) !important;
  flex: 1 !important;
  overflow-x: auto !important;
  overflow-y: auto !important;
}

body.editor-mode #time-ruler {
  max-width: calc(100% - 150px) !important;
}

body.editor-mode .track-timeline {
  max-width: calc(100% - 150px) !important;
}

body.editor-mode #tracks-container {
  width: 100% !important;
  max-width: 100% !important;
}

body.editor-mode #properties-panel {
  top: 60px;
  height: calc(100vh - 60px);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  :root {
    --header-height: 50px;
    --timeline-height: 150px;
    --sidebar-width: 100%;
  }

  .time-display {
    font-size: 24px;
  }

  .header-left .version {
    display: none;
  }

  #sidebar {
    height: 50vh;
    top: auto;
    bottom: var(--timeline-height);
  }
}

/* ============================================
   CLIENT FEATURES
   ============================================ */

/* Mode Kiosque */
body.kiosk-mode #header,
body.kiosk-mode #timeline-container,
body.kiosk-mode #properties-panel,
body.kiosk-mode #sidebar,
body.kiosk-mode .help-button {
  display: none !important;
}

body.kiosk-mode #preview-container {
  height: 100vh !important;
}

/* Screen Selector Modal */
.screen-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(4px);
}

.screen-modal {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 420px;
  max-width: 90vw;
  overflow: hidden;
}

.screen-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.screen-modal-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.screen-modal-close {
  font-size: 22px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.screen-modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.screen-list {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.screen-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.screen-option:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.screen-icon {
  position: relative;
  color: var(--accent);
  flex-shrink: 0;
}

.screen-number {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
}

.screen-info {
  flex: 1;
}

.screen-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.screen-resolution {
  font-size: 12px;
  color: var(--text-secondary);
}

.screen-modal-footer {
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.screen-btn-tab {
  padding: 8px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  transition: all var(--transition-fast);
}

.screen-btn-tab:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* PIN Modal */
.pin-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.pin-modal-content {
  background: var(--bg-card);
  padding: 30px;
  border-radius: 12px;
  text-align: center;
  min-width: 300px;
}

.pin-modal-content h3 {
  margin: 0 0 20px 0;
  color: var(--text-primary);
}

.pin-modal-content input {
  width: 100%;
  padding: 12px;
  font-size: 24px;
  text-align: center;
  letter-spacing: 8px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.pin-modal-buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  justify-content: center;
}

/* Help Button */
.help-button {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  transition: all 0.2s;
}

.help-button:hover {
  transform: scale(1.1);
  background: var(--accent-hover);
}

/* Tutorial Panel */
.tutorial-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: var(--bg-card);
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow: hidden;
  z-index: 10001;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.tutorial-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.tutorial-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
}

.tutorial-progress {
  height: 3px;
  background: var(--bg-panel);
}

.tutorial-progress-bar {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s;
}

.tutorial-content {
  padding: 25px;
  max-height: 300px;
  overflow-y: auto;
}

.tutorial-content h3 {
  margin: 0 0 15px 0;
  color: var(--accent);
}

.tutorial-content ul,
.tutorial-content ol {
  margin: 10px 0;
  padding-left: 20px;
}

.tutorial-content li {
  margin: 8px 0;
}

.tutorial-footer {
  padding: 15px 20px;
  background: var(--bg-panel);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.tutorial-dismiss {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
}

.tutorial-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

#tutorial-counter {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Panel Resizing */
body.panel-resizing {
  cursor: ew-resize;
  user-select: none;
}

body.panel-resizing * {
  pointer-events: none;
}

/* ============================================
   DROPDOWN MENU
   ============================================ */
.dropdown-menu {
  animation: dropdownFadeIn 0.15s ease-out;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-item {
  font-size: 13px;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}

/* ============================================
   SEGMENT STYLES
   ============================================ */
.segment-label {
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

/* ============================================
   MODE DEMO / PREVIEW
   Interface épurée, horloge seule plein écran
   ============================================ */

/* Cacher le header en mode demo/preview */
body.mode-demo #header,
body.mode-preview #header {
  display: none !important;
}

/* Cacher la timeline en mode demo/preview */
body.mode-demo #timeline-container,
body.mode-preview #timeline-container {
  display: none !important;
}

/* Cacher le panneau de propriétés */
body.mode-demo #properties-panel,
body.mode-preview #properties-panel {
  display: none !important;
}

/* Horloge plein écran */
body.mode-demo #preview-container,
body.mode-preview #preview-container {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 1;
}

body.mode-demo #clock-layers,
body.mode-preview #clock-layers {
  width: 100vw !important;
  height: 100vh !important;
}

/* Format vertical en mode plein écran - respecter le ratio 9:16 */
body.mode-demo #clock-layers.vertical,
body.mode-preview #clock-layers.vertical,
body.mode-demo.format-vertical #clock-layers,
body.mode-preview.format-vertical #clock-layers {
  width: auto !important;
  height: 100vh !important;
  aspect-ratio: 9 / 16 !important;
  max-width: 100vw !important;
}

/* Format carré en mode plein écran - respecter le ratio 1:1 */
body.mode-demo #clock-layers.square,
body.mode-preview #clock-layers.square,
body.mode-demo.format-square #clock-layers,
body.mode-preview.format-square #clock-layers {
  width: auto !important;
  height: 100vh !important;
  aspect-ratio: 1 / 1 !important;
  max-width: 100vw !important;
}

/* Bouton flottant panel client (visible en demo) */
#btn-client-panel-float {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 215, 0, 0.2);
  color: rgba(255, 215, 0, 0.6);
  cursor: pointer;
  z-index: 150;
  display: none; /* Caché par défaut */
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, transform 0.3s ease, background 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  opacity: 1;
}

#btn-client-panel-float:hover {
  background: rgba(0, 0, 0, 0.6);
  color: rgba(255, 215, 0, 0.9);
  border-color: rgba(255, 215, 0, 0.4);
  transform: scale(1.05);
  opacity: 1 !important; /* Réapparaît au hover */
}

#btn-client-panel-float svg {
  width: 20px;
  height: 20px;
}

/* État fondu (après 3s) */
#btn-client-panel-float.faded {
  opacity: 0.15;
}

#btn-client-panel-float.faded:hover {
  opacity: 1;
}

/* Afficher le bouton flottant en mode demo uniquement */
body.mode-demo #btn-client-panel-float {
  display: flex !important;
}

/* Aussi visible au démarrage avant que le mode soit appliqué */
#btn-client-panel-float.visible {
  display: flex !important;
}

/* Cacher les boutons du header en mode demo */
body.mode-demo .header-actions {
  display: none !important;
}

/* Cacher le bouton aide en mode demo/preview */
body.mode-demo .help-button,
body.preview-mode .help-button,
body.mode-demo #client-help-btn,
body.preview-mode #client-help-btn {
  display: none !important;
}

/* ============================================
   MODE CLIENT - Split layout (preview + panel)
   ============================================ */

/* Cacher header, timeline, propriétés, sidebar */
body.mode-client #header { display: none !important; }
body.mode-client #timeline-container { display: none !important; }
body.mode-client #properties-panel { display: none !important; }
body.mode-client #sidebar { display: none !important; }
body.mode-client .header-actions { display: none !important; }
body.mode-client .help-button,
body.mode-client #client-help-btn { display: none !important; }

/* Cacher le bouton flottant demo (on a notre propre bouton) */
body.mode-client #btn-client-panel-float { display: none !important; }

/* Preview : plein écran par défaut, réduit quand panel ouvert */
body.mode-client #preview-container {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 1;
  background: #000;
}

body.mode-client #clock-layers {
  width: 100vw !important;
  height: 100vh !important;
}

/* Format vertical en mode client */
body.mode-client #clock-layers.vertical,
body.mode-client.format-vertical #clock-layers {
  width: auto !important;
  height: 100vh !important;
  aspect-ratio: 9 / 16 !important;
  max-width: 100vw !important;
}

/* Format carré en mode client */
body.mode-client #clock-layers.square,
body.mode-client.format-square #clock-layers {
  width: auto !important;
  height: 100vh !important;
  aspect-ratio: 1 / 1 !important;
  max-width: 100vw !important;
}

/* Panel client : fixé à droite, toggle via transform */
body.mode-client #client-panel {
  top: 0 !important;
  height: 100vh !important;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Le bouton close interne est visible pour refermer le panel */

/* Bouton toggle engrenage */
#btn-client-toggle {
  display: none;
  position: fixed;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(232, 147, 58, 0.3);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  z-index: 5000;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease, right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

body.mode-client #btn-client-toggle {
  display: flex;
}

/* Bouton toggle reste en haut à droite, hors du panel */
body.mode-client.client-panel-open #btn-client-toggle {
  right: 416px;
  opacity: 0;
  pointer-events: none;
}

#btn-client-toggle:hover {
  background: rgba(0, 0, 0, 0.8);
  border-color: rgba(232, 147, 58, 0.6);
  color: #e8933a;
}

#btn-client-toggle svg {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

#btn-client-toggle:hover svg {
  transform: rotate(45deg);
}

/* Fondu après 3s d'inactivité */
#btn-client-toggle.faded {
  opacity: 0.15;
}

#btn-client-toggle.faded:hover {
  opacity: 1;
}

/* ============================================
   BOUTON STOP ALARME DISCRET
   ============================================ */
.stop-alarm-btn {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: rgba(239, 68, 68, 0.6);
  cursor: pointer;
  z-index: 900;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.stop-alarm-btn:hover {
  background: rgba(239, 68, 68, 0.4);
  border-color: rgba(239, 68, 68, 0.6);
  color: rgba(255, 255, 255, 0.9);
  transform: scale(1.1);
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
}

.stop-alarm-btn:active {
  transform: scale(0.95);
}

.stop-alarm-btn svg {
  width: 16px;
  height: 16px;
}

/* Visible quand alarme active */
.stop-alarm-btn.visible {
  display: flex;
  opacity: 0.4;
  transform: scale(1);
  animation: stopBtnPulse 2s ease-in-out infinite;
}

.stop-alarm-btn.visible:hover {
  opacity: 1;
  animation: none;
}

@keyframes stopBtnPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

/* Animations pour les alarmes */
.alarm-anim-flash {
  animation: alarmFlash 0.2s ease-in-out infinite;
}

.alarm-anim-pulse {
  animation: alarmPulse 0.6s ease-in-out infinite alternate;
}

.alarm-anim-shake {
  animation: alarmShake 0.1s ease-in-out infinite;
}

.alarm-anim-glow {
  animation: alarmGlow 1s ease-in-out infinite;
}

.alarm-anim-bounce {
  animation: alarmBounce 0.5s ease-in-out infinite;
}

.alarm-anim-rotate {
  animation: alarmRotate 2s linear infinite;
}

.alarm-anim-zoom {
  animation: alarmZoom 0.8s ease-in-out infinite alternate;
}

.alarm-anim-wave {
  animation: alarmWave 1s ease-in-out infinite;
}

.alarm-anim-sparkle {
  animation: alarmSparkle 0.3s ease-in-out infinite;
}

.alarm-anim-rainbow {
  animation: alarmRainbow 2s linear infinite;
}

@keyframes alarmFlash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

@keyframes alarmGlow {
  0%, 100% { filter: drop-shadow(0 0 5px rgba(255, 200, 0, 0.5)); }
  50% { filter: drop-shadow(0 0 30px rgba(255, 200, 0, 1)) drop-shadow(0 0 60px rgba(255, 100, 0, 0.8)); }
}

@keyframes alarmBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

@keyframes alarmRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes alarmZoom {
  0% { transform: scale(1); }
  100% { transform: scale(1.1); }
}

@keyframes alarmWave {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  25% { transform: translateX(-5px) rotate(-2deg); }
  75% { transform: translateX(5px) rotate(2deg); }
}

@keyframes alarmSparkle {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.5) contrast(1.2); }
}

#alarm-animation-layer.alarm-active {
  pointer-events: none;
}

/* ─── Screen Rotation ─────────────────────────────────────────────────── */
/* Rotation selector buttons (admin header) */
.rotation-selector {
  display: flex;
  gap: 2px;
  margin-left: 8px;
}

.rotation-selector button {
  background: #2a2a2a;
  border: 1px solid rgba(255,255,255,0.15);
  color: #999;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.2s;
}

.rotation-selector button:hover {
  background: #333;
  color: #fff;
}

.rotation-selector button.active {
  background: #06b6d4;
  border-color: #06b6d4;
  color: #fff;
}

/* Preview discrete hover buttons */
.preview-hover-btn {
  position: fixed;
  bottom: 10px;
  z-index: 10000;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s;
  backdrop-filter: blur(4px);
}

#preview-rotation-btn {
  right: 10px;
  font-size: 14px;
}

#preview-format-btn {
  right: 50px;
  font-size: 11px;
}

/* Remote QR Code Overlay */
#remote-qr-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s;
}

.remote-qr-inner {
  text-align: center;
  color: #fff;
}

.remote-qr-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 20px;
  letter-spacing: 1px;
}

#remote-qr-canvas {
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.remote-qr-url {
  margin-top: 16px;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  word-break: break-all;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

.remote-qr-hint {
  margin-top: 12px;
  font-size: 14px;
  color: rgba(255,255,255,0.7);
}

/* ============================================
   ADMIN LOGIN OVERLAY
   ============================================ */
#admin-login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--bg-dark);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-login-box {
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 48px 40px;
  text-align: center;
  width: 360px;
  max-width: 90vw;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.admin-login-logo {
  margin-bottom: 20px;
}

.admin-login-logo svg {
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.15));
}

.admin-login-title {
  font-family: 'Inter', 'Poppins', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 6px 0;
  letter-spacing: 1px;
}

.admin-login-subtitle {
  font-family: 'Inter', 'Poppins', sans-serif;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  margin: 0 0 32px 0;
  letter-spacing: 0.5px;
}

#admin-login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#admin-password {
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-dark);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

#admin-password:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.1);
}

#admin-password::placeholder {
  color: var(--text-muted);
}

#admin-login-btn {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  background: var(--accent-gradient);
  color: #0d0d0d;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  letter-spacing: 0.5px;
}

#admin-login-btn:hover {
  opacity: 0.9;
}

#admin-login-btn:active {
  transform: scale(0.98);
}

#admin-login-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

#admin-login-error {
  color: var(--danger);
  font-size: 13px;
  margin: 4px 0 0 0;
}
