/*
  Coding Classroom v0.9.13.4 — UI Polish
  Visual/interaction layer only.
  Does not alter learning logic, assessment, API, storage, session, PIN, XP, or Robot Lab rules.
*/

:root{
  --ui-blue:#2f73e0;
  --ui-blue-deep:#174f9f;
  --ui-blue-soft:#edf6ff;
  --ui-violet:#7657e8;
  --ui-violet-soft:#f2efff;
  --ui-emerald:#19a974;
  --ui-emerald-soft:#eaf9f2;
  --ui-gold:#e6a522;
  --ui-gold-soft:#fff7df;
  --ui-coral:#e96861;
  --ui-ink:#1f3552;
  --ui-muted:#637b91;
  --ui-line:#dbe8f3;
  --ui-card-shadow:0 10px 26px rgba(35,76,119,.075);
  --ui-card-shadow-hover:0 18px 38px rgba(35,76,119,.13);
}

/* ---------- TYPOGRAPHY / SPACING ---------- */
.page-heading h1,
.student-home-welcome h1,
.section-heading h2,
.robot-home-copy h2{
  letter-spacing:-.018em;
}
.page-heading>div>p:not(.eyebrow),
.section-intro,
.student-home-welcome>div>p:not(.eyebrow){
  color:var(--ui-muted);
  line-height:1.72;
}
#view-home.page-view{padding-top:18px}
#view-home .student-home-welcome{margin-bottom:16px}
#view-home .student-home-rooms{margin-top:16px}
#view-home .robot-home-promo{margin:18px 0}
#view-home .home-progress{margin-top:18px}

/* ---------- HEADER: softer active state ---------- */
.site-header .main-nav a{
  position:relative;
  transition:background .18s ease,color .18s ease,transform .18s ease,box-shadow .18s ease !important;
}
.site-header .main-nav a:hover{
  transform:translateY(-1px);
}
.site-header .main-nav a.active{
  color:#fff !important;
  background:rgba(255,255,255,.15) !important;
  border-color:rgba(255,255,255,.18) !important;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.04),0 5px 14px rgba(9,46,99,.10) !important;
}
.site-header .main-nav a.active::after{
  content:"";
  position:absolute;
  left:22%;
  right:22%;
  bottom:3px;
  height:2px;
  border-radius:999px;
  background:#a8dcff;
  box-shadow:0 0 8px rgba(168,220,255,.72);
}

