/* ==========================================================
   CSS PRESENTASI UTAMA PID (PAPAN INTERAKTIF DIGITAL)
   Guru: Ibu Ela Setyani Dian Palupi, S.Sos
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
  --primary-color: #0284c7;
  --primary-dark: #0369a1;
  --accent-orange: #f97316;
  --accent-amber: #f59e0b;
  --accent-green: #10b981;
  --bg-dark: #0f172a;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --slide-aspect-ratio: 16 / 9;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  font-family: 'Poppins', sans-serif;
  color: #fff;
}

/* Container Presentasi Utama */
.presentation-app {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 50% 20%, #1e293b 0%, #0f172a 100%);
  position: relative;
}

/* Header Bar Kontrol */
.top-toolbar {
  height: 52px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  z-index: 50;
  transition: opacity 0.3s ease;
}

.presentation-app.fullscreen-active .top-toolbar {
  opacity: 0.15;
}
.presentation-app.fullscreen-active .top-toolbar:hover {
  opacity: 1;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.school-badge {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.presentation-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #f1f5f9;
}

.toolbar-center {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.slide-counter {
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tool-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.tool-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  transform: translateY(-1px);
}

.tool-btn:active {
  transform: scale(0.95);
}

/* Area Tampilan Slide (Stage) */
.stage-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  position: relative;
  overflow: hidden;
  min-height: 0;
  min-width: 0;
}

/* Frame 16:9 Responsif - Pas untuk Layar Laptop dan IFP */
.slide-frame {
  height: 100%;
  max-height: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  background: #020617;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.12);
  position: relative;
  margin: auto;
}

/* Iframe Slide */
.slide-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Mode Layar Penuh Maksimal (PID Fullscreen) */
:fullscreen .presentation-app,
:-webkit-full-screen .presentation-app,
.presentation-app.fullscreen-active {
  background: #000000;
}

:fullscreen .top-toolbar,
:-webkit-full-screen .top-toolbar,
.presentation-app.fullscreen-active .top-toolbar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 60;
}

:fullscreen .top-toolbar:hover,
:-webkit-full-screen .top-toolbar:hover,
.presentation-app.fullscreen-active .top-toolbar:hover {
  opacity: 1;
  pointer-events: auto;
}

:fullscreen .stage-container,
:-webkit-full-screen .stage-container,
.presentation-app.fullscreen-active .stage-container {
  padding: 0;
  width: 100vw;
  height: 100vh;
}

:fullscreen .slide-frame,
:-webkit-full-screen .slide-frame,
.presentation-app.fullscreen-active .slide-frame {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  aspect-ratio: auto;
  border-radius: 0;
  box-shadow: none;
}

/* Floating Fullscreen Trigger Button di Pojok Layar */
.floating-fullscreen-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 9999px;
  cursor: pointer;
  z-index: 55;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.floating-fullscreen-btn:hover {
  background: #0284c7;
  transform: scale(1.05);
}

/* Tombol Navigasi Mengambang (PID Friendly) */
.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 40;
  transition: all 0.25s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.nav-btn:hover {
  background: rgba(2, 132, 199, 0.85);
  border-color: #38bdf8;
  transform: translateY(-50%) scale(1.1);
}

.nav-btn:active {
  transform: translateY(-50%) scale(0.92);
}

.nav-prev {
  left: 20px;
}

.nav-next {
  right: 20px;
}

.nav-btn svg {
  width: 24px;
  height: 24px;
}

/* Progress Bar Bawah */
.progress-bar-container {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  width: 100%;
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: 50;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #f59e0b);
  width: 25%;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================
   MODAL AWALAN IZIN KAMERA IFP (ANTI OVERLAY / PRE-FULLSCREEN)
   ========================================================== */
.initial-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 29, 0.88);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.initial-modal-overlay.hidden-modal {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.initial-modal-card {
  background: linear-gradient(145deg, #1e293b, #0f172a);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 1.5rem;
  max-width: 580px;
  width: 100%;
  padding: 2rem 2.25rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75), 0 0 35px rgba(2, 132, 199, 0.2);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  animation: cardPopIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardPopIn {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-badge-top {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 4px 12px;
  border-radius: 9999px;
  margin-bottom: 0.75rem;
}

.modal-cam-icon {
  font-size: 2.75rem;
  line-height: 1;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 4px 12px rgba(245, 158, 11, 0.4));
}

.modal-title {
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.25rem;
}

.modal-subtitle {
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 500;
  margin-bottom: 1rem;
}

.modal-message-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.25rem;
  font-size: 0.82rem;
  color: #cbd5e1;
  line-height: 1.5;
  text-align: left;
}

.modal-message-box .text-highlight {
  color: #fbbf24;
  font-weight: 600;
}

.cam-preview-box {
  width: 220px;
  height: 125px;
  border-radius: 0.85rem;
  overflow: hidden;
  position: relative;
  background: #000;
  border: 2px solid #10b981;
  margin-bottom: 1rem;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.cam-preview-box video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.preview-badge {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(6, 78, 59, 0.95);
  color: #6ee7b7;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  white-space: nowrap;
}

.modal-btn-row {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
}

.btn-primary-action {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #ffffff;
  border: none;
  border-radius: 9999px;
  padding: 0.85rem 1.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 20px rgba(2, 132, 199, 0.4);
  transition: all 0.2s ease;
}

.btn-primary-action:hover {
  background: linear-gradient(135deg, #0369a1, #1d4ed8);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(2, 132, 199, 0.6);
}

.btn-primary-action:active {
  transform: scale(0.97);
}

.btn-primary-action.success {
  background: linear-gradient(135deg, #059669, #10b981);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
}

.btn-secondary-action {
  background: transparent;
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  padding: 0.65rem 1.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary-action:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.05);
}

.overlay-help-card {
  margin-top: 1.25rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 0.85rem;
  padding: 0.85rem 1rem;
  text-align: left;
  font-size: 0.76rem;
  color: #fca5a5;
  line-height: 1.45;
  width: 100%;
}

.help-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  color: #f87171;
  margin-bottom: 0.4rem;
}

.help-steps {
  padding-left: 1.2rem;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
