
/* ZOOM BAC 2027 — PREMIUM EFFECTS V1 */

/* ---------- Universal tactile buttons ---------- */
button,a{
  -webkit-tap-highlight-color:transparent;
}

.primary,.zoomLive,.danger,.subjectCard,.chapter,.topic,
.actions a,.actions button,.watched,.plansBtn{
  position:relative;
  overflow:hidden;
  transform:translateZ(0);
}

.primary,.zoomLive,.danger{
  transition:
    transform .18s cubic-bezier(.2,.8,.2,1),
    box-shadow .25s ease,
    filter .25s ease;
}

.primary:active,.zoomLive:active,.danger:active{
  transform:scale(.975) translateY(2px);
}

/* ---------- Main enter button ---------- */
#enterBtn{
  isolation:isolate;
  border:1px solid color-mix(in srgb,var(--accent2) 32%,transparent);
  box-shadow:
    0 13px 35px color-mix(in srgb,var(--accent) 20%,transparent),
    inset 0 1px 0 rgba(255,255,255,.25);
}

#enterBtn::before{
  content:"";
  position:absolute;
  z-index:-1;
  top:-70%;
  left:-35%;
  width:35%;
  height:240%;
  transform:rotate(24deg);
  background:linear-gradient(
    90deg,
    transparent,
    rgba(255,255,255,.32),
    transparent
  );
  animation:enterShine 4.2s ease-in-out infinite;
}

@keyframes enterShine{
  0%,58%{left:-45%;opacity:0}
  65%{opacity:1}
  83%,100%{left:125%;opacity:0}
}

/* ---------- Zoom button ---------- */
#zoomLiveBtn{
  border-color:rgba(72,150,255,.45)!important;
  box-shadow:
    0 12px 34px rgba(33,116,255,.12),
    inset 0 1px 0 rgba(255,255,255,.08);
}

#zoomLiveBtn::after{
  content:"";
  position:absolute;
  inset:-80% -20%;
  pointer-events:none;
  background:linear-gradient(
    110deg,
    transparent 35%,
    rgba(84,169,255,.13) 48%,
    rgba(255,255,255,.18) 50%,
    rgba(84,169,255,.13) 52%,
    transparent 65%
  );
  transform:translateX(-75%);
  animation:zoomSweep 4.8s ease-in-out infinite;
}

@keyframes zoomSweep{
  0%,60%{transform:translateX(-75%)}
  82%,100%{transform:translateX(75%)}
}

.zoomLogo{
  filter:drop-shadow(0 0 9px rgba(64,149,255,.45));
}

/* ---------- Important button ---------- */
#importantBtn{
  border-color:rgba(255,78,78,.55)!important;
  box-shadow:
    0 10px 32px rgba(230,45,52,.12),
    inset 0 1px 0 rgba(255,255,255,.07);
}

#importantBtn::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius:inherit;
  pointer-events:none;
  box-shadow:0 0 0 0 rgba(255,65,65,.30);
  animation:importantPulse 2.8s ease-out infinite;
}

@keyframes importantPulse{
  0%,35%{box-shadow:0 0 0 0 rgba(255,65,65,.28)}
  70%{box-shadow:0 0 0 10px rgba(255,65,65,0)}
  100%{box-shadow:0 0 0 0 rgba(255,65,65,0)}
}

#importantBtn svg{
  animation:warningFloat 2.6s ease-in-out infinite;
}

@keyframes warningFloat{
  0%,100%{transform:translateY(0)}
  50%{transform:translateY(-2px)}
}

/* ---------- Ripple ---------- */
.premiumRipple{
  position:absolute;
  border-radius:50%;
  pointer-events:none;
  transform:scale(0);
  background:rgba(255,255,255,.28);
  animation:premiumRipple .62s ease-out forwards;
  z-index:20;
}

@keyframes premiumRipple{
  to{
    transform:scale(4);
    opacity:0;
  }
}

/* ---------- Subject cards ---------- */
.subjectCard{
  transition:
    transform .22s cubic-bezier(.2,.8,.2,1),
    border-color .22s ease,
    box-shadow .22s ease;
}

.subjectCard:active{
  transform:scale(.975);
}

.subjectCard::after{
  content:"";
  position:absolute;
  inset:auto -15% -70% -15%;
  height:90%;
  pointer-events:none;
  background:radial-gradient(
    ellipse,
    color-mix(in srgb,var(--accent) 15%,transparent),
    transparent 70%
  );
}

/* ---------- Cinematic screen transitions ---------- */
.screen.premiumEnter{
  animation:premiumScreenIn .46s cubic-bezier(.16,.82,.26,1)!important;
}

.screen.premiumBack{
  animation:premiumScreenBack .36s cubic-bezier(.22,.75,.3,1)!important;
}

@keyframes premiumScreenIn{
  0%{
    opacity:0;
    transform:translateY(18px) scale(.985);
    filter:blur(5px);
  }
  100%{
    opacity:1;
    transform:none;
    filter:none;
  }
}

