/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #000;
  font-family: system-ui, -apple-system, sans-serif;
}

/* ── Utilities ─────────────────────────────────────────────────────────────── */
.hidden  { display: none !important; }
.fullscreen { position: fixed; inset: 0; }
.flex-center { display: flex; align-items: center; justify-content: center; }

/* ── Pairing screen ────────────────────────────────────────────────────────── */
#pairing-screen {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
  color: #fff;
}

.pairing-card {
  text-align: center;
  padding: 3rem 4rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 1.5rem;
  backdrop-filter: blur(10px);
  max-width: 480px;
  width: 90%;
}

.pairing-logo { font-size: 4rem; margin-bottom: 1rem; }

.pairing-card h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.pairing-subtitle { color: #94a3b8; margin-bottom: 1.5rem; font-size: 0.9rem; }

.pairing-code {
  font-size: 4rem;
  font-weight: 900;
  letter-spacing: 0.5rem;
  font-family: 'Courier New', monospace;
  color: #60a5fa;
  padding: 1rem;
  background: rgba(96,165,250,0.1);
  border-radius: 0.75rem;
  border: 2px solid rgba(96,165,250,0.3);
  margin-bottom: 1.5rem;
}

#qr-code { width: 180px; height: 180px; border-radius: 0.5rem; margin: 0 auto 1rem; display: block; padding: 8px; background: #fff; }

.pairing-url { color: #64748b; font-size: 0.75rem; margin-bottom: 1.5rem; }
.pairing-url span { color: #93c5fd; }

.pairing-status {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  color: #94a3b8; font-size: 0.85rem;
}

/* ── Dots ─────────────────────────────────────────────────────────────────── */
.dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}
.dot-pulse {
  background: #60a5fa;
  animation: pulse 2s ease-in-out infinite;
}
.dot-success { background: #4ade80; }
.dot-error   { background: #f87171; }

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

/* ── Player screen ──────────────────────────────────────────────────────────── */
#player-screen { background: #000; }

.content-layer {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.content-layer.active { opacity: 1; }

.content-layer img {
  max-width: 100%; max-height: 100%;
  width: 100%; height: 100%;
  object-fit: contain;
}

.content-layer video {
  width: 100%; height: 100%;
  object-fit: contain;
}

.content-layer iframe {
  width: 100%; height: 100%;
  border: none;
  background: #fff;
}

.content-layer .powerbi-container {
  width: 100%; height: 100%;
}

/* ── Connection indicator ──────────────────────────────────────────────────── */
.conn-indicator {
  position: fixed;
  top: 12px; right: 12px;
  font-size: 0.6rem;
  z-index: 1000;
  width: 8px; height: 8px;
  border-radius: 50%;
  transition: background 0.5s;
}

.conn-online  { background: #4ade80; box-shadow: 0 0 6px #4ade80; }
.conn-offline { background: #f87171; box-shadow: 0 0 6px #f87171; }
.conn-connecting { background: #fbbf24; box-shadow: 0 0 6px #fbbf24; animation: pulse 1s infinite; }

/* ── Overlays ─────────────────────────────────────────────────────────────── */
.overlay-loading {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.5);
  z-index: 100;
}

.overlay-error {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.7);
  z-index: 100;
  color: #fff;
}

.error-icon   { font-size: 3rem; margin-bottom: 1rem; }
.error-message { font-size: 1.1rem; color: #94a3b8; }

/* ── Spinner ──────────────────────────────────────────────────────────────── */
.spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: #60a5fa;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Progress bar ─────────────────────────────────────────────────────────── */
.progress-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 3px; background: rgba(255,255,255,0.1); z-index: 500;
}

.progress-fill {
  height: 100%; width: 0%;
  background: #3b82f6;
  transition: width linear;
}
