/* ==========================================================================
   css/trainee.css — premium look for the TRAINEE screens only (loaded after theme.css)
   Scope: body[data-app-role="Trainee"] #app-wrapper …  The exam screen (#s-quiz-area) lives OUTSIDE
   #app-wrapper, so nothing here can touch it. Colours use theme variables or translucent tints, so it
   works in light AND dark. All motion is switched off for people who prefer reduced motion (bottom).
   ========================================================================== */
body[data-app-role="Trainee"]{
  --g-main  : linear-gradient(135deg,#6a5af9 0%,#2e86f5 55%,#00c9a7 100%);
  --g-blue  : linear-gradient(135deg,#2e86f5,#00b4ff);
  --g-green : linear-gradient(135deg,#00b894,#2ee6a6);
  --g-orange: linear-gradient(135deg,#ff9f43,#ff6b6b);
  --g-purple: linear-gradient(135deg,#8e44ad,#6a5af9);
  --g-red   : linear-gradient(135deg,#ff5d5d,#ff3d81);
  --t-bd    : rgba(106,90,249,.16);
  --t-glow  : 0 8px 26px rgba(106,90,249,.14);
  --t-glow-h: 0 16px 38px rgba(106,90,249,.28);
}
html[data-theme="dark"] body[data-app-role="Trainee"]{
  --t-bd    : rgba(140,130,255,.24);
  --t-glow  : 0 8px 26px rgba(0,0,0,.45);
  --t-glow-h: 0 16px 38px rgba(106,90,249,.38);
}

/* soft colour wash behind the pages */
body[data-app-role="Trainee"] #main-content{
  background:
    radial-gradient(900px 420px at 88% -8%, rgba(106,90,249,.11), transparent 60%),
    radial-gradient(800px 460px at -8% 108%, rgba(0,201,167,.11), transparent 60%),
    var(--page-bg);
}

/* header: thin flowing gradient line */
body[data-app-role="Trainee"] .topbar::after{
  content:""; position:absolute; left:0; right:0; bottom:0; height:3px;
  background:linear-gradient(90deg,#6a5af9,#2e86f5,#00c9a7,#ffb347,#ff5d8f,#6a5af9);
  background-size:300% 100%; animation:tpFlow 10s linear infinite;
}
body[data-app-role="Trainee"] .user-chip{ background:var(--g-main); border-color:transparent; box-shadow:0 0 0 3px rgba(106,90,249,.25); }

/* ---------- sidebar menu: colour chips + animated active pill ---------- */
body[data-app-role="Trainee"] #sidebar .nav-item{
  margin:3px 10px; padding:9px 12px; border-radius:14px; border-left:0; gap:12px;
  transition:transform .2s ease, background .2s ease, box-shadow .2s ease;
}
body[data-app-role="Trainee"] #sidebar .nav-item:hover{ transform:translateX(4px); }
body[data-app-role="Trainee"] #sidebar .nav-item.active{
  background:linear-gradient(90deg,rgba(106,90,249,.20),rgba(0,201,167,.12));
  box-shadow:inset 0 0 0 1.5px rgba(106,90,249,.42); font-weight:700;
}
body[data-app-role="Trainee"] #sidebar .nav-item i{
  width:34px; height:34px; border-radius:11px; display:grid; place-items:center; flex:0 0 34px;
  font-size:15px; color:#fff !important; box-shadow:0 4px 10px rgba(0,0,0,.18);
  transition:transform .25s cubic-bezier(.3,1.6,.5,1);
}
body[data-app-role="Trainee"] #sidebar .nav-item:hover i,
body[data-app-role="Trainee"] #sidebar .nav-item.active i{ transform:scale(1.14) rotate(-6deg); }
/* default chip (e.g. the Settings item below the menu) so its white icon never sits on the plain sidebar */
body[data-app-role="Trainee"] #sidebar .nav-item i{ background:linear-gradient(135deg,#7f8c8d,#2d3436); }
body[data-app-role="Trainee"] #sidebar-menu .nav-item:nth-child(1) i{ background:var(--g-blue); }
body[data-app-role="Trainee"] #sidebar-menu .nav-item:nth-child(2) i{ background:var(--g-purple); }
body[data-app-role="Trainee"] #sidebar-menu .nav-item:nth-child(3) i{ background:var(--g-orange); }
body[data-app-role="Trainee"] #sidebar-menu .nav-item:nth-child(4) i{ background:var(--g-green); }
body[data-app-role="Trainee"] #sidebar-menu .nav-item:nth-child(5) i{ background:linear-gradient(135deg,#f6b93b,#e55039); }
body[data-app-role="Trainee"] #sidebar-menu .nav-item:nth-child(6) i{ background:linear-gradient(135deg,#00cec9,#0984e3); }
body[data-app-role="Trainee"] #sidebar-menu .nav-item:nth-child(7) i{ background:var(--g-red); }
body[data-app-role="Trainee"] #sidebar-menu .nav-item:nth-child(8) i{ background:linear-gradient(135deg,#a29bfe,#fd79a8); }
body[data-app-role="Trainee"] #sidebar .profile-pic-wrap{ box-shadow:0 0 0 3px rgba(106,90,249,.35); }

/* ---------- pages: staggered entrance ---------- */
@keyframes tpRise{ from{opacity:0;transform:translateY(18px) scale(.985)} to{opacity:1;transform:none} }
@keyframes tpFlow{ from{background-position:0 0} to{background-position:300% 0} }
@keyframes tpShift{ 0%,100%{background-position:0% 50%} 50%{background-position:100% 50%} }
@keyframes tpPulse{ 0%,100%{box-shadow:0 0 0 0 rgba(255,159,67,.55)} 50%{box-shadow:0 0 0 7px rgba(255,159,67,0)} }
@keyframes tpFloat{ 0%,100%{transform:translateY(0)} 50%{transform:translateY(-6px)} }
body[data-app-role="Trainee"] .app-panel.active > *{ animation:tpRise .55s cubic-bezier(.2,.8,.2,1) both; }
body[data-app-role="Trainee"] .app-panel.active > *:nth-child(2){ animation-delay:.06s; }
body[data-app-role="Trainee"] .app-panel.active > *:nth-child(3){ animation-delay:.12s; }
body[data-app-role="Trainee"] .app-panel.active > *:nth-child(4){ animation-delay:.18s; }
body[data-app-role="Trainee"] .app-panel.active > *:nth-child(5){ animation-delay:.24s; }
body[data-app-role="Trainee"] .app-panel.active > *:nth-child(n+6){ animation-delay:.3s; }

/* ---------- cards ---------- */
body[data-app-role="Trainee"] #app-wrapper .card{
  position:relative; border-radius:18px; border:1px solid var(--t-bd); box-shadow:var(--t-glow);
  transition:transform .25s ease, box-shadow .25s ease;
}
body[data-app-role="Trainee"] #app-wrapper .card::before{
  content:""; position:absolute; left:0; right:0; top:0; height:4px; border-radius:18px 18px 0 0;
  background:var(--g-main); background-size:200% 100%; pointer-events:none;
}
body[data-app-role="Trainee"] #app-wrapper .app-panel:not(#p-stu-messages):not(#p-calendar) .card:hover{
  transform:translateY(-3px); box-shadow:var(--t-glow-h);
}
body[data-app-role="Trainee"] #app-wrapper .card-title{ font-weight:800; letter-spacing:.2px; }
@supports (-webkit-background-clip:text) or (background-clip:text){
  body[data-app-role="Trainee"] #app-wrapper .card-title{
    background:var(--g-main); -webkit-background-clip:text; background-clip:text;
    -webkit-text-fill-color:transparent; color:transparent;
  }
}

