/* =========================================================
   EDUHUNT V2.1.19 — PWA / SCHOOL HEADER / VIDEO PLAYLIST UX
   - UI-only except browser install/service-worker support.
   - No database, role, result, upload or permission logic changed.
========================================================= */

/* ---------- One-time install promotion ---------- */
.install-offer[hidden]{display:none!important}
.install-offer{
  position:fixed;inset:0;z-index:2147483000;
  display:flex;align-items:center;justify-content:center;
  padding:18px;background:rgba(1,10,20,.72);
  -webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);
  opacity:0;transition:opacity .18s ease;
}
.install-offer.show{opacity:1}
.install-offer-card{
  width:min(560px,100%);display:grid;grid-template-columns:86px 1fr;gap:16px;
  padding:20px;border:1px solid #315a78;border-radius:22px;
  background:linear-gradient(155deg,#07192d,#0a2944);color:#f7fbff;
  box-shadow:0 28px 80px rgba(0,0,0,.48);
}
.install-offer-card img{
  width:74px;height:74px;object-fit:contain;border-radius:24px;
  box-shadow:0 8px 24px rgba(0,0,0,.25);background:#fff;
}
.install-offer-copy .eyebrow{color:#45e7dc!important;font-size:10px!important;letter-spacing:.12em}
.install-offer-copy h2{margin:4px 0 7px;color:#fff;font-size:23px;line-height:1.15}
.install-offer-copy p{margin:0;color:#b9cbe0;font-size:14px;line-height:1.55}
.install-offer-actions{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:2px}
.install-offer-actions .button{min-height:48px}
@media(max-width:560px){
  .install-offer{align-items:flex-end;padding:10px}
  .install-offer-card{grid-template-columns:64px 1fr;padding:16px;border-radius:20px}
  .install-offer-card img{width:58px;height:58px;border-radius:18px}
  .install-offer-copy h2{font-size:19px}
  .install-offer-copy p{font-size:12px}
}

/* ---------- Principal/Teacher/Student school context in the app header ---------- */
@media screen and (max-width:1024px){
  body[data-portal-role] .topbar-actions{
    display:flex!important;align-items:center!important;gap:7px!important;
  }
  body[data-portal-role="PRINCIPAL"] .topbar-title>span,
  body[data-portal-role="TEACHER"] .topbar-title>span,
  body[data-portal-role="STUDENT"] .topbar-title>span{
    display:block!important;visibility:visible!important;opacity:1!important;
    max-width:min(52vw,390px)!important;margin:0 0 2px!important;
    overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;
    color:#58e8df!important;font-size:13px!important;line-height:1.15!important;
    font-weight:900!important;letter-spacing:.015em!important;text-transform:none!important;
  }
  body[data-portal-role="PRINCIPAL"] .topbar-title>span{font-size:14px!important;color:#fff!important}
  body[data-portal-role] .topbar-title h1{max-width:min(47vw,390px)!important}

  /* The older Principal mobile shell hid these actions. Override it deliberately. */
  body[data-portal-role="PRINCIPAL"] .topbar-actions{display:flex!important}
  body[data-portal-role="PRINCIPAL"] #globalRefresh,
  body[data-portal-role="PRINCIPAL"] #accountButton{display:grid!important}
}

/* ---------- Smaller Principal dashboard KPI cards ---------- */
@media screen and (max-width:1024px){
  body[data-portal-role="PRINCIPAL"] .kpi-grid{gap:8px!important}
  body[data-portal-role="PRINCIPAL"] .kpi-card{
    min-height:92px!important;padding:10px 12px!important;border-radius:13px!important;
  }
  body[data-portal-role="PRINCIPAL"] .kpi-card .kpi-top{min-height:28px!important}
  body[data-portal-role="PRINCIPAL"] .kpi-card .kpi-icon{
    width:33px!important;height:33px!important;border-radius:9px!important;
  }
  body[data-portal-role="PRINCIPAL"] .kpi-card .kpi-icon svg{width:18px!important;height:18px!important}
  body[data-portal-role="PRINCIPAL"] .kpi-card b{margin-top:7px!important;font-size:24px!important}
  body[data-portal-role="PRINCIPAL"] .kpi-card>span{margin-top:2px!important;font-size:11px!important}
  body[data-portal-role="PRINCIPAL"] .kpi-card::after{width:70px!important;height:70px!important;right:-20px!important;bottom:-24px!important}
}
@media screen and (max-width:560px){
  body[data-portal-role="PRINCIPAL"] .kpi-card{min-height:86px!important;padding:9px 11px!important}
  body[data-portal-role="PRINCIPAL"] .kpi-card b{font-size:22px!important}
}

/* ---------- Complete playlist controls ---------- */
.edu-video-controls{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;
  padding:10px 10px 0;
}
.edu-video-controls .button{min-width:0!important;justify-content:center!important}
.edu-video-playlist-note{
  margin:8px 10px 11px;padding:9px 11px;border:1px solid #315a78;border-radius:10px;
  background:#09233b;color:#bcd0e3;font-size:12px;font-weight:700;line-height:1.4;
}
@media(max-width:560px){
  .edu-video-controls{grid-template-columns:1fr 1fr}
  .edu-video-controls .button:last-child{grid-column:1/-1}
}

/* ---------- Logout confirmation ---------- */
.logout-confirm-copy{display:grid;justify-items:center;gap:10px;padding:6px 4px 2px;text-align:center}
.logout-confirm-copy p{margin:0;color:#56677c;font-size:14px;line-height:1.5}
.logout-confirm-icon{
  width:58px;height:58px;display:grid;place-items:center;border-radius:18px;
  background:#fff0f1;color:#c43745;
}
.logout-confirm-icon svg{width:28px;height:28px;fill:none;stroke:currentColor;stroke-width:1.9}

/* Profile keeps the actual logout action at the bottom only. */
.profile-logout-card{margin-top:14px!important}
