:root{
  --primary:#6C63FF;
  --secondary:#4FC3F7;
  --accent:#FFD166;
  --success:#7BD389;
  --danger:#FF8A80;
  --bg:#F6F8FC;
  --card:#FFFFFF;
  --text:#2A2E4A;
  --muted:#7B88A8;
  --border:#E6EAF2;
  --shadow:0 12px 28px rgba(0,0,0,.06);
}

*{
  box-sizing:border-box;
  margin:0;
  padding:0;
}

html,body{
  width:100%;
  overflow-x:hidden;
}

body{
  font-family:'Inter',sans-serif;
  background:var(--bg);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

img{
  max-width:100%;
  height:auto;
  display:block;
}

.student-app{
  display:flex;
  min-height:100vh;
  width:100%;
}

/* =========================
   SIDEBAR
========================= */
.student-sidebar{
  width:260px;
  background:#fff;
  border-right:1px solid var(--border);
  padding:20px;
  display:flex;
  flex-direction:column;
  gap:24px;
  flex-shrink:0;
}

.student-brand{
  display:flex;
  align-items:center;
  gap:12px;
}

.student-logo{
  width:48px;
  height:48px;
  border-radius:16px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg,var(--primary),var(--secondary));
  color:#fff;
  font-size:22px;
  box-shadow:0 10px 20px rgba(108,99,255,.18);
}

.student-brand h2{
  font-size:18px;
  font-weight:800;
}

.student-brand p{
  font-size:12px;
  color:var(--muted);
  margin-top:2px;
}

.student-nav{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.student-nav a{
  text-decoration:none;
  
  border-radius:16px;
  color:var(--text);
  font-weight:300;
  display:flex;
  align-items:center;
  gap:4px;
  transition:.2s ease;
}
.nav-icon{width:40px;height:40px;border-radius:12px;background:#F3F5FB;display:flex;align-items:center;justify-content:center;font-size:18px;}
.student-nav a:hover,
.student-nav a.active{
  background:linear-gradient(135deg,#EEF2FF,#E0F2FE);
  color:var(--primary);
}

/* =========================
   MAIN
========================= */
.student-main{
  flex:1;
  display:flex;
  flex-direction:column;
  min-width:0;
}

.student-topbar{
  background:#fff;
  padding:18px 22px;
  border-bottom:1px solid var(--border);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  position: sticky;
  flex-wrap:wrap;
}

.student-top-left{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
}

.student-top-left h3{
  font-size:18px;
  font-weight:800;
  line-height:1.2;
}

.student-top-left p{
  font-size:13px;
  color:var(--muted);
  margin-top:4px;
}

.student-menu-btn{
  display:none;
  width:44px;
  height:44px;
  border:none;
  border-radius:14px;
  background:#F3F4F6;
  font-size:20px;
  cursor:pointer;
  flex-shrink:0;
}

.student-avatar{
  width:46px;
  height:46px;
  border-radius:16px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg,var(--primary),var(--secondary));
  color:#fff;
  font-weight:800;
  flex-shrink:0;
}

.student-container{
  padding:20px;
  padding-bottom:90px;
  width:100%;
  min-width:0;
}

/* =========================
   GENERIC CARDS
========================= */
.card{
  background:var(--card);
  border-radius:24px;
  padding:20px;
  box-shadow:var(--shadow);
  width:100%;
}

.card h2,
.card h3{
  line-height:1.3;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  margin-top:12px;
  padding:12px 18px;
  border-radius:14px;
  text-decoration:none;
  color:#fff;
  font-weight:800;
  background:linear-gradient(135deg,var(--primary),var(--secondary));
  border:none;
  cursor:pointer;
  min-height:46px;
}

.btn:disabled{
  opacity:.65;
  cursor:not-allowed;
}

/* =========================
   GRID / LIST
========================= */
.stats{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:16px;
  margin-bottom:20px;
  width:100%;
}

.stat-num{
  font-size:28px;
  font-weight:800;
  line-height:1.2;
}

.list{
  display:grid;
  gap:12px;
  width:100%;
}

.item{
  padding:14px;
  border-radius:18px;
  background:#F8FAFC;
  width:100%;
}

.item strong{
  display:block;
  margin-bottom:6px;
  line-height:1.4;
  word-break:break-word;
}

.meta{
  color:#6B7280;
  font-size:14px;
  line-height:1.5;
  word-break:break-word;
}

/* =========================
   BADGES
========================= */
.badge-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(160px,1fr));
  gap:12px;
  width:100%;
}

