/* ============================================================
   Course Student — Components
   Shared widgets layered on top of the per-page inline styles.
   Depends on: variables.css, base.css
   ============================================================ */

/* ----- Floating Demo Navigation Widget -----
   Auto-injected by ui.js on every page so you can jump between
   Home / Student / Teacher / Admin during the demo, plus a
   theme toggle. Positioned bottom-left in RTL.
*/
.cs-demo-nav{
  position:fixed;
  bottom:20px;
  left:20px;
  z-index:9999;
  display:flex;
  align-items:center;
  gap:6px;
  padding:8px;
  background:linear-gradient(135deg, var(--card), var(--surface));
  border:1px solid var(--line-strong);
  border-radius:999px;
  box-shadow:
    0 1px 0 rgba(255,255,255,.05) inset,
    var(--shadow-card),
    0 0 0 1px rgba(212,160,23,.08) inset;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  font-family:'Cairo', sans-serif;
  direction:rtl;
  transition:
    transform .38s cubic-bezier(0.4, 0, 0.2, 1),
    opacity .28s ease;
  will-change: transform;
}
.cs-demo-nav.is-dn-collapsed{
  transform: translateY(calc(100% + 36px));
  opacity: 0;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce){
  .cs-demo-nav{
    transition-duration: 0.01ms;
  }
}

.cs-demo-nav .cs-dn-label{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:0 10px 0 6px;
  font-size:11px;
  font-weight:700;
  color:var(--gold-light);
  letter-spacing:.5px;
  border-left:1px solid var(--line);
  height:34px;
}
.cs-demo-nav .cs-dn-label i{
  width:18px;height:18px;border-radius:50%;
  background:linear-gradient(135deg, var(--gold), var(--gold-light));
  color:var(--ink);
  display:grid;place-items:center;
  font-size:10px;
}

.cs-demo-nav a,
.cs-demo-nav button{
  display:inline-flex;
  align-items:center;
  gap:6px;
  height:34px;
  padding:0 12px;
  border-radius:999px;
  background:transparent;
  border:1px solid transparent;
  color:var(--text);
  font-size:12px;
  font-weight:600;
  font-family:inherit;
  cursor:pointer;
  text-decoration:none;
  transition: var(--t-fast) ease;
  white-space:nowrap;
}
.cs-demo-nav a:hover,
.cs-demo-nav button:hover{
  background: rgba(212,160,23,.10);
  border-color: var(--line-strong);
  color: var(--gold-light);
}
.cs-demo-nav a.active{
  background: linear-gradient(135deg, var(--crimson), var(--crimson-action));
  color:#fff;
  box-shadow: var(--shadow-crimson);
  border-color: transparent;
}
.cs-demo-nav a i,
.cs-demo-nav button i{
  font-size:12px;
  opacity:.85;
}
.cs-demo-nav .cs-dn-theme{
  width:34px;
  padding:0;
  justify-content:center;
  border:1px solid var(--line);
}
.cs-demo-nav .cs-dn-theme:hover{
  background: var(--gold-soft);
  color: var(--gold-light);
}

/* Hide labels on small screens, keep icons only */
@media (max-width: 720px){
  .cs-demo-nav .cs-dn-label{display:none}
  .cs-demo-nav a span{display:none}
  .cs-demo-nav a,
  .cs-demo-nav button{
    width:34px;
    padding:0;
    justify-content:center;
  }
}

/* When sidebars also exist, make sure the widget doesn't overlap mobile menus */
@media (max-width: 480px){
  .cs-demo-nav{
    bottom:12px;
    left:12px;
    padding:6px;
  }
}

/* ============================================================
   Glassmorphism utility (opt-in: add class="cs-glass")
   Soft, layered, theme-aware. Uses backdrop-filter for true depth.
   ============================================================ */
.cs-glass{
  background: rgba(34, 8, 16, .55);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border:1px solid rgba(212,160,23,.18);
  box-shadow:
    0 1px 0 rgba(255,255,255,.04) inset,
    0 24px 60px rgba(0,0,0,.45),
    0 8px 24px rgba(123,13,30,.18);
}
:root[data-theme="light"] .cs-glass{
  background: rgba(255,255,255,.65);
  border-color: rgba(123,13,30,.10);
  box-shadow:
    0 1px 0 rgba(255,255,255,.6) inset,
    0 18px 48px rgba(123,13,30,.08),
    0 6px 18px rgba(212,160,23,.12);
}

/* ============================================================
   Gold-shine sweep on every .btn — uses ::after only, so it
   never overrides per-page inline button styles, only adds.
   ============================================================ */