/* ---------- STUDENT QUICK STATS ---------- */
.student-home-stats{
  gap:10px !important;
}
.student-home-stats article{
  position:relative;
  overflow:hidden;
  min-height:88px;
  border-radius:18px !important;
  border:1px solid var(--ui-line) !important;
  box-shadow:var(--ui-card-shadow) !important;
  transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;
}
.student-home-stats article::after{
  content:"";
  position:absolute;
  width:74px;height:74px;
  border-radius:50%;
  right:-28px;top:-30px;
  opacity:.55;
}
.student-home-stats article:nth-child(1)::after{background:#b9dcff}
.student-home-stats article:nth-child(2)::after{background:#ffe29a}
.student-home-stats article:nth-child(3)::after{background:#bcefd8}
.student-home-stats article>span{
  border-radius:12px !important;
  transition:transform .18s ease;
}
.student-home-stats article strong{
  font-size:1.32rem;
  font-weight:900;
}
.student-home-stats article small{
  font-weight:650;
}
.student-home-stats article.ui-bump{
  animation:ui-stat-bump .42s ease;
}
.student-home-stats article.ui-bump>span{
  animation:ui-icon-pop .42s ease;
}

/* ---------- CARDS ---------- */
.student-home-rooms,
.student-home-room,
.home-progress,
.continue-card,
.focus-card,
.role-card,
.lesson-node,
.assessment-entry,
.assessment-status-card,
.classroom-profile-card,
.classroom-join-card,
.classroom-active,
.cloud-panel,
.info-card,
.unit-article{
  transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;
}
.student-home-room,
.focus-card,
.role-card,
.lesson-node.available,
.assessment-status-card{
  cursor:pointer;
}
.student-home-room{
  position:relative;
  overflow:hidden;
}
.student-home-room::before{
  content:"";
  position:absolute;
  left:0;top:0;bottom:0;
  width:4px;
  border-radius:4px;
  background:linear-gradient(180deg,#4f8df3,#7657e8);
  opacity:.85;
}

/* ---------- ROBOT LAB PROMO ---------- */
.robot-home-promo{
  position:relative;
  overflow:hidden;
  border-color:#d9e4fb !important;
  background:
    radial-gradient(circle at 4% 20%,rgba(80,178,255,.16),transparent 18rem),
    radial-gradient(circle at 92% 90%,rgba(255,197,78,.20),transparent 18rem),
    linear-gradient(120deg,#f1f9ff 0%,#f6f2ff 55%,#fff9e7 100%) !important;
  box-shadow:0 14px 34px rgba(58,92,140,.10) !important;
}
.robot-home-promo::after{
  content:"";
  position:absolute;
  width:180px;height:180px;
  right:-92px;top:-96px;
  border-radius:50%;
  border:26px solid rgba(118,87,232,.055);
  pointer-events:none;
}
.robot-home-icon{
  width:78px !important;
  height:78px !important;
  padding:5px;
  overflow:hidden;
  background:linear-gradient(145deg,#fff,#edf7ff) !important;
}
.robot-home-icon img{
  width:100%;
  height:100%;
  object-fit:contain;
  filter:drop-shadow(0 7px 8px rgba(44,82,133,.13));
  transform:rotate(-2deg);
}
.robot-home-tags span{
  box-shadow:0 3px 10px rgba(49,88,128,.05);
}
.robot-home-cta{
  position:relative;
  overflow:hidden;
  transition:transform .18s ease,box-shadow .18s ease !important;
}
.robot-home-cta span{
  transition:transform .18s ease;
}
.robot-home-cta:hover span{transform:translateX(3px)}
.robot-home-cta:active{transform:translateY(1px) scale(.985)}

/* ---------- BUTTON FEEDBACK ---------- */
.primary-cta,
.secondary-cta,
.robot-home-cta,
.student-home-room,
.lesson-node.available{
  -webkit-tap-highlight-color:transparent;
}
.primary-cta,
.secondary-cta{
  transition:transform .16s ease,box-shadow .16s ease,filter .16s ease !important;
}
.primary-cta:hover{filter:saturate(1.06)}
.primary-cta:active,
.secondary-cta:active{
  transform:translateY(1px) scale(.985) !important;
}
button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible{
  outline:3px solid rgba(68,151,255,.42) !important;
  outline-offset:3px !important;
}

/* ---------- PROGRESS / STATUS ---------- */
.meter{
  overflow:hidden;
}
.meter>span{
  position:relative;
  overflow:hidden;
}
.meter>span::after{
  content:"";
  position:absolute;
  inset:0;
  transform:translateX(-120%);
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.40),transparent);
  animation:ui-meter-shimmer 2.7s ease-in-out infinite;
}
.status-badge,
.room-status-pill,
.student-room-chip,
.account-badge{
  box-shadow:0 3px 10px rgba(50,87,121,.06);
}

/* ---------- FOOTER ---------- */
.site-footer-v062{
  row-gap:14px !important;
}
.site-footer-v062 .footer-brand-new a{
  align-items:center;
}
.site-footer-v062 .footer-developer{
  line-height:1.45;
}
.site-footer-v062 .footer-links{
  gap:10px;
}
.site-footer-v062 .footer-version small{
  max-width:270px;
}

/* ---------- PAGE APPEARANCE ---------- */
.page-view:not([hidden]){
  animation:ui-page-in .26s ease both;
}

/* ---------- MOBILE BOTTOM NAV ---------- */
.mobile-bottom-nav{
  display:none;
}
@media(max-width:780px){
  body{
    padding-bottom:74px;
  }
  .mobile-bottom-nav{
    position:fixed;
    z-index:1000;
    left:8px;
    right:8px;
    bottom:max(8px,env(safe-area-inset-bottom));
    min-height:58px;
    display:grid;
    grid-template-columns:repeat(6,1fr);
    gap:3px;
    padding:6px;
    border-radius:20px;
    background:rgba(12,48,99,.94);
    border:1px solid rgba(255,255,255,.14);
    box-shadow:0 16px 38px rgba(8,40,85,.26);
    backdrop-filter:blur(14px);
  }
  .mobile-bottom-nav a{
    min-width:0;
    min-height:46px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:2px;
    border-radius:14px;
    color:#d9eaff;
    text-decoration:none;
    font-weight:800;
    transition:background .15s ease,color .15s ease,transform .15s ease;
  }
  .mobile-bottom-nav a>span{font-size:1rem;line-height:1}
  .mobile-bottom-nav a>small{font-size:.60rem;line-height:1.1;white-space:nowrap}
  .mobile-bottom-nav a.active,
  .mobile-bottom-nav a[aria-current="page"]{
    color:#164f9f;
    background:#fff;
    box-shadow:0 5px 14px rgba(3,26,62,.20);
  }
  .mobile-bottom-nav a:active{transform:scale(.96)}
  body.student-logged-out .mobile-bottom-nav a[data-mobile-route="robot"]{display:none}
  .site-footer{margin-bottom:2px}
}
@media(max-width:410px){
  .mobile-bottom-nav{left:5px;right:5px;padding-inline:4px}
  .mobile-bottom-nav a>small{font-size:.56rem}
}

/* ---------- HOVER ONLY WHERE A POINTER EXISTS ---------- */
@media(hover:hover) and (pointer:fine){
  .student-home-stats article:hover,
  .student-home-room:hover,
  .focus-card:hover,
  .role-card:hover,
  .lesson-node.available:hover,
  .assessment-status-card:hover{
    transform:translateY(-3px);
    box-shadow:var(--ui-card-shadow-hover) !important;
  }
  .student-home-stats article:hover>span{
    transform:rotate(-4deg) scale(1.05);
  }
  .robot-home-promo:hover .robot-home-icon img{
    animation:ui-robot-float 1.25s ease-in-out infinite alternate;
  }
}

/* ---------- MOTION ---------- */
@keyframes ui-page-in{
  from{opacity:.35;transform:translateY(5px)}
  to{opacity:1;transform:none}
}
@keyframes ui-stat-bump{
  0%{transform:scale(1)}
  45%{transform:scale(1.025)}
  100%{transform:scale(1)}
}
@keyframes ui-icon-pop{
  0%,100%{transform:scale(1)}
  45%{transform:scale(1.13) rotate(-5deg)}
}
@keyframes ui-meter-shimmer{
  0%,55%{transform:translateX(-120%)}
  85%,100%{transform:translateX(120%)}
}
@keyframes ui-robot-float{
  from{transform:translateY(0) rotate(-2deg)}
  to{transform:translateY(-4px) rotate(2deg)}
}

@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{
    animation-duration:.001ms !important;
    animation-iteration-count:1 !important;
    scroll-behavior:auto !important;
    transition-duration:.001ms !important;
  }
}

.site-header .xp-pill.ui-bump{animation:ui-stat-bump .42s ease}