@keyframes premiumScreenBack{
  0%{
    opacity:0;
    transform:translateX(-16px) scale(.99);
    filter:blur(3px);
  }
  100%{
    opacity:1;
    transform:none;
    filter:none;
  }
}

/* ---------- Entry cinematic overlay ---------- */
#premiumPortalTransition{
  position:fixed;
  inset:0;
  z-index:9000;
  pointer-events:none;
  display:grid;
  place-items:center;
  opacity:0;
  visibility:hidden;
  background:
    radial-gradient(circle at center,
      color-mix(in srgb,var(--accent) 17%,transparent),
      transparent 30%),
    rgba(4,9,17,.55);
  backdrop-filter:blur(2px);
}

#premiumPortalTransition.run{
  visibility:visible;
  animation:portalTransition .48s ease forwards;
}

#premiumPortalTransition i{
  width:78px;
  height:78px;
  border-radius:50%;
  border:1px solid color-mix(in srgb,var(--accent) 65%,transparent);
  box-shadow:
    0 0 0 18px color-mix(in srgb,var(--accent) 5%,transparent),
    0 0 55px color-mix(in srgb,var(--accent) 30%,transparent);
  transform:scale(.35);
}

#premiumPortalTransition.run i{
  animation:portalCore .48s cubic-bezier(.2,.8,.2,1);
}

@keyframes portalTransition{
  0%{opacity:0}
  35%{opacity:1}
  100%{opacity:0}
}

@keyframes portalCore{
  0%{transform:scale(.25);opacity:.2}
  55%{transform:scale(1.15);opacity:1}
  100%{transform:scale(3);opacity:0}
}

/* ---------- Locked shake ---------- */
.premiumLockedShake{
  animation:premiumLockedShake .38s ease!important;
}

@keyframes premiumLockedShake{
  0%,100%{transform:translateX(0)}
  25%{transform:translateX(5px)}
  50%{transform:translateX(-5px)}
  75%{transform:translateX(3px)}
}

/* ---------- Sound control ---------- */
#premiumSoundBtn{
  position:fixed;
  left:16px;
  bottom:calc(18px + env(safe-area-inset-bottom));
  width:45px;
  height:45px;
  border-radius:15px;
  border:1px solid var(--line);
  background:color-mix(in srgb,var(--glass-strong) 92%,transparent);
  color:var(--text);
  display:grid;
  place-items:center;
  z-index:70;
  box-shadow:0 9px 30px rgba(0,0,0,.18);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
  transition:.2s ease;
}

#premiumSoundBtn:active{
  transform:scale(.91);
}

#premiumSoundBtn svg{
  width:20px;
  height:20px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}

#premiumSoundBtn.muted{
  opacity:.55;
}

/* ---------- Better theme previews ---------- */
.themePreview{
  background-color:#111b2b;
  background-repeat:no-repeat!important;
  background-size:cover!important;
  background-position:center!important;
}

.themeChoice{
  min-height:135px;
}

.themeChoiceInfo{
  background:color-mix(in srgb,var(--glass-strong) 82%,transparent);
}

/* ---------- Modal polish ---------- */
.modal.show .dialog{
  animation:premiumModalIn .32s cubic-bezier(.18,.8,.28,1);
}

@keyframes premiumModalIn{
  from{
    opacity:0;
    transform:translateY(18px) scale(.97);
  }
  to{
    opacity:1;
    transform:none;
  }
}

/* ---------- Low power / accessibility ---------- */
body.premiumLite #premiumPortalTransition{
  display:none;
}

body.premiumLite .subjectCard,
body.premiumLite .primary,
body.premiumLite .zoomLive,
body.premiumLite .danger{
  transition-duration:.1s;
}

@media(prefers-reduced-motion:reduce){
  #enterBtn::before,
  #zoomLiveBtn::after,
  #importantBtn::before,
  #importantBtn svg{
    animation:none!important;
  }

  .screen.premiumEnter,
  .screen.premiumBack,
  .modal.show .dialog{
    animation:none!important;
  }
}

@media(max-width:420px){
  #premiumSoundBtn{
    width:42px;
    height:42px;
    left:12px;
    bottom:calc(12px + env(safe-area-inset-bottom));
  }
}


/* =========================================================
   ZOOM BAC — PREMIUM EFFECTS FIX V2
   ========================================================= */

/* الصوت لم يعد عائمًا */
#premiumSoundBtn{
  position:relative!important;
  left:auto!important;
  right:auto!important;
  bottom:auto!important;
  width:44px!important;
  height:44px!important;
  flex:0 0 44px;
  border-radius:14px!important;
  z-index:auto!important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    0 7px 18px rgba(0,0,0,.12)!important;
}

/* Premium header icons */
.tools .icon,
#premiumSoundBtn{
  position:relative;
  overflow:hidden;
  isolation:isolate;
  background:
    linear-gradient(
      145deg,
      color-mix(in srgb,var(--panel2) 92%,white 3%),
      color-mix(in srgb,var(--panel) 96%,black 3%)
    )!important;
  border:1px solid color-mix(in srgb,var(--accent) 17%,var(--line))!important;
}

