/* =========================
   VsimPPTX Reflection Styles (Teacher + Student)
   Safe variables + Dark/Light theme
   ========================= */

:root{
  --bg-main: #0e1e32;
  --bg-panel: rgba(255,255,255,0.06);
  --bg-card: rgba(255,255,255,0.08);

  --text-main: #ffffff;
  --text-muted: rgba(255,255,255,0.65);

  --border-soft: rgba(255,255,255,0.12);
  --accent: #34b562;

  /* aliases (у тебе по коду багато var(--bg) / var(--text) / var(--muted)) */
  --bg: var(--bg-main);
  --panel: var(--bg-panel);
  --card: var(--bg-card);
  --text: var(--text-main);
  --muted: var(--text-muted);
  --border: var(--border-soft);

  /* mood / audio visuals */
  --bgTint: 0.10;
  --bgPulse: 0.00;
  --moodRGB: 50,181,97;
  --danger:#ff004e;
}


/* light theme */
body.theme-light{
  --bg-main: #f4f7fb;
  --bg-panel: #ffffff;
  --bg-card: rgba(255,255,255,0.92);

  --text-main: #0c1d30;
  --text-muted: rgba(12,29,48,0.62);

  --border-soft: rgba(12,29,48,0.12);

  --bg: var(--bg-main);
  --panel: var(--bg-panel);
  --card: var(--bg-card);
  --text: var(--text-main);
  --muted: var(--text-muted);
  --border: var(--border-soft);
}


/* ====== global anti-seams / anti-white-strip ====== */
html, body{
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  height: 100%;
  background: var(--bg);
}

body.bg{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Single fixed background layer (prevents “line seam”) */
body.bg::before{
  content:"";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1200px 700px at 18% 16%, rgba(var(--moodRGB), calc(var(--bgTint) + var(--bgPulse))), transparent 58%),
    radial-gradient(1000px 650px at 80% 25%, rgba(43,92,158,0.18), transparent 55%),
    radial-gradient(900px 640px at 42% 78%, rgba(50,181,97,0.14), transparent 60%),
    var(--bg);
  transform: translateZ(0);
}


/* Light theme background for the fixed layer */
body.theme-light.bg::before{
  background:
    radial-gradient(900px 520px at 18% 28%, rgba(50,181,97,0.14) 0%, rgba(255,255,255,0) 62%),
    radial-gradient(880px 520px at 72% 24%, rgba(43,92,158,0.14) 0%, rgba(255,255,255,0) 60%),
    radial-gradient(980px 620px at 50% 84%, rgba(12,29,48,0.06) 0%, rgba(255,255,255,0) 55%),
    linear-gradient(180deg, #f4f7fb 0%, #eef3f9 100%);
}

/* Hard-disable any other pseudo overlays that might create seams */
.bg::after,
.container::before, .container::after,
.card::before, .card::after{
  content:none !important;
  display:none !important;
}

/* ===== layout ===== */
.container{ max-width: 1320px; margin: 16px auto; padding: 0 14px; }

.topbar{
  position: sticky; top:0; z-index: 9999;
  display:flex; justify-content:space-between; align-items:center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(14,30,50,0.78);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(233,238,247,0.10);
}
body.theme-light .topbar{
  background: rgba(255,255,255,0.76);
  border-bottom-color: rgba(12,29,48,0.10);
}

.brand{ display:flex; align-items:center; gap:10px; min-width: 240px; }
.brand-logo{ width: 34px; }
.brand-title{ font-weight: 900; color: var(--text); }
.brand-subtitle{ font-size:12px; color: var(--muted); font-weight:700; }

.top-actions{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap: wrap;
  justify-content:flex-end;
}

.card{
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.22);
}
body.theme-light .card{
  box-shadow: 0 12px 28px rgba(12,29,48,0.10);
}

.teacher-grid{
  display:grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 14px;
  align-items:start;
}
@media (max-width: 980px){
  .teacher-grid{ grid-template-columns: 1fr; }
}

.h1{ margin: 0 0 8px; font-size: 26px; color: var(--text); }
.h2{ font-weight: 900; margin: 14px 0 10px; color: var(--text); }

.muted{ color: var(--muted); }
.small{ font-size: 12px; }

/* ===== buttons ===== */
.btn{
  border-radius: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(233,238,247,0.14);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  font-weight: 900;
  cursor:pointer;
  white-space: nowrap;
}
.btn:hover{ border-color: rgba(50,181,97,0.28); background: rgba(255,255,255,0.075); }
.btn:active{ transform: scale(0.99); }

body.theme-light .btn{
  background: rgba(12,29,48,0.06);
  border-color: rgba(12,29,48,0.14);
  color: var(--text);
}
body.theme-light .btn:hover{
  background: rgba(12,29,48,0.09);
}

/* ===== stage ===== */
.stage-wrap{
  position:relative;
  border-radius: 16px;
  overflow:hidden;
  border: 1px solid rgba(233,238,247,0.10);
  background: rgba(0,0,0,0.18);
}
body.theme-light .stage-wrap{
  background: rgba(12,29,48,0.04);
  border-color: rgba(12,29,48,0.10);
}

#swarm{ width:100%; height:auto; display:block; }

.stage-badge{
  position:absolute;
  left: 12px; bottom: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(14,30,50,0.55);
  border: 1px solid rgba(233,238,247,0.10);
  color: rgba(233,238,247,0.82);
}
body.theme-light .stage-badge{
  background: rgba(255,255,255,0.75);
  border-color: rgba(12,29,48,0.10);
  color: rgba(12,29,48,0.78);
}

