.console-body { margin: 0; background: #14161f; color: #f1f5f9; font-family: "Kanit", "Segoe UI", "Sarabun", sans-serif; }
.console { display: flex; flex-direction: column; height: 100vh; }

.console-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: #1f2430;
  border-bottom: 1px solid #2d3344;
}
.console-title { font-weight: 700; font-size: 16px; flex: 1; }
.console-controls { display: flex; gap: 8px; }
.console-controls .btn { background: #2d3344; color: #f1f5f9; border-color: #3a4156; }
.console-controls .btn-warn { background: #453014; color: #fbbf24; border-color: #92400e; }
.console-controls .btn-danger { background: #3f1d1d; color: #f87171; border-color: #7f1d1d; }
.console-controls .btn-accent { background: #064e3b; color: #34d399; border-color: #065f46; }
.console-controls .btn-active { outline: 2px solid #4f46e5; }

.console-body-grid {
  display: flex;
  flex: 1;
  min-height: 0;
}

.console-sidebar {
  width: 320px;
  overflow-y: auto;
  border-right: 1px solid #2d3344;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.slide-item {
  text-align: left;
  background: var(--item-color, #1f2430);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 4px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 10px 12px;
  color: #e5e7eb;
  cursor: pointer;
  transition: filter 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.slide-item:hover { filter: brightness(1.18); }
.slide-item.active {
  border-left-color: #60a5fa;
  box-shadow: 0 0 0 2px #60a5fa, 0 4px 14px rgba(0, 0, 0, 0.45);
  color: #fff;
  filter: brightness(1.12);
}
.slide-item-label { font-size: 12px; font-weight: 700; color: #cfe0ff; margin-bottom: 4px; text-shadow: 0 1px 2px rgba(0,0,0,0.4); }
.slide-item-text { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: rgba(255,255,255,0.85); }

/* Inline "pick a local file" control shown on slides that play a video/image
   straight from the operator's computer (not uploaded to the server). */
.slide-item-local-btn {
  display: block;
  margin-top: 6px;
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 6px;
  border: 1px dashed rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.06);
  color: #fbbf24;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.slide-item-local-btn:hover { background: rgba(255,255,255,0.14); }
.slide-item-local-btn.picked { color: #34d399; border-style: solid; border-color: rgba(52,211,153,0.5); }

/* Inline เล่น/พัก/หยุด สำหรับวีดีโอเต็มจอ (media/local) เพราะไม่เล่นอัตโนมัติแล้ว
   ต้องกดจากตรงนี้เพื่อเริ่ม/หยุดวีดีโอ ทั้งในพรีวิวและจอฉายพร้อมกัน */
.slide-item-video-controls {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.slide-item-video-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: #e5e7eb;
  cursor: pointer;
}
.slide-item-video-btn:hover { background: rgba(255,255,255,0.2); }

.console-preview {
  flex: 1;
  padding: 24px;
  display: flex;
  flex-direction: column;
}
.preview-label { font-size: 12px; color: #94a3b8; margin-bottom: 8px; text-transform: uppercase; }
.preview-frame {
  position: relative;
  flex: 1;
  background: #000 center/cover no-repeat;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  border: 1px solid #2d3344;
  overflow: hidden;
  /* lets us size the text relative to the preview box itself (below),
     the same way display.php sizes text relative to the real screen */
  container-type: inline-size;
}
.preview-frame.preview-black { background: #000; }

#previewVideo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  display: none;
}
.preview-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 0;
}
.preview-text {
  position: relative;
  z-index: 1;
  color: #fff;
  font-weight: 700;
  font-size: 2.2vw;
  line-height: 1.5;
  text-align: center;
  white-space: pre-wrap;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.9);
}
/* Match display.php proportions exactly (5vw text / 5vw padding), scaled to
   the preview box's own width instead of the full screen. Browsers without
   container query unit support simply keep the vw-based fallback above. */
@supports (width: 1cqw) {
  .preview-frame { padding: 5cqw; }
  .preview-text { font-size: 5cqw; }
}
