/* ============================================================
   Millat IELTS — shared shell (sidebar + topbar + cards)
   Light theme, distinct from the rest of Millat by design (matches
   this site's existing pattern of each sub-app having its own visual
   identity — Reading is cream, Vocabulary is dark, this is light/airy),
   but reuses Millat's own type system and gold/indigo brand accents.
   ============================================================ */

:root{
  --bg:#f6f7fb; --surface:#ffffff; --border:#e5e7f0; --text:#1c2230; --muted:#6b7280;
  --accent:#4338ca; --accent-soft:#eef0fd; --gold:#b8860b; --gold-soft:#fbf3df;
  --shadow-sm: 0 2px 8px rgba(20,20,45,0.06);
  --shadow-md: 0 10px 28px rgba(20,20,45,0.09);
  --font-display:"Fraunces","Georgia",serif;
  --font-body:"Manrope",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#0f1117; --surface:#171a23; --border:#2a2e3b; --text:#eef0f5; --muted:#9298a8;
    --accent:#818cf8; --accent-soft:rgba(129,140,248,0.14); --gold:#e0b34d; --gold-soft:rgba(224,179,77,0.12);
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.35);
    --shadow-md: 0 12px 32px rgba(0,0,0,0.45);
  }
}
:root[data-theme="dark"]{
  --bg:#0f1117; --surface:#171a23; --border:#2a2e3b; --text:#eef0f5; --muted:#9298a8;
  --accent:#818cf8; --accent-soft:rgba(129,140,248,0.14); --gold:#e0b34d; --gold-soft:rgba(224,179,77,0.12);
  --shadow-sm: 0 2px 10px rgba(0,0,0,0.35);
  --shadow-md: 0 12px 32px rgba(0,0,0,0.45);
}
*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0; font-family:var(--font-body); color:var(--text); background:var(--bg);
}
a{ color:inherit; }

.ielts-shell{ display:flex; align-items:stretch; min-height:100vh; }