/* ---------- dashboard hero (the welcome card) ---------- */
body[data-app-role="Trainee"] #p-stu-dash > #live-exam-banner + .card{
  border:0; color:#fff; padding:44px 20px !important;
  background:linear-gradient(120deg,#6a5af9,#2e86f5,#00c9a7,#6a5af9); background-size:300% 300%;
  animation:tpRise .55s cubic-bezier(.2,.8,.2,1) both, tpShift 16s ease infinite;
  box-shadow:0 18px 44px rgba(46,134,245,.35); overflow:hidden;
}
body[data-app-role="Trainee"] #p-stu-dash > #live-exam-banner + .card::before{
  left:auto; right:-70px; top:-70px; width:240px; height:240px; border-radius:50%;
  background:rgba(255,255,255,.16); animation:tpFloat 7s ease-in-out infinite;
}
body[data-app-role="Trainee"] #p-stu-dash > #live-exam-banner + .card::after{
  content:""; position:absolute; left:-50px; bottom:-80px; width:200px; height:200px; border-radius:50%;
  background:rgba(255,255,255,.12); animation:tpFloat 9s ease-in-out infinite reverse; pointer-events:none;
}
body[data-app-role="Trainee"] #p-stu-dash > #live-exam-banner + .card > *{ position:relative; z-index:1; }
body[data-app-role="Trainee"] #p-stu-dash > #live-exam-banner + .card h2{ color:#fff !important; font-size:28px; text-shadow:0 2px 12px rgba(0,0,0,.18); }
body[data-app-role="Trainee"] #p-stu-dash > #live-exam-banner + .card p{ color:rgba(255,255,255,.93) !important; }
body[data-app-role="Trainee"] #p-stu-dash > #live-exam-banner + .card .btn{
  background:rgba(255,255,255,.96); color:#4b3fd1; border-radius:999px; padding:11px 22px; font-weight:700;
  box-shadow:0 8px 20px rgba(0,0,0,.18);
}
body[data-app-role="Trainee"] #p-stu-dash > #live-exam-banner + .card .btn:hover{ transform:translateY(-3px) scale(1.04); filter:none; }