.tools .icon::before,
#premiumSoundBtn::before{
  content:"";
  position:absolute;
  width:30px;
  height:30px;
  border-radius:50%;
  background:var(--theme-glow);
  filter:blur(10px);
  opacity:.7;
  z-index:-1;
}

.tools .icon::after,
#premiumSoundBtn::after{
  content:"";
  position:absolute;
  inset:1px;
  border-radius:12px;
  border-top:1px solid rgba(255,255,255,.08);
  pointer-events:none;
}

.tools .icon:active,
#premiumSoundBtn:active{
  transform:translateY(2px) scale(.94);
}

/* richer icon rendering */
.premiumHeaderSvg{
  width:23px!important;
  height:23px!important;
  overflow:visible;
  filter:drop-shadow(0 3px 5px rgba(0,0,0,.22));
}

.premiumHeaderSvg .mainStroke{
  fill:none;
  stroke:currentColor;
  stroke-width:1.65;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.premiumHeaderSvg .accentStroke{
  fill:none;
  stroke:var(--accent);
  stroke-width:1.75;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.premiumHeaderSvg .accentFill{
  fill:var(--accent);
  stroke:none;
}

#themeBtn .premiumHeaderSvg{
  filter:
    drop-shadow(0 0 5px color-mix(in srgb,var(--accent) 42%,transparent))
    drop-shadow(0 3px 5px rgba(0,0,0,.22));
}

/* Main CTA icon jewel */
.premiumCtaIcon{
  width:38px;
  height:38px;
  border-radius:13px;
  display:inline-grid;
  place-items:center;
  flex:0 0 38px;
  color:inherit;
  background:rgba(255,255,255,.14);
  border:1px solid rgba(255,255,255,.22);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.22),
    0 6px 16px rgba(0,0,0,.10);
}

.premiumCtaIcon svg{
  width:21px!important;
  height:21px!important;
  fill:none;
  stroke:currentColor;
  stroke-width:1.9;
  stroke-linecap:round;
  stroke-linejoin:round;
}

/* Enter button */
#enterBtn{
  display:flex!important;
  align-items:center;
  justify-content:center;
  gap:12px;
}

#enterBtn .premiumCtaIcon{
  background:rgba(15,20,27,.10);
}

/* Zoom richer jewel */
#zoomLiveBtn{
  display:flex!important;
  align-items:center;
  justify-content:center;
  gap:12px;
}

#zoomLiveBtn .zoomLogo{
  width:46px;
  height:46px;
  display:grid;
  place-items:center;
  border-radius:15px;
  background:
    linear-gradient(145deg,#54a8ff,#1f75ef);
  border:1px solid rgba(255,255,255,.28);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.30),
    0 7px 20px rgba(31,117,239,.28),
    0 0 22px rgba(48,139,255,.13);
}

#zoomLiveBtn .zoomLogo svg{
  width:25px;
  height:25px;
  fill:none;
  stroke:white;
  stroke-width:1.8;
}

/* Important premium warning jewel */
#importantBtn{
  display:flex!important;
  align-items:center;
  justify-content:center;
  gap:12px;
}

#importantBtn > svg{
  display:none;
}

.premiumWarningIcon{
  position:relative;
  width:42px;
  height:42px;
  flex:0 0 42px;
  display:grid;
  place-items:center;
  border-radius:14px;
  color:#ff7474;
  background:
    linear-gradient(145deg,rgba(255,79,79,.19),rgba(128,17,25,.11));
  border:1px solid rgba(255,91,91,.32);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.12),
    0 0 24px rgba(255,52,52,.13);
}

.premiumWarningIcon svg{
  width:24px!important;
  height:24px!important;
  fill:none;
  stroke:currentColor;
  stroke-width:1.7;
  stroke-linecap:round;
  stroke-linejoin:round;
}

/* remove old portal overlay completely */
#premiumPortalTransition{
  display:none!important;
}

/* premium theme preview stronger visibility */
.themePreview{
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.08);
  filter:saturate(1.08) contrast(1.03);
}

.themePreview::after{
  background:
    linear-gradient(to top,rgba(0,0,0,.25),transparent 60%)!important;
}

/* sound icon glow */
#premiumSoundBtn:not(.muted){
  color:var(--accent2);
}

#premiumSoundBtn:not(.muted)::before{
  opacity:1;
}

@media(max-width:480px){
  .tools{
    gap:7px!important;
  }

  .tools .icon,
  #premiumSoundBtn{
    width:43px!important;
    height:43px!important;
    flex-basis:43px;
  }
}

@media(max-width:370px){
  .tools{
    gap:5px!important;
  }

  .tools .icon,
  #premiumSoundBtn{
    width:40px!important;
    height:40px!important;
    flex-basis:40px;
  }
}