.hint{ margin-top: 10px; }

.qrbox{ display:flex; flex-direction:column; align-items:center; gap:10px; }
.qr-clickable{ cursor: zoom-in; }
#qrcode canvas, #qrcode img{ display:block; }

.summary{ margin-top: 8px; }
.list{ display:flex; flex-direction:column; gap:10px; margin-top: 10px; }

.rowline{
  display:flex; align-items:center; justify-content:space-between;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(233,238,247,0.12);
  background: rgba(255,255,255,0.05);
}
body.theme-light .rowline{
  border-color: rgba(12,29,48,0.10);
  background: rgba(12,29,48,0.04);
}

.rowline .left{ display:flex; align-items:center; gap:10px; font-weight: 900; color: var(--text); }

.rowline .val{
  min-width: 36px;
  text-align:center;
  font-weight: 900;
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(43,92,158,0.22);
  border: 1px solid rgba(43,92,158,0.30);
  color: var(--text);
}
body.theme-light .rowline .val{
  background: rgba(43,92,158,0.12);
  border-color: rgba(43,92,158,0.22);
}

/* ===== bottom panel ===== */
.panelbar{ margin-top: 14px; padding-top: 12px; }
.panelbar-title{ font-weight: 900; margin-bottom: 10px; color: var(--text); text-align:center; }
.panel-actions-row{
  display:flex;
  flex-wrap: wrap;
  gap:10px;
  align-items:center;
  justify-content:center; /* center like you asked */
}
.pbtn{
  display:flex; align-items:center; justify-content:center; gap:10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(233,238,247,0.14);
  background: rgba(255,255,255,0.06);
  color: rgba(233,238,247,0.92);
  font-weight: 900;
  cursor:pointer;
}
.pbtn:hover{ border-color: rgba(50,181,97,0.28); background: rgba(255,255,255,0.085); }
.pbtn:active{ transform: scale(0.99); }
body.theme-light .pbtn{
  border-color: rgba(12,29,48,0.14);
  background: rgba(12,29,48,0.06);
  color: rgba(12,29,48,0.92);
}

.undo-wide{ padding: 12px 16px; }
.panelbar-hint{ margin-top: 10px; text-align:center; }

/* ===== QR modal ===== */
.qr-modal{ position: fixed; inset:0; z-index: 99999; }
.qr-modal-backdrop{ position:absolute; inset:0; background: rgba(10,18,30,0.85); backdrop-filter: blur(4px); }
.qr-modal-content{ position:relative; height:100%; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:14px; }
.qr-modal-content canvas, .qr-modal-content img{ width: min(80vw, 440px); height:auto; }
.qr-modal-hint{ color: rgba(233,238,247,0.75); font-size: 14px; }

/* =========================
   STUDENT (you said: do not touch logic; only polish)
   ========================= */

.student .container{
  max-width: 560px;
  margin: 0 auto;
  padding: 14px 12px calc(18px + env(safe-area-inset-bottom));
}

.student .student-card{ padding: 14px; }
.student .brandline{ margin-bottom: 10px; }
.student .brand-logo-sm{ width: 26px; }
.student .h1{ font-size: 22px; line-height: 1.15; margin: 6px 0 8px; }

.student p.muted{ margin: 0 0 10px; font-size: 14px; }

.student .mood-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
  margin-top: 10px;
}

.student .mood-btn{
  min-height: 54px;
  padding: 12px 10px;
  border-radius: 16px;
  font-size: 16px;
  line-height: 1;
  justify-content: center;
  gap: 10px;

  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  backdrop-filter: blur(6px);
  transition: all .18s ease;
}
.student .mood-btn:hover{ background: rgba(255,255,255,0.14); }
.student .mood-btn:active{
  transform: scale(0.97);
  background: rgba(50,181,97,0.25);
  border-color: rgba(50,181,97,0.6);
}
.student .mood-btn span{
  font-size: 14px;
  opacity: 0.92;
  white-space: nowrap;
  color: #eaf2ff;
}

.student .mood-wide{ grid-column: 1 / -1; }

.student .mood-btn.mood-wide{
  background: linear-gradient(135deg, rgba(50,181,97,0.35), rgba(50,181,97,0.18));
  border-color: rgba(50,181,97,0.7);
}

@media (max-width: 360px){
  .student .mood-grid{ grid-template-columns: 1fr; }
  .student .mood-wide{ grid-column: auto; }
  .student .mood-btn span{ white-space: normal; }
}

.student .toast{
  margin-top: 12px;
  font-size: 14px;
  padding: 10px 12px;
}

/* danger — однаковий у темній і світлій */
.btn.danger{
  background: rgba(255,0,78,0.12);
  border-color: rgba(255,0,78,0.32);
  color: #ffffff; /* білий текст */
}

.btn.danger:hover{
  background: rgba(255,0,78,0.18);
}

/* light theme: НЕ змінюємо danger */
body.theme-light .btn.danger{
  background: rgba(255,0,78,0.12);
  border-color: rgba(255,0,78,0.32);
  color: #0c1d30;
}

body.theme-light .btn.danger:hover{
  background: rgba(255,0,78,0.18);
}



/* кнопка-назад — не лінк */
a.btn{
  text-decoration: none;
}

a.btn:hover,
a.btn:focus,
a.btn:active,
a.btn:visited{
  text-decoration: none;
}

.back-btn{
  color: inherit;
}
.back-btn:hover{
  background: rgba(255,255,255,0.06);
}
.light .back-btn:hover{
  background: rgba(12,29,48,0.05);
}
