/* =========================
   THEME / VARIABLES
========================= */
:root {
  --bg: #08111f;
  --bg-2: #0f172a;
  --panel: rgba(15, 23, 42, 0.9);
  --panel-strong: rgba(17, 24, 39, 0.96);
  --panel-soft: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #e5e7eb;
  --muted: #94a3b8;
  --accent: #60a5fa;
  --accent-2: #3b82f6;
  --good: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --radius: 22px;
}

/* =========================
   GLOBAL
========================= */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.15), transparent 30%),
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.08), transparent 28%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  padding: 24px;
  display: grid;
  place-items: center;
}

/* =========================
   LAYOUT
========================= */
.app {
  width: min(1180px, 100%);
  display: grid;
  gap: 14px;
}

.grid {
  display: grid;
  grid-template-columns: 1.1fr 0.95fr 0.95fr;
  gap: 14px;
}

/* =========================
   HERO
========================= */
.hero {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(17, 24, 39, 0.95));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3.2vw, 3rem);
}

/* =========================
   CARDS
========================= */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.card.controls {
  padding: 12px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.mini-label {
  color: var(--muted);
  font-size: 0.86rem;
  text-transform: uppercase;
}

/* =========================
   FORM
========================= */
label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
}

input {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
}

.row {
  display: flex;
  gap: 10px;
}

/* =========================
   BUTTONS
========================= */
button {
  border-radius: 14px;
  padding: 13px 16px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
}

.ghost {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border: 1px solid var(--border);
}

/* Make the Leave button feel intentionally red */
#leaveBtn {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.28);
  color: #fecaca;
}

#leaveBtn:hover {
  background: rgba(239, 68, 68, 0.18);
}

/* Make Reconnect feel blue and readable */
#reconnectBtn {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.28);
  color: #bfdbfe;
}

#reconnectBtn:hover {
  background: rgba(59, 130, 246, 0.18);
}

/* Center the View Slides button */
#viewSlidesBtn {
  display: block;
  width: min(220px, 100%);
  margin: 0 auto;
  text-align: center;
  color: var(--text);
}

/* Slide buttons */
.big-buttons {
  display: flex;
  gap: 10px;
}

.big-buttons button {
  flex: 1;
  padding: 18px;
  min-width: 0;
}

.prev {
  background: #f59e0b;
  color: #422006;
}

.next {
  background: #22c55e;
  color: #052e16;
}

/* =========================
   STATUS
========================= */
.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  color: var(--muted);
  padding: 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.status .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--danger);
}

.status.connected .dot {
  background: var(--good);
}

.status.warm .dot {
  background: var(--warn);
}

/* =========================
   LISTS
========================= */
.log,
.user-list {
  list-style: none;
  padding: 0;
}

.log li {
  opacity: 0.6;
}

.log li:first-child {
  opacity: 1;
}


.slide-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
}

.slide-img.small {
  opacity: 0.9;
}

/* SLIDE FRAME (visual preview) */
.slide-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0f172a;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.slide-frame.small {
  opacity: 0.85;
}

.slide-content {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 700;
  text-align: center;
}

.slide-content.small {
  font-size: clamp(1rem, 2vw, 1.5rem);
}


/* =========================
   MOBILE
========================= */
@media (max-width: 980px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body {
    padding: 14px;
  }

  .app {
    display: flex;
    flex-direction: column;
  }

  .hero {
    order: 1;
  }

  .controls {
    order: 2;
  }

  .grid {
    order: 3;
  }

  .hero,
  .card {
    border-radius: 18px;
  }

  .row {
    flex-direction: column;
  }

  .row button {
    width: 100%;
  }

  .big-buttons {
    flex-direction: row;
  }

  .big-buttons button {
    width: auto;
  }

  .hero-meta {
    width: 100%;
    justify-content: flex-start;
  }


}