.btn{
  position:relative;
  overflow:hidden;
  isolation:isolate;
}
.btn::after{
  content:"";
  position:absolute; top:0; bottom:0;
  left:-160%;
  width:55%;
  background:linear-gradient(
    120deg,
    transparent 0%,
    rgba(255,255,255,0) 30%,
    rgba(255,255,255,.45) 50%,
    rgba(255,255,255,0) 70%,
    transparent 100%
  );
  transform: skewX(-22deg);
  transition: left .75s cubic-bezier(.2,.8,.2,1);
  pointer-events:none;
  z-index:1;
}
.btn:hover::after{ left:160% }
:root[data-theme="light"] .btn-gold::after{
  background:linear-gradient(
    120deg,
    transparent 0%,
    rgba(255,255,255,0) 30%,
    rgba(255,255,255,.65) 50%,
    rgba(255,255,255,0) 70%,
    transparent 100%
  );
}

/* ============================================================
   Language switcher — 3-pill toggle (AR | EN | TR)
   Visual only for now. Click swaps active state + persists to
   localStorage('cs-lang'). NO content translation wired.
   ============================================================ */
.lang-switch{
  display:inline-flex;
  align-items:center;
  gap:2px;
  padding:4px;
  border-radius:999px;
  background: rgba(212,160,23,.06);
  border:1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
  font-family: var(--font-ui);
  flex-shrink:0;
}
.lang-switch button{
  appearance:none;
  border:0;
  background:transparent;
  color: var(--muted);
  font-weight:700;
  font-size:12px;
  letter-spacing:.6px;
  padding:7px 12px;
  border-radius:999px;
  cursor:pointer;
  transition:
    color .25s ease,
    background .25s ease,
    box-shadow .25s ease,
    transform .25s ease;
  font-family: inherit;
  line-height:1;
  min-width:36px;
}
.lang-switch button:hover{
  color: var(--text);
  background: rgba(212,160,23,.08);
}
.lang-switch button.is-active{
  color:#1A0608;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  box-shadow:
    0 2px 4px rgba(212,160,23,.25),
    0 6px 14px rgba(212,160,23,.22),
    inset 0 1px 0 rgba(255,255,255,.35);
}
:root[data-theme="light"] .lang-switch{
  background: rgba(212,160,23,.10);
  border-color: var(--line-strong);
}
:root[data-theme="light"] .lang-switch button{
  color: var(--muted);
}
:root[data-theme="light"] .lang-switch button:hover{
  color: var(--ink);
  background: rgba(212,160,23,.16);
}
:root[data-theme="light"] .lang-switch button.is-active{
  color:#1A0608;
}
@media (max-width: 720px){
  .lang-switch button{ padding:6px 9px; font-size:11px; min-width:30px; }
}

/* ============================================================
   Card lift utility — opt-in via .cs-lift OR auto-applied to
   .course / .how-card / .stat-card patterns below.
   Subtle 3D rise + layered shadow + animated gold top-edge hairline.
   ============================================================ */
.cs-lift,
.course,
.how-card{
  position:relative;
  transition:
    transform .45s cubic-bezier(.2,.8,.2,1),
    box-shadow .45s cubic-bezier(.2,.8,.2,1);
  will-change: transform;
}
.cs-lift::after,
.course::after,
.how-card::after{
  content:"";
  position:absolute;
  top:0; left:12%; right:12%;
  height:1px;
  background:linear-gradient(90deg,
    transparent 0%,
    rgba(240,192,64,.0) 10%,
    rgba(240,192,64,.9) 50%,
    rgba(240,192,64,.0) 90%,
    transparent 100%);
  opacity:0;
  transform: scaleX(.4);
  transform-origin: center;
  transition: opacity .5s ease, transform .55s cubic-bezier(.2,.8,.2,1);
  pointer-events:none;
  z-index:3;
}
.cs-lift:hover,
.course:hover,
.how-card:hover{
  transform: translateY(-6px);
  box-shadow:
    0 1px 2px rgba(0,0,0,.5),
    0 14px 28px rgba(0,0,0,.4),
    0 40px 80px rgba(123,13,30,.32),
    inset 0 1px 0 rgba(255,255,255,.06);
}
.cs-lift:hover::after,
.course:hover::after,
.how-card:hover::after{
  opacity:1;
  transform: scaleX(1);
}
:root[data-theme="light"] .cs-lift:hover,
:root[data-theme="light"] .course:hover,
:root[data-theme="light"] .how-card:hover{
  box-shadow:
    0 1px 2px rgba(123,13,30,.08),
    0 12px 24px rgba(123,13,30,.10),
    0 36px 72px rgba(123,13,30,.18),
    inset 0 1px 0 rgba(255,255,255,.7);
}