/* ---------- buttons ---------- */
body[data-app-role="Trainee"] #app-wrapper .btn{
  position:relative; overflow:hidden; border:0; border-radius:12px; font-weight:700;
  transition:transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
body[data-app-role="Trainee"] #app-wrapper .btn::after{
  content:""; position:absolute; inset:0; pointer-events:none;
  background:linear-gradient(110deg,transparent 30%,rgba(255,255,255,.38) 50%,transparent 70%);
  transform:translateX(-130%); transition:transform .6s ease;
}
body[data-app-role="Trainee"] #app-wrapper .btn:hover::after{ transform:translateX(130%); }
body[data-app-role="Trainee"] #app-wrapper .btn:hover{ transform:translateY(-2px); box-shadow:0 8px 18px rgba(0,0,0,.2); filter:brightness(1.05); }
body[data-app-role="Trainee"] #app-wrapper .btn:active{ transform:translateY(0) scale(.97); }
body[data-app-role="Trainee"] #app-wrapper .btn-primary{ background:var(--g-blue); }
body[data-app-role="Trainee"] #app-wrapper .btn-success{ background:var(--g-green); }
body[data-app-role="Trainee"] #app-wrapper .btn-warning{ background:var(--g-orange); }
body[data-app-role="Trainee"] #app-wrapper .btn-info{ background:var(--g-purple); }
body[data-app-role="Trainee"] #app-wrapper .btn-danger{ background:var(--g-red); }

/* ---------- forms ---------- */
body[data-app-role="Trainee"] #app-wrapper input:focus,
body[data-app-role="Trainee"] #app-wrapper select:focus,
body[data-app-role="Trainee"] #app-wrapper textarea:focus{
  outline:none; border-color:#6a5af9 !important; box-shadow:0 0 0 3px rgba(106,90,249,.22);
}

/* ---------- tables ---------- */
body[data-app-role="Trainee"] #app-wrapper .data-table thead th{
  background:linear-gradient(90deg,rgba(106,90,249,.13),rgba(0,201,167,.12)); border-bottom:2px solid rgba(106,90,249,.25);
}
body[data-app-role="Trainee"] #app-wrapper .data-table tbody tr{ transition:background .2s ease; }
body[data-app-role="Trainee"] #app-wrapper .data-table tbody tr:hover{ background:rgba(106,90,249,.08); }

/* ---------- live-test list ---------- */
body[data-app-role="Trainee"] .live-sum{ gap:10px; }
body[data-app-role="Trainee"] .live-sum span{ padding:8px 14px; border-radius:14px; background:rgba(127,127,127,.12); font-weight:600; }
body[data-app-role="Trainee"] .live-sum-done{ background:rgba(0,184,148,.16) !important; }
body[data-app-role="Trainee"] .live-sum-pend{ background:rgba(255,159,67,.18) !important; }
body[data-app-role="Trainee"] .live-sum-miss{ background:rgba(255,93,93,.16) !important; }
body[data-app-role="Trainee"] .live-st{ border-width:0; padding:4px 11px; font-size:12px; background:rgba(127,127,127,.14); }
body[data-app-role="Trainee"] .live-st-done{ background:rgba(0,184,148,.18); }
body[data-app-role="Trainee"] .live-st-pending{ background:rgba(255,159,67,.2); animation:tpPulse 1.9s ease-in-out infinite; }
body[data-app-role="Trainee"] .live-st-missed{ background:rgba(255,93,93,.18); }
body[data-app-role="Trainee"] [data-action="live-list-start"]{ animation:tpPulse 1.9s ease-in-out infinite; }

/* ---------- floating + button ---------- */
body[data-app-role="Trainee"] .fab-btn{ background:var(--g-main); box-shadow:0 10px 26px rgba(106,90,249,.45); animation:tpFloat 4.5s ease-in-out infinite; }

/* ---------- calm for people who asked for less motion ---------- */
@media (prefers-reduced-motion: reduce){
  body[data-app-role="Trainee"] *, body[data-app-role="Trainee"] *::before, body[data-app-role="Trainee"] *::after{
    animation:none !important; transition:none !important;
  }
}