/* ---- Sidebar ---- */
.ielts-sidebar{
  width:250px; flex-shrink:0; display:flex; flex-direction:column;
  background:var(--surface); border-right:1px solid var(--border);
  position:sticky; top:0; height:100vh;
}
.ielts-brand{
  display:flex; align-items:center; gap:10px; padding:22px 22px 18px 22px;
  text-decoration:none; color:var(--text);
}
.ielts-brand-mark{
  width:38px; height:38px; border-radius:11px; flex-shrink:0;
  background:linear-gradient(135deg, var(--gold), #8a5c07); display:flex; align-items:center; justify-content:center;
  font-size:1.15rem; box-shadow:var(--shadow-sm);
}
.ielts-brand-text{ display:flex; flex-direction:column; line-height:1.15; }
.ielts-brand-text strong{ font-family:var(--font-display); font-size:1.08rem; font-weight:700; }
.ielts-brand-text span{ font-size:0.66rem; font-weight:800; letter-spacing:0.6px; text-transform:uppercase; color:var(--muted); }

.ielts-nav{ display:flex; flex-direction:column; gap:2px; padding:10px 12px; }
.ielts-nav-link{
  display:flex; align-items:center; gap:14px; padding:10px 14px; border-radius:14px;
  text-decoration:none; color:var(--muted); font-weight:700; font-size:0.98rem;
  transition:background 0.15s ease, color 0.15s ease;
}
.ielts-nav-link .nav-icon{
  font-size:1.85rem; line-height:1; width:34px; text-align:center; flex-shrink:0;
  filter:drop-shadow(0 2px 3px rgba(20,20,45,0.18)); display:inline-flex; align-items:center; justify-content:center;
}
.ielts-nav-link .nav-icon img{ width:30px; height:30px; display:block; }
.ielts-nav-link:hover{ background:var(--accent-soft); color:var(--accent); }
.ielts-nav-link.active{
  background:var(--accent-soft); color:var(--accent); border:1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}

.ielts-sidebar-spacer{ flex:1; }
.ielts-sidebar-foot{ padding:14px 12px 20px 12px; border-top:1px solid var(--border); }
.ielts-back-link{
  display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:11px;
  text-decoration:none; color:var(--muted); font-weight:700; font-size:0.84rem;
  transition:background 0.15s ease, color 0.15s ease;
}
.ielts-back-link:hover{ background:var(--bg); color:var(--text); }

.theme-toggle-row{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:8px 12px 14px 12px; font-size:0.82rem; font-weight:700; color:var(--muted);
}
.theme-toggle{
  position:relative; width:50px; height:28px; border-radius:999px; flex-shrink:0;
  border:1px solid var(--border); background:var(--bg); cursor:pointer; padding:0;
  transition:background 0.18s ease, border-color 0.18s ease;
}
.theme-toggle-thumb{
  position:absolute; top:2px; left:2px; width:22px; height:22px; border-radius:50%;
  background:var(--surface); box-shadow:var(--shadow-sm);
  display:flex; align-items:center; justify-content:center; font-size:0.72rem;
  transition:transform 0.2s ease;
}
.theme-toggle.is-dark{ background:var(--accent-soft); border-color:var(--accent); }
.theme-toggle.is-dark .theme-toggle-thumb{ transform:translateX(22px); }

@media (max-width:860px){
  .ielts-shell{ flex-direction:column; min-height:0; }
  .ielts-sidebar{ width:auto; position:static; height:auto; flex-direction:row; align-items:center; flex-wrap:wrap; }
  .ielts-brand{ padding:14px 16px; }
  .ielts-nav{ flex-direction:row; flex-wrap:wrap; padding:8px 10px; flex:1; }
  .ielts-sidebar-spacer{ display:none; }
  .ielts-sidebar-foot{ border-top:none; padding:8px 10px 12px 10px; }
}

/* ---- Main content ---- */
.ielts-main{ flex:1; min-width:0; }
.ielts-wrap{ max-width:1180px; margin:0 auto; padding:34px 32px 60px 32px; }
@media (max-width:640px){ .ielts-wrap{ padding:22px 16px 40px 16px; } }

.ielts-page-head{ margin-bottom:26px; }
.ielts-page-head h1{ font-family:var(--font-display); font-size:1.7rem; font-weight:700; margin:0 0 6px 0; letter-spacing:-0.01em; }
.ielts-page-head p{ margin:0; color:var(--muted); font-size:0.96rem; }

/* ---- Top pill tabs ---- */
.ielts-tabs{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:22px; }
.ielts-tab{
  display:inline-flex; align-items:center; gap:7px; padding:10px 18px; border-radius:999px;
  border:1px solid var(--border); background:var(--surface); color:var(--muted);
  font-weight:800; font-size:0.86rem; cursor:pointer; transition:all 0.15s ease;
}
.ielts-tab:hover{ border-color:var(--accent); color:var(--accent); }
.ielts-tab.active{ background:var(--accent); border-color:var(--accent); color:#fff; box-shadow:var(--shadow-sm); }
.ielts-tab .tab-badge{
  font-size:0.6rem; font-weight:800; letter-spacing:0.3px; padding:2px 7px; border-radius:999px;
  background:var(--gold-soft); color:var(--gold);
}
.ielts-tab.active .tab-badge{ background:rgba(255,255,255,0.25); color:#fff; }
.ielts-tab:disabled{ opacity:0.5; cursor:not-allowed; }
.ielts-tab:disabled:hover{ border-color:var(--border); color:var(--muted); }

/* ---- Search + filter row ---- */
.ielts-toolbar{
  display:flex; gap:12px; flex-wrap:wrap; align-items:center; margin-bottom:16px;
  background:var(--surface); border:1px solid var(--border); border-radius:16px; padding:12px 16px;
  box-shadow:var(--shadow-sm);
}
.ielts-search{ flex:1 1 240px; display:flex; align-items:center; gap:10px; }
.ielts-search input{
  flex:1; border:none; outline:none; background:transparent; font-family:var(--font-body);
  font-size:0.92rem; color:var(--text);
}
.ielts-search input::placeholder{ color:var(--muted); }
.ielts-select{
  border:1px solid var(--border); border-radius:10px; padding:9px 12px; font-family:var(--font-body);
  font-size:0.85rem; font-weight:700; color:var(--text); background:var(--surface); cursor:pointer;
}

.ielts-filter-row{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:24px; }
.ielts-filter-pill{
  padding:8px 16px; border-radius:999px; border:1px solid var(--border); background:var(--surface);
  color:var(--muted); font-weight:700; font-size:0.82rem; cursor:pointer; transition:all 0.15s ease;
}
.ielts-filter-pill:hover{ border-color:var(--accent); color:var(--accent); }
.ielts-filter-pill.active{ background:var(--text); border-color:var(--text); color:var(--surface); }

/* ---- Test grid + cards ---- */
.ielts-section-label{ font-size:1.05rem; font-weight:800; margin:0 0 14px 0; font-family:var(--font-display); }
.ielts-grid{ display:grid; grid-template-columns:repeat(4, 1fr); gap:14px; }
@media (max-width:1080px){ .ielts-grid{ grid-template-columns:repeat(3, 1fr); } }
@media (max-width:800px){ .ielts-grid{ grid-template-columns:repeat(2, 1fr); } }
@media (max-width:520px){ .ielts-grid{ grid-template-columns:1fr; } }

.ielts-card{
  display:flex; flex-direction:column; text-decoration:none; color:var(--text); background:var(--surface);
  border:1px solid var(--border); border-radius:16px; padding:18px; position:relative;
  transition:transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.ielts-card:hover{ transform:translateY(-3px); box-shadow:var(--shadow-md); border-color:var(--accent); }
.ielts-card-icon{
  width:38px; height:38px; border-radius:11px; background:var(--accent-soft);
  display:flex; align-items:center; justify-content:center; font-size:1.05rem;
  margin-bottom:12px;
}
.ielts-card h3{ font-size:0.96rem; font-weight:800; margin:0 0 10px; line-height:1.4; font-family:var(--font-display); }
.ielts-card-meta{ display:flex; align-items:center; gap:8px; margin-top:auto; font-size:0.78rem; color:var(--muted); font-weight:700; }
.ielts-card-meta > span:first-child{
  background:var(--bg); border:1px solid var(--border); border-radius:999px; padding:3px 10px; color:var(--text);
}
.ielts-badge{
  position:absolute; top:16px; right:16px; font-size:0.64rem; font-weight:800; letter-spacing:0.3px;
  padding:3px 9px; border-radius:999px;
}
.ielts-badge.premium{ background:var(--gold-soft); color:var(--gold); }
.ielts-badge.done{ background:#dcfce7; color:#15803d; }
.ielts-status-done{ display:inline-flex; align-items:center; gap:4px; color:#15803d; font-weight:800; font-size:0.78rem; }

/* ---- Empty state ---- */
.ielts-empty{
  text-align:center; padding:56px 24px; background:var(--surface); border:1px dashed var(--border);
  border-radius:18px; color:var(--muted);
}
.ielts-empty-icon{ font-size:2.4rem; margin-bottom:12px; display:block; }
.ielts-empty h3{ font-family:var(--font-display); font-size:1.15rem; color:var(--text); margin:0 0 6px 0; }
.ielts-empty p{ margin:0; font-size:0.9rem; max-width:380px; margin:0 auto; }

/* ---- Simple content cards (Home / Progress) ---- */
.ielts-hero{
  background:linear-gradient(135deg, var(--accent) 0%, #2c2494 100%); color:#fff;
  border-radius:22px; padding:34px 32px; margin-bottom:26px; position:relative; overflow:hidden;
}
.ielts-hero::before{
  content:""; position:absolute; inset:0; pointer-events:none;
  background:radial-gradient(circle at 85% -10%, rgba(255,255,255,0.18), transparent 55%);
}
.ielts-hero-kicker{
  position:relative; z-index:1; display:inline-flex; align-items:center; gap:6px;
  font-size:0.72rem; font-weight:800; letter-spacing:0.5px; text-transform:uppercase;
  background:rgba(255,255,255,0.16); padding:5px 12px; border-radius:999px; margin-bottom:12px;
}
.ielts-hero h1{ position:relative; z-index:1; font-family:var(--font-display); font-size:1.9rem; margin:0 0 8px 0; }
.ielts-hero p{ position:relative; z-index:1; margin:0 0 18px 0; opacity:0.92; max-width:520px; line-height:1.5; }
.ielts-hero-cta{
  position:relative; z-index:1; display:inline-flex; align-items:center; gap:8px;
  background:#fff; color:var(--accent); text-decoration:none; font-weight:800; font-size:0.9rem;
  padding:11px 20px; border-radius:999px; transition:transform 0.15s ease;
}
.ielts-hero-cta:hover{ transform:translateY(-2px); }

.ielts-stat-row{ display:grid; grid-template-columns:repeat(4, 1fr); gap:14px; margin-bottom:26px; }
@media (max-width:800px){ .ielts-stat-row{ grid-template-columns:repeat(2, 1fr); } }
.ielts-stat-card{ background:var(--surface); border:1px solid var(--border); border-radius:16px; padding:18px; }
.ielts-stat-card .stat-icon{ font-size:1.3rem; margin-bottom:8px; display:block; }
.ielts-stat-card .stat-value{ font-family:var(--font-display); font-size:1.5rem; font-weight:700; }
.ielts-stat-card .stat-label{ font-size:0.78rem; color:var(--muted); font-weight:700; margin-top:2px; }

.ielts-skill-grid{ display:grid; grid-template-columns:repeat(4, 1fr); gap:14px; }
@media (max-width:800px){ .ielts-skill-grid{ grid-template-columns:repeat(2, 1fr); } }
.ielts-skill-card{
  display:flex; flex-direction:column; gap:10px; text-decoration:none; color:var(--text);
  background:var(--surface); border:1px solid var(--border); border-radius:18px; padding:20px;
  transition:transform 0.15s ease, box-shadow 0.15s ease;
}
.ielts-skill-card:hover{ transform:translateY(-3px); box-shadow:var(--shadow-md); }
.ielts-skill-icon{
  width:44px; height:44px; border-radius:13px; display:flex; align-items:center; justify-content:center;
  font-size:1.3rem; background:var(--accent-soft);
}
.ielts-skill-card h3{ margin:0; font-size:1rem; font-weight:800; }
.ielts-skill-card p{ margin:0; font-size:0.82rem; color:var(--muted); line-height:1.4; }
