﻿/* ==========================================================
   سينما الشروحات — Video Theater (matches approved mockup)
   ========================================================== */
.video-islands-open{overflow:hidden}

.video-theater-modal{
  --vt-sky:#0EA5E9;--vt-sky-dark:#0369A1;--vt-gold:#FBBF24;--vt-gold-dark:#D97706;
  --vt-green:#10B981;--vt-green-dark:#047857;--vt-ink:#0F172A;--vt-muted:#64748B;
  position:fixed;inset:0;z-index:12000;display:none;place-items:center;padding:16px;
  background:radial-gradient(circle at 20% 20%,rgba(125,211,252,.55),transparent 45%),
             radial-gradient(circle at 80% 80%,rgba(196,181,253,.45),transparent 45%),
             linear-gradient(160deg,#EFF6FF,#F5F3FF);
  font-family:"Cairo","Tajawal",sans-serif;line-height:1.6;overflow:auto;
}
.video-theater-shell{
  display:flex;flex-direction:column;
  width:min(1480px,100%);height:min(900px,calc(100dvh - 24px));
  border-radius:28px;overflow:hidden;
  background:#fff;
  box-shadow:0 24px 64px rgba(15,23,42,.22),0 0 0 3px rgba(255,255,255,.9);
  animation:vtPop .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes vtPop{from{opacity:0;transform:scale(.95) translateY(12px)}to{opacity:1;transform:none}}

/* ---- Header ---- */
.theater-header{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:16px 24px;flex-shrink:0;
  background:linear-gradient(120deg,#38BDF8,#818CF8);
  color:#fff;
}
.theater-header h2{
  flex:1;margin:0;text-align:center;
  font-size:clamp(20px,2.5vw,28px);font-weight:900;
  text-shadow:0 2px 0 rgba(0,0,0,.12);
}
.theater-header-spacer{width:54px;flex-shrink:0}
.theater-close{
  display:grid;place-items:center;width:54px;height:54px;flex-shrink:0;
  border:0;border-radius:50%;
  background:linear-gradient(180deg,#F87171,#E11D48);
  color:#fff;font-size:22px;font-weight:900;cursor:pointer;
  box-shadow:0 5px 0 #9F1239,0 8px 14px rgba(0,0,0,.18);
  transition:transform .12s,box-shadow .12s;
}
.theater-close:hover{transform:rotate(90deg) translateY(-2px)}
.theater-close:active{transform:translateY(4px);box-shadow:0 1px 0 #9F1239}

/* ---- Filters ---- */
.theater-filters{
  display:flex;flex-direction:column;gap:10px;
  padding:14px 20px 8px;background:#F8FAFC;
  border-bottom:2px solid #E2E8F0;flex-shrink:0;
}
.video-filter-tags,.video-table-bubbles{
  display:flex;gap:10px;overflow-x:auto;padding-bottom:4px;
  scrollbar-width:thin;
}
.video-table-bubbles[hidden]{display:none}
/* Category pills — large white buttons with emoji */
.video-tag-btn{
  flex-shrink:0;display:inline-flex;align-items:center;gap:6px;
  min-height:52px;padding:10px 20px;
  border:2.5px solid #E2E8F0;border-radius:999px;
  background:#fff;color:var(--vt-ink);
  font:800 15px "Cairo","Tajawal",sans-serif;cursor:pointer;
  box-shadow:0 4px 0 #CBD5E1;
  transition:transform .15s,box-shadow .15s;white-space:nowrap;
}
.video-tag-btn:hover{transform:translateY(-2px)}
.video-tag-btn:active{transform:translateY(3px);box-shadow:0 1px 0 #CBD5E1}
.video-tag-btn.active{
  color:#fff;
  background:linear-gradient(180deg,#38BDF8,#0284C7);
  border-color:#7DD3FC;
  box-shadow:0 5px 0 #0369A1,0 8px 18px rgba(14,165,233,.4);
}
/* Table number bubbles */
.table-bubble{
  --c1:#38BDF8;--c2:#0284C7;--cs:#0369A1;
  flex-shrink:0;display:grid;place-items:center;
  width:52px;height:52px;padding:0;
  border:3px solid rgba(255,255,255,.85);border-radius:50%;
  color:#fff;font:900 20px "Cairo","Tajawal",sans-serif;
  cursor:pointer;
  background:radial-gradient(circle at 35% 30%,rgba(255,255,255,.5),transparent 35%),
             linear-gradient(180deg,var(--c1),var(--c2));
  box-shadow:0 5px 0 var(--cs),0 8px 12px rgba(0,0,0,.14);
  transition:transform .15s,box-shadow .15s;
}
.table-bubble.all{width:auto;padding:0 18px;border-radius:999px;font-size:15px;--c1:#94A3B8;--c2:#64748B;--cs:#475569}
.table-bubble:hover{transform:translateY(-3px) scale(1.08)}
.table-bubble:active{transform:translateY(4px);box-shadow:0 1px 0 var(--cs)}
.table-bubble.active{border-color:#FDE68A;box-shadow:0 5px 0 var(--cs),0 0 0 4px rgba(251,191,36,.5)}
/* Table colours */
.video-theater-modal .c1,.video-theater-modal .c6{--c1:#38BDF8;--c2:#0284C7;--cs:#0369A1}
.video-theater-modal .c2,.video-theater-modal .c7{--c1:#FCD34D;--c2:#F59E0B;--cs:#B45309}
.video-theater-modal .c3,.video-theater-modal .c8{--c1:#34D399;--c2:#059669;--cs:#047857}
.video-theater-modal .c4,.video-theater-modal .c9{--c1:#FB923C;--c2:#EA580C;--cs:#9A3412}
.video-theater-modal .c5,.video-theater-modal .c10{--c1:#A78BFA;--c2:#7C3AED;--cs:#5B21B6}
.video-theater-modal .c11{--c1:#F472B6;--c2:#DB2777;--cs:#9D174D}
.video-theater-modal .c12{--c1:#2DD4BF;--c2:#0D9488;--cs:#115E59}

/* ---- Body: compact playlist | large video stage ---- */
.theater-body{
  flex:1;min-height:0;
  display:grid;grid-template-columns:minmax(300px,360px) minmax(0,1fr);
  grid-template-areas:"playlist stage";direction:ltr;
}

/* Playlist */
.theater-playlist{
  grid-area:playlist;direction:rtl;
  display:flex;flex-direction:column;min-height:0;
  border-left:2px solid #E2E8F0;
}
.playlist-progress{
  padding:12px 16px;background:linear-gradient(180deg,#FFFBEB,#FEF3C7);
  border-bottom:2px solid #FDE68A;flex-shrink:0;
}
.playlist-progress-head{
  display:flex;align-items:center;justify-content:space-between;
  gap:8px;margin-bottom:8px;color:#92400E;font-weight:900;font-size:15px;
}
.playlist-progress-head b{
  padding:2px 10px;border-radius:999px;background:#fff;color:var(--vt-muted);font-size:12px;
}
.playlist-progress-track{
  height:12px;border-radius:999px;background:#FDE68A;overflow:hidden;
}
.playlist-progress-track i{
  display:block;height:100%;width:0;border-radius:inherit;
  background:linear-gradient(90deg,#FBBF24,#F59E0B,#FBBF24);background-size:200% 100%;
  box-shadow:0 0 10px rgba(251,191,36,.7);
  transition:width .6s cubic-bezier(.34,1.56,.64,1);animation:vtShine 2s linear infinite;
}

/* Playlist cards */
.video-grid-list{
  flex:1;min-height:0;display:flex;flex-direction:column;
  gap:10px;padding:12px;overflow-y:auto;scrollbar-width:thin;
}
.video-item-card{
  position:relative;display:grid;
  grid-template-columns:110px minmax(0,1fr) 36px;
  align-items:center;gap:12px;
  width:100%;min-height:88px;padding:10px;
  border:2.5px solid transparent;border-radius:18px;
  color:var(--vt-ink);background:#fff;text-align:right;
  font-family:inherit;cursor:pointer;
  box-shadow:0 4px 0 #E2E8F0,0 6px 14px rgba(15,23,42,.05);
  transition:transform .15s,box-shadow .15s,border-color .15s;flex-shrink:0;
}
.video-item-card:hover{transform:translateY(-2px);border-color:#BAE6FD;box-shadow:0 6px 0 #BAE6FD}
.video-item-card:active{transform:translateY(2px);box-shadow:0 2px 0 #E2E8F0}
.video-item-card.active{
  border-color:#FBBF24;
  background:linear-gradient(135deg,#FFFBEB,#FEF9C3);
  box-shadow:0 5px 0 #D97706,0 0 0 4px rgba(251,191,36,.22),0 10px 20px rgba(245,158,11,.25);
}
/* Thumbnail */
.vc-thumb{
  --c1:#38BDF8;--c2:#6366F1;
  position:relative;display:grid;place-items:center;
  aspect-ratio:16/10;width:110px;overflow:hidden;border-radius:12px;
  background:linear-gradient(135deg,var(--c1),var(--c2));flex-shrink:0;
}
.vc-thumb-icon{font-size:32px}
.vc-thumb img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.vc-play{
  position:absolute;display:grid;place-items:center;
  width:36px;height:36px;border-radius:50%;
  background:rgba(255,255,255,.9);color:var(--vt-sky-dark);
  font-size:14px;box-shadow:0 3px 8px rgba(0,0,0,.22);
  transition:transform .2s;
}
.video-item-card:hover .vc-play{transform:scale(1.15)}
.video-item-card.active .vc-play{background:#F59E0B;color:#fff;animation:vtPulse 1.2s ease-in-out infinite}
.vc-now{position:absolute;bottom:4px;right:4px;padding:1px 7px;border-radius:999px;color:#fff;background:rgba(217,119,6,.95);font-size:10px;font-weight:900}
/* Info */
.vc-info{display:flex;flex-direction:column;gap:4px;min-width:0}
.vc-badges{display:flex;flex-wrap:wrap;gap:4px}
.vc-badges .v-badge{padding:1px 8px;border-radius:999px;color:#6D28D9;background:#EDE9FE;font-size:11px;font-weight:900}
.vc-table{--c1:#38BDF8;--c2:#0284C7;padding:1px 8px;border-radius:999px;color:#fff;background:linear-gradient(180deg,var(--c1),var(--c2));font-size:11px;font-weight:900}
.vc-info strong{display:-webkit-box;overflow:hidden;font-size:15px;font-weight:900;line-height:1.45;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.vc-info small{display:-webkit-box;overflow:hidden;color:var(--vt-muted);font-size:12px;font-weight:600;-webkit-line-clamp:1;-webkit-box-orient:vertical}
/* Watch check */
.vc-check{display:grid;place-items:center;width:32px;height:32px;border-radius:50%;color:#94A3B8;background:#F1F5F9;font-size:14px}
.video-item-card.watched .vc-check{color:#fff;background:linear-gradient(180deg,#34D399,#059669);font-size:17px;box-shadow:0 3px 0 #047857}
.video-empty-filter{
  display:flex;flex-direction:column;align-items:center;gap:6px;
  padding:36px 16px;text-align:center;color:var(--vt-muted);
  font-weight:900;font-size:16px;
  border:3px dashed #C7D2FE;border-radius:18px;background:rgba(255,255,255,.8);
}
.video-empty-filter>span{font-size:40px}

/* ---- Stage (right panel) ---- */
.theater-stage{
  grid-area:stage;direction:rtl;
  display:flex;flex-direction:column;gap:16px;
  padding:20px;background:#F8FAFC;overflow-y:auto;
}
.theater-player-box{
  position:relative;display:grid;place-items:center;
  aspect-ratio:16/9;width:100%;overflow:hidden;border-radius:20px;
  border:5px solid #fff;
  background:linear-gradient(145deg,#E0F2FE,#EDE9FE);
  box-shadow:0 0 0 4px #FBBF24,0 12px 28px rgba(14,165,233,.22);flex-shrink:0;
}
.theater-player-box.has-video{
  background:#000;
  box-shadow:0 0 0 4px #38BDF8,0 0 0 8px rgba(251,191,36,.5),0 16px 36px rgba(14,165,233,.3);
}
.theater-player-box iframe,.theater-player-box video{display:block;width:100%;height:100%;border:0}
.theater-welcome{
  display:flex;flex-direction:column;align-items:center;gap:6px;
  padding:20px;text-align:center;color:var(--vt-ink);
}
.theater-welcome>span{font-size:56px;animation:vtFloat 2.6s ease-in-out infinite}
.theater-welcome h3{margin:6px 0 0;font-size:clamp(18px,2vw,24px);font-weight:900}
.theater-welcome p{margin:0 0 10px;color:var(--vt-muted);font-size:15px;font-weight:700}

/* Active video info */
.video-active-info{display:flex;flex-direction:column;gap:10px;padding:16px 18px;border-radius:20px;background:#fff;box-shadow:0 6px 20px rgba(99,102,241,.1)}
.video-active-info[hidden]{display:none!important}
.video-active-info h3{margin:0;color:var(--vt-ink);font-size:clamp(18px,2vw,22px);font-weight:900;line-height:1.4}
.video-active-info p{margin:0;color:var(--vt-muted);font-size:14px;font-weight:600;line-height:1.7}
.video-active-info p[hidden]{display:none}
.video-active-actions{display:flex;gap:10px;flex-wrap:wrap}
/* Green challenge button */
.kid-btn.theater-challenge-btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  flex:1;min-height:58px;padding:12px 20px;border:0;border-radius:18px;
  color:#fff;font:900 18px "Cairo","Tajawal",sans-serif;cursor:pointer;
  background:linear-gradient(180deg,#34D399,#059669);
  box-shadow:0 7px 0 #047857,0 12px 20px rgba(16,185,129,.35);
  animation:vtGlow 2.2s ease-in-out infinite;transition:transform .1s,box-shadow .1s;
}
.kid-btn.theater-challenge-btn:hover{transform:translateY(-2px)}
.kid-btn.theater-challenge-btn:active{transform:translateY(5px);box-shadow:0 2px 0 #047857}
/* Next button */
.theater-next-btn{
  display:inline-flex;align-items:center;gap:8px;
  min-height:52px;padding:10px 22px;
  border:2.5px solid #BAE6FD;border-radius:16px;
  color:var(--vt-sky-dark);background:#F0F9FF;
  font:900 16px "Cairo","Tajawal",sans-serif;cursor:pointer;
  box-shadow:0 5px 0 #7DD3FC;transition:transform .1s,box-shadow .1s;
}
.theater-next-btn:hover{transform:translateY(-2px)}
.theater-next-btn:active{transform:translateY(4px);box-shadow:0 1px 0 #7DD3FC}
.theater-next-btn[hidden]{display:none}

/* ---- Animations ---- */
@keyframes vtJelly{0%{transform:scale(1)}30%{transform:scale(1.12,.9)}50%{transform:scale(.94,1.06)}70%{transform:scale(1.04,.97)}100%{transform:scale(1)}}
@keyframes vtFloat{0%,100%{transform:translateY(0)}50%{transform:translateY(-8px)}}
@keyframes vtPulse{0%,100%{transform:scale(1)}50%{transform:scale(1.1)}}
@keyframes vtShine{from{background-position:200% 0}to{background-position:0 0}}
@keyframes vtGlow{0%,100%{box-shadow:0 7px 0 #047857,0 12px 20px rgba(16,185,129,.3)}50%{box-shadow:0 7px 0 #047857,0 12px 28px rgba(16,185,129,.6)}}
@keyframes vtStar{0%{opacity:1;transform:translate(-50%,-50%) scale(.3)}100%{opacity:0;transform:translate(calc(-50% + var(--dx)),calc(-50% + var(--dy))) scale(1.2) rotate(130deg)}}
.theater-star{position:absolute;top:50%;left:50%;font-size:20px;pointer-events:none;animation:vtStar .9s ease-out forwards}
@media(prefers-reduced-motion:reduce){.video-theater-modal *{animation:none!important;transition:none!important}}

/* ---- Responsive ---- */
@media(max-width:860px){
  .video-theater-modal{padding:0;place-items:stretch;display:none}
  .video-theater-shell{height:100dvh;border-radius:0;box-shadow:none}
  .theater-body{display:flex;flex-direction:column-reverse;overflow-y:auto}
  .theater-stage{flex-shrink:0;border-bottom:2px solid #E2E8F0}
  .theater-playlist{flex-shrink:0}
  .video-grid-list{overflow:visible;min-height:0}
  .theater-filters{padding:10px 12px 6px}
}
@media(max-width:520px){
  .theater-header{padding:12px 14px}
  .theater-header h2{font-size:20px}
  .video-tag-btn{font-size:13px;padding:8px 14px;min-height:44px}
  .table-bubble{width:44px;height:44px;font-size:17px}
  .video-item-card{grid-template-columns:90px minmax(0,1fr) 30px;gap:8px}
  .vc-thumb{width:90px}
  .vc-info strong{font-size:13px}
  .kid-btn.theater-challenge-btn{font-size:15px;min-height:50px}
}