.badge-card{
  padding:16px;
  border-radius:20px;
  background:linear-gradient(135deg,#FFF7ED,#FEF3C7);
  text-align:center;
  font-weight:700;
  min-height:120px;
  display:flex;
  flex-direction:column;
  justify-content:center;
}

.badge-icon{
  font-size:28px;
  margin-bottom:8px;
}

/* =========================
   QUIZ UI
========================= */
.question{
  display:none;
}

.question.active{
  display:block;
}

.quiz-progress-wrap{
  width:100%;
  height:10px;
  background:#E5E7EB;
  border-radius:999px;
  overflow:hidden;
  margin:15px 0 20px;
}

.quiz-progress-bar{
  height:100%;
  width:0%;
  background:linear-gradient(135deg,#6C63FF,#4FC3F7);
  transition:.25s ease;
}

.option{
  display:block;
  cursor:pointer;
  transition:.2s ease;
  border:2px solid transparent;
}

.option.active{
  border-color:var(--primary);
  background:#EEF2FF;
}

.option input{
  display:none;
}

.quiz-nav{
  display:flex;
  gap:10px;
  margin-top:20px;
  flex-wrap:wrap;
}

.quiz-nav .btn{
  flex:1;
  min-width:120px;
}

/* =========================
   BOTTOM NAV
========================= */
.student-bottom-nav{
  display:none;
}

/* =========================
   TABLET
========================= */
@media(max-width:1024px){
  .student-sidebar{
    position:fixed;
    top:0;
    left:-100%;
    width:260px;
    height:100%;
    z-index:1000;
    transition:.3s ease;
    box-shadow:0 10px 30px rgba(0,0,0,.12);
  }

  .student-sidebar.show{
    left:0;
  }

  .student-menu-btn{
    display:flex;
    align-items:center;
    justify-content:center;
  }
}

/* =========================
   MOBILE
========================= */
@media(max-width:768px){
  .student-topbar{
      position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1100;
  }
  .student-container{
  padding:16px;
  padding-bottom:92px;
  margin-top:70px; /* ✅ ADD THIS LINE */
}
  .student-container{
    padding:16px;
    padding-bottom:92px;
  }

  .card{
    border-radius:22px;
    padding:18px;
  }

  .student-top-left h3{
    font-size:16px;
  }

  .student-top-left p{
    font-size:12px;
  }

  .stat-num{
    font-size:24px;
  }

  .stats{
    grid-template-columns:1fr 1fr;
  }

  .badge-grid{
    grid-template-columns:1fr 1fr;
  }

  .student-bottom-nav{
    position:fixed;
    bottom:0;
    left:0;
    right:0;
    height:70px;
    background:#fff;
    border-top:1px solid var(--border);
    display:flex;
    justify-content:space-around;
    align-items:center;
    z-index:999;
    padding-bottom:env(safe-area-inset-bottom);
  }

  .student-bottom-nav a{
    text-decoration:none;
    color:var(--muted);
    font-size:11px;
    font-weight:700;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:4px;
    min-width:58px;
  }

  .student-bottom-nav a span{
    font-size:11px;
    line-height:1;
  }

  .quiz-nav{
    flex-direction:column;
  }

  .quiz-nav .btn{
    width:100%;
  }
}

/* =========================
   SMALL MOBILE
========================= */
@media(max-width:480px){
  .student-container{
    padding:14px;
    padding-bottom:92px;
  }

  .stats{
    grid-template-columns:1fr;
  }

  .badge-grid{
    grid-template-columns:1fr;
  }

  .card{
    border-radius:20px;
    padding:16px;
  }

  .student-avatar{
    width:42px;
    height:42px;
    border-radius:14px;
  }

  .student-menu-btn{
    width:42px;
    height:42px;
    border-radius:12px;
  }

  .stat-num{
    font-size:22px;
  }

  .meta{
    font-size:13px;
  }

  .btn{
    width:100%;
  }
}
.manage-top{display:flex;gap:12px;flex-wrap:wrap;margin-bottom:14px;}
.search-input{flex:1;min-width:200px;}
.input{width:100%;padding:13px 14px;border-radius:14px;border:1px solid var(--border);font-size:14px;font-family:inherit;outline:none;background:#fff;}
.filter-btn{padding:10px 14px;border-radius:14px;border:1px solid var(--border);background:#F4F7FC;font-weight:600;cursor:pointer;font-size:13px;}
.filter-btn.active{background:linear-gradient(135deg,var(--primary),var(--secondary));color:#fff;border:none;}
/* =========================
   PREMIUM MANAGE PUZZLE CARD
========================= */

.puzzle-list{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.puzzle-item{
  display:flex;
  align-items:center;
  gap:14px;
  padding:14px;
  border-radius:22px;
  background:linear-gradient(180deg,#ffffff,#fbfcff);
  border:1px solid #EEF2F8;
  box-shadow:0 8px 24px rgba(31,41,55,.05);
  transition:all .25s ease;
}

.puzzle-item:hover{
  transform:translateY(-2px);
  box-shadow:0 14px 30px rgba(108,99,255,.10);
  border-color:#DCE4F4;
}

.thumb{
  width:62px;
  height:62px;
  border-radius:18px;
  object-fit:cover;
  flex-shrink:0;
  box-shadow:0 6px 18px rgba(0,0,0,.10);
  border:2px solid #fff;
}

.puzzle-info{
  flex:1;
  min-width:0;
}

.puzzle-info strong{
  display:block;
  font-size:16px;
  font-weight:700;
  line-height:1.35;
  margin-bottom:8px;
  color:var(--text);
  word-break:break-word;
}

.meta{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:0;
}
.meta span{
  font-size:13px;
  color:var(--muted);
  display:flex;
  align-items:center;
  gap:4px;
}
/* =========================
   STICKY TOPBAR
========================= */

.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
    padding: 12px 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,.06);
    backdrop-filter: blur(10px);
    background: rgba(255,255,255,0.9);
}


/* MOBILE FIX */
@media (max-width: 768px) {
    .topbar {
        position: fixed;
        width: 100%;
        left: 0;
        top: 0;
    }

    /* PUSH CONTENT DOWN */
    .main-content {
        padding-top: 80px;
    }
}

/* =========================
   STUDENT PUZZLES PAGE
========================= */

.student-page{
    padding: 24px;
}

.puzzle-hero-card{
    background: linear-gradient(135deg,#6C63FF,#4FC3F7);
    color:#fff;
    overflow:hidden;
}

.puzzle-hero-content{
    display:grid;
    grid-template-columns: 1.4fr .9fr;
    gap:24px;
    align-items:center;
}

.hero-badge{
    display:inline-block;
    padding:8px 14px;
    border-radius:999px;
    background:rgba(255,255,255,.18);
    font-weight:700;
    margin-bottom:14px;
}

.puzzle-hero-left h1{
    font-size:34px;
    line-height:1.2;
    margin-bottom:12px;
}

.puzzle-hero-left p{
    color:rgba(255,255,255,.92);
    max-width:700px;
}

.hero-actions{
    display:flex;
    gap:12px;
    flex-wrap:wrap;
    margin-top:20px;
}

.btn-light{
    background:#fff;
    color:#111827;
}

.puzzle-hero-right{
    display:grid;
    gap:16px;
}

.hero-mini-card{
    background:rgba(255,255,255,.14);
    border:1px solid rgba(255,255,255,.2);
    border-radius:20px;
    padding:18px;
    backdrop-filter: blur(10px);
}

.hero-mini-card span{
    font-size:28px;
    display:block;
    margin-bottom:10px;
}

.category-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    gap:18px;
    margin-top:18px;
}

.category-card{
    display:block;
    padding:22px;
    border-radius:22px;
    text-decoration:none;
    color:#111827;
    background:#F8FAFF;
    border:1px solid #E6EAF2;
    transition:.25s ease;
}

.category-card:hover{
    transform:translateY(-4px);
    box-shadow:0 12px 28px rgba(0,0,0,.08);
}

.cat-icon{
    font-size:32px;
    margin-bottom:14px;
}

.puzzle-grid-cards{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
    gap:18px;
    margin-top:18px;
}

.puzzle-card-pro{
    background:#fff;
    border:1px solid #EEF2F7;
    border-radius:22px;
    overflow:hidden;
    box-shadow:0 8px 22px rgba(0,0,0,.05);
}

.puzzle-card-thumb img{
    width:100%;
    height:180px;
    object-fit:cover;
    display:block;
}

.puzzle-card-body{
    padding:18px;
}

.play-btn-full{
    width:100%;
    text-align:center;
    margin-top:14px;
}

@media(max-width:768px){
    .student-page{
        padding:16px;
    }

    .puzzle-hero-content{
        grid-template-columns:1fr;
    }

    .puzzle-hero-left h1{
        font-size:26px;
    }

    .hero-actions .btn{
        width:100%;
        text-align:center;
    }

    .category-grid,
    .puzzle-grid-cards{
        grid-template-columns:1fr;
    }
}

/* =========================
   PUZZLE HERO FIX
========================= */

.puzzle-hero-card{
    background: linear-gradient(135deg, #6C63FF, #4FC3F7);
    color: #fff;
    overflow: hidden;
    border-radius: 24px;
    padding: 28px;
    position: relative;
}

.puzzle-hero-content{
    display: grid;
    grid-template-columns: 1.4fr .9fr;
    gap: 24px;
    align-items: center;
}

.hero-badge{
    display:inline-block;
    padding:8px 14px;
    border-radius:999px;
    background:rgba(255,255,255,.18);
    color:#fff;
    font-weight:700;
    margin-bottom:14px;
}

.puzzle-hero-left h1{
    font-size: 40px;
    line-height: 1.2;
    margin-bottom: 14px;
    color: #ffffff;
    font-weight: 900;
}

.puzzle-hero-left p{
    font-size: 16px;
    line-height: 1.8;
    color: rgba(255,255,255,0.95);   /* ← FIXED */
    max-width: 700px;
    margin-bottom: 18px;
}

.hero-actions{
    display:flex;
    gap:12px;
    flex-wrap:wrap;
    margin-top:20px;
}

.btn-light{
    background:#fff;
    color:#111827;
}

/* Right mini cards */
.puzzle-hero-right{
    display:grid;
    gap:16px;
}

.hero-mini-card{
    background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.24);
    border-radius: 20px;
    padding: 18px;
    backdrop-filter: blur(10px);
    color:#fff;
}

.hero-mini-card span{
    font-size: 28px;
    display:block;
    margin-bottom:10px;
}

.hero-mini-card p{
    color: rgba(255,255,255,.9);
    margin-top: 6px;
}

/* MOBILE FIX */
@media(max-width:768px){
    .puzzle-hero-card{
        padding: 20px;
    }

    .puzzle-hero-content{
        grid-template-columns:1fr;
        gap:18px;
    }

    .puzzle-hero-left h1{
        font-size: 28px;
        line-height: 1.3;
    }

    .puzzle-hero-left p{
        font-size: 14px;
        line-height: 1.7;
        color: rgba(255,255,255,0.96); /* stronger on mobile */
    }

    .hero-actions .btn{
        width:100%;
        text-align:center;
    }
}
.card .btn{
  display:inline-flex;
  flex-wrap:wrap;
}