/* Beam Lite — display surface styling.
   Mirrors beam-display/src/renderer/default-screen.html's glass aesthetic so a
   Lite screen is visually consistent with Tier-1 displays when idle. */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #6366f1;
  --primary-light: #818cf8;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.5);
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.15);
  --bg: #0b1020;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  color: var(--text-primary);
}

.hidden {
  display: none !important;
}

/* ---------- Content iframe (the screen) ---------- */
.content-frame {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  border: 0;
  z-index: 100;
  background: #000;
}

/* ---------- Attract / default screen ---------- */
.attract {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.35), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(16, 185, 129, 0.25), transparent 45%),
    var(--bg);
  background-size: cover;
}

.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(0, 0, 0, 0.45);
}

.card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 3rem 4rem;
  text-align: center;
  max-width: 560px;
}

.state {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Spinner */
.spinner {
  width: 56px;
  height: 56px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1.5rem;
}

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

.connecting-message {
  color: var(--text-secondary);
  font-size: 1.2rem;
}

/* Activation code */
.activation-code {
  font-size: 3.5rem;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
  font-weight: 600;
  color: var(--primary-light);
  letter-spacing: 0.4rem;
  margin-bottom: 1.5rem;
  text-shadow: 0 0 30px rgba(99, 102, 241, 0.5);
}

.instructions {
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.6;
}

.dots {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 1.5rem;
}

.dots span {
  width: 10px;
  height: 10px;
  background: var(--primary);
  border-radius: 50%;
  animation: pulse-dot 1.4s infinite ease-in-out both;
}

.dots span:nth-child(1) {
  animation-delay: 0s;
}
.dots span:nth-child(2) {
  animation-delay: 0.2s;
}
.dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes pulse-dot {
  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Repair */
.repair-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}
.repair-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: #fbbf24;
  margin-bottom: 0.75rem;
}
.repair-message {
  color: var(--text-secondary);
  line-height: 1.6;
}
.repair-id {
  font-family: 'SF Mono', 'Monaco', monospace;
  font-size: 1.1rem;
  margin-top: 0.75rem;
  opacity: 0.8;
}

/* Ready */
.ready-badge {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.2rem;
  color: var(--primary-light);
  margin-bottom: 0.75rem;
}
.ready-message {
  color: var(--text-secondary);
  font-size: 1.3rem;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 2rem 1.75rem;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  min-width: 200px;
}

.clock {
  text-align: center;
}
.clock-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.05rem;
  margin-bottom: 0.25rem;
}
.clock-time {
  font-size: 2.25rem;
  font-weight: 200;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.divider {
  width: 80%;
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
}

.info-block {
  text-align: center;
}
.label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}
.value {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-family: 'SF Mono', 'Monaco', monospace;
}

.conn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}
.dot.connected {
  background: var(--success);
}
.dot.disconnected {
  background: var(--error);
}
.dot.connecting {
  background: var(--warning);
  animation: blink 1s infinite;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

.reregister {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  transition: all 0.2s;
}
.reregister:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

/* ---------- Notice (frame-busting / errors) ---------- */
.notice {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  max-width: 70vw;
  background: rgba(239, 68, 68, 0.95);
  color: #fff;
  padding: 0.9rem 1.4rem;
  border-radius: 12px;
  font-size: 0.95rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
