
/* ================= FIX MOBILE OVERFLOW ================= */

@media (max-width: 980px) {

  .container.main-area {
    max-width: 100%;
    width: 100%;
    margin: 12px 0;
  }

  .site-content {
    min-width: 0;
    width: 100%;
  }

}

/* Prevent accidental horizontal scroll */
html, body {
  overflow-x: hidden;
}




/* static/css/theme.css -- consolidated polished theme (light + dark) */
/* Generic disabled state for links & buttons */
.is-disabled {
  pointer-events: none;        /* disable clicks */
  opacity: 0.45;               /* fade */
  filter: grayscale(80%);      /* desaturate color */
  cursor: not-allowed;
}

/* Optional: icons inside disabled links */
.is-disabled i {
  opacity: 0.6;
}

/* Optional: prevent hover styles from firing */
.is-disabled:hover {
  background: inherit;
  color: inherit;
}


/* Typography and variables */
:root{
  --bg:#f6f7fb;
  --card:#ffffff;
  --muted:#6b7280;
  --accent:#2f80ed;
  --accent-2:#00d1b2;
  --text:#0f172a;
  --sidebar:#ffffff;
  --shadow: 0 6px 18px rgba(12,15,30,0.06);
  --danger: #ef4444;
}

:root[data-theme='dark']{
  --bg:#0b1220;
  --card:#071123;
  --muted:#94a3b8;
  --accent:#60a5fa;
  --accent-2:#34d399;
  --text:#e6eef8;
  --sidebar:#071428;
  --shadow: 0 6px 18px rgba(0,0,0,0.6);
}

*{box-sizing:border-box}
body{
  font-family: Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height:1.55;
  margin:0;
}

/* header & topbar */
.site-header {
  background:var(--card);
  border-bottom:1px solid rgba(0,0,0,0.04);
  position:sticky;
  top:0;
  z-index:1000;
  box-shadow: 0 1px 6px rgba(12,15,30,0.04);
}
.header-inner {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  max-width:1200px;
  margin:0 auto;
  padding:10px 18px;
  box-sizing:border-box;
}

/* left group (brand + search) and right group (icons, user) */
.header-left {
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0; /* allow search to shrink on small screens */
  flex:1 1 auto;
}

.brand {
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
  color:var(--text);
  flex: 0 0 auto;
}
.brand-logo { height:34px; width:auto; display:block; }
.brand-text { font-weight:700; font-size:1.02rem; line-height:1; white-space:nowrap; }

/* header search: grows to use available space */
.header-search {
  display:flex;
  align-items:center;
  gap:6px;
  flex: 1 1 420px;
  min-width:0;   /* important for flex children to shrink */
  max-width:640px;
  position:relative;
}
.header-search .input {
  width:100%;
  min-width:0;
  height:40px;
  padding-right:44px; /* space for icon button */
  border-radius:8px;
  border:1px solid rgba(0,0,0,0.06);
  background: var(--card);
  box-shadow: none;
}

/* search icon inside input (absolute) */
.header-search .search-btn {
  position:absolute;
  right:6px;
  top:50%;
  transform:translateY(-50%);
  border:none;
  background:transparent !important;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:28px;
  width:28px;
  padding:0;
  color:var(--muted);
  cursor:pointer;
}

/* right controls */
.header-right {
  display:flex;
  align-items:center;
  gap:14px;
  flex: 0 0 auto;
}

/* notification badge */
.icon-badge { position:relative; display:inline-block; }
.notif-badge, .badge-inline {
  position:relative;
  background:var(--accent-2);
  color:white;
  font-size:11px;
  padding:2px 6px;
  border-radius:999px;
  min-width:18px;
  text-align:center;
  box-shadow:0 2px 6px rgba(0,0,0,0.12);
  display:inline-block;
}

/* user menu */
.user-dropdown { position:relative; display:inline-block; }
.user-toggle { display:flex; align-items:center; gap:8px; padding:6px 8px; cursor:pointer; border-radius:8px; }
.avatar { width:32px; height:32px; border-radius:50%; object-fit:cover; }
.user-menu {
  display:none;
  position:absolute;
  right:0;
  top:44px;
  min-width:200px;
  background:var(--card);
  box-shadow:var(--shadow);
  border-radius:8px;
  padding:6px;
  z-index:60;
}
.user-menu a { display:block; padding:8px 10px; color:var(--text); text-decoration:none; border-radius:6px; }
.user-menu a:hover { background: rgba(0,0,0,0.03); }

/* show user-menu when container has .open (ui.js toggles this) */
.user-dropdown.open .user-menu { display:block; }

/* layout */
.container.main-area {
  display:grid;
  grid-template-columns: 260px 1fr;
  gap:20px;
  padding:18px 20px;
  width:100%;
  max-width:1200px;
  margin:18px auto;
  box-sizing:border-box;
}
.site-sidebar { background:transparent; padding:10px 8px; position:sticky; top:12px; height:calc(100vh - 140px); overflow:auto; }
.site-content { background:transparent; }
.page-top { margin-bottom:12px; }
.page-body { background:var(--card); padding:18px; border-radius:10px; box-shadow:var(--shadow); }

/* sidebar nav */
.sidebar .nav a, .menu-list a { display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:8px; color:var(--text); text-decoration:none; margin-bottom:6px; }
.menu-list a:hover { background: rgba(0,0,0,0.03); }

/* footer */
.site-footer { margin-top:auto; padding:14px 18px; background:transparent; border-top:1px solid rgba(0,0,0,0.04); }
.footer-inner { max-width:1200px; margin:0 auto; display:flex; justify-content:space-between; align-items:center; color:var(--muted); }

/* responsiveness */
@media (max-width: 980px) {
  .container.main-area { grid-template-columns: 1fr; padding:12px; }
  /* sidebar becomes overlay and hidden by default (ui.js toggles) */
  .site-sidebar {
    display:none;
    position:fixed;
    left:0;
    top:62px;
    z-index:995;
    background:var(--sidebar);
    width:260px;
    height:calc(100vh - 62px);
    box-shadow:var(--shadow);
    overflow:auto;
  }
  /* hide search on small screens (to save space) */
  .header-search { display:none; }
  .header-inner { padding:8px 12px; }
}

/* small helpers */
.small-muted { color:var(--muted); font-size:0.9rem; }
.header-inner .username { max-width:160px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:inline-block; }

/* =================== Student dashboard enhancements =================== */

.grid-dashboard {
  display:grid;
  grid-template-columns: 1fr 320px;
  gap:20px;
  margin-top:12px;
}
@media (max-width:1000px){ .grid-dashboard { grid-template-columns: 1fr; } }

/* Card surface */
.card-surface { border-radius:12px; padding:12px; box-shadow: var(--shadow); background:var(--card); border:1px solid rgba(0,0,0,0.03); }

/* Exams area */
.exams-grid { display:flex; flex-direction:column; gap:12px; }

/* single exam card */
.exam-card {
  display:flex;
  flex-direction:column;
  padding:12px;
  border-radius:10px;
  transition: transform .14s ease, box-shadow .14s ease;
  border:1px solid rgba(0,0,0,0.03);
  background: linear-gradient(180deg, rgba(255,255,255,0.6), rgba(255,255,255,0.3));
}
.exam-card:hover { transform: translateY(-6px); box-shadow: 0 14px 40px rgba(12,15,30,0.06); }

.exam-card.locked { opacity:0.92; filter: grayscale(0.03); }

.exam-meta { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:6px; }
.exam-title { display:flex; align-items:center; gap:8px; }
.exam-sub { color:var(--muted); font-size:0.9rem; margin-top:4px; }

.exam-body { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-top:8px; }
.exam-info { flex:1; min-width:0; }
.exam-actions { display:flex; flex-direction:column; align-items:flex-end; gap:8px; }

.lock-badge {
  display:inline-flex;
  align-items:center;
  gap:8px;
  background:#efefef;
  padding:6px 10px;
  border-radius:8px;
  color:var(--muted);
  font-weight:600;
  border:1px solid rgba(0,0,0,0.03);
}

/* passing text */
.passing { font-size:0.9rem; color:var(--muted); margin-top:6px; }

/* Right column stats */
.stats-overview { padding:18px; }
.stats-grid { display:grid; grid-template-columns: 1fr 1fr; gap:10px; margin-top:8px; }
.stat-item { background:rgba(0,0,0,0.02); padding:12px; border-radius:8px; text-align:center; }
.stat-value { font-size:1.3rem; font-weight:700; }
.stat-label { color:var(--muted); font-size:0.85rem; }

/* subtle entrance animation for cards */
@keyframes floatIn {
  from { opacity:0; transform:translateY(6px) scale(0.995);}
  to { opacity:1; transform:translateY(0) scale(1);}
}
.card-surface { animation: floatIn .26s ease both; }

/* small responsive adjustments */
@media (max-width:700px){
  .exam-actions { align-items:flex-start; }
  .exam-body { flex-direction:column; align-items:flex-start; }
}

/* small table responsiveness helper used on dashboards */
.table-responsive { width:100%; overflow:auto; -webkit-overflow-scrolling:touch; }

/* utility: subtle link appearance */
a { color: var(--accent); }
a:hover { text-decoration: underline; }

/* end of theme.css */


/* =====================================
   Practice page alignment (NO sidebar)
   ===================================== */

.practice-page {
  width: 100%;
  display: flex;
  justify-content: center;   /* horizontal centering */
  padding-top: 24px;
}

.practice-card {
  width: 100%;
  max-width: 420px;          /* nice card width */
}



.practice-modes {
  font-size: 0.95rem;
}

.practice-link {
  color: #3273dc; /* Bulma primary */
  font-weight: 500;
  text-decoration: none;
}

.practice-link:hover {
  text-decoration: underline;
}


/* ===============================
   MOBILE SIDEBAR FIX
   =============================== */

/* Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 990;
}

/* Active states */
.site-sidebar.is-active {
  display: block !important;
}

.sidebar-overlay.is-active {
  display: block;
}

/* Prevent body scroll when sidebar open */
body.sidebar-open {
  overflow: hidden;
}


/* ===============================
   MOBILE HEADER ALIGNMENT FIX
   =============================== */

@media (max-width: 768px) {

  .header-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
  }

  /* LEFT: hamburger */
  #sidebar-toggle {
    justify-self: start;
  }

  /* CENTER: brand */
  .brand-group {
    justify-self: center;
  }

  .brand {
    gap: 6px;
  }

  /* Hide brand text on small screens */
  .brand-text {
    display: none;
  }

  .brand-logo {
    height: 32px;
  }

  /* RIGHT: actions */
  .header-right {
    justify-self: end;
    gap: 8px;
  }

  /* Make buttons compact */
  .header-right .button {
    padding: 6px 10px;
    font-size: 0.85rem;
  }

  /* Login button looks cleaner */
  .header-right .is-primary {
    border-radius: 8px;
  }
}

.site-header {
  min-height: 56px;
}

/* =====================================
   STUDENT DASHBOARD – MOBILE FIX
   ===================================== */

@media (max-width: 768px) {

  /* Exam card layout stacks vertically */
  .box > .is-flex {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  /* Buttons stack nicely */
  .buttons {
    flex-wrap: wrap;
    gap: 6px;
  }

  /* Passed + retake row */
  .passed-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  /* Countdown text goes below button */
  [data-countdown] {
    display: block;
    margin-top: 4px;
    margin-left: 0 !important;
  }

  /* Reduce heading size slightly */
  h3.title.is-5 {
    font-size: 1rem;
  }
}

/* =====================================
   DASHBOARD VISUAL POLISH
   ===================================== */

/* Exam card polish */
.box {
  border-radius: 12px;
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.box:hover {
  box-shadow: 0 10px 28px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

/* Track heading */
h3.title.is-5 {
  font-weight: 600;
  margin-bottom: 12px;
}

/* Passed row spacing */
.passed-row .tag {
  font-weight: 600;
}

/* Buttons feel lighter */
.buttons .button {
  border-radius: 8px;
}

/* Cooldown text */
.countdown-text {
  font-weight: 600;
}

/* =====================================
   TRACK ACCORDION
   ===================================== */

.track-accordion {
  margin-top: 18px;
}

.track-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--card);
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.04);
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
}

.track-header:hover {
  background: rgba(0,0,0,0.03);
}

.track-arrow {
  transition: transform 0.25s ease;
}

.track-body {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
  margin-top: 10px;
}

/* OPEN STATE */
.track-accordion.is-open .track-body {
  max-height: 5000px; /* enough for many exams */
}

.track-accordion.is-open .track-arrow {
  transform: rotate(180deg);
}


/* =====================================
   TRACK EXAM COUNT (SAFE ADDITION)
   ===================================== */

.track-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.track-title {
  font-weight: 600;
}

/* Count badge */
.track-count {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,0.08);
  color: var(--muted);
  white-space: nowrap;
}

/* Dark mode tweak */
:root[data-theme='dark'] .track-count {
  background: rgba(255,255,255,0.12);
  color: var(--muted);
}



/* ================= LAYOUT (STICKY FOOTER) ================= */
/* ================= STICKY FOOTER LAYOUT ================= */
html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
}

#app,
.main-content {
  flex: 1;
}

/* ================= FOOTER ================= */
.site-footer {
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  padding: 14px 16px;
  font-size: 0.9rem;
  margin-top: auto;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.footer-copy {
  color: #6b7280;
}

.footer-links {
  text-align: center;
}

.footer-sep {
  margin: 0 6px;
  color: #9ca3af;
}

.footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
}

/* Links */
.footer-link {
  background: none;
  border: none;
  cursor: pointer;
  color: #374151;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  text-decoration: none;
}

.footer-link:hover {
  color: #16a34a;
}

/* WhatsApp */
.footer-link.whatsapp i {
  color: #22c55e;
}

/* ================= WHATSAPP PULSE ================= */
.pulse {
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ================= TOAST ================= */
#copy-toast {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: #16a34a;
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 9999;
}

#copy-toast.show {
  opacity: 1;
}

/* ================= DARK MODE ================= */
:root[data-theme='dark'] .site-footer {
  background: #0f172a;
  border-top-color: #1e293b;
}

:root[data-theme='dark'] .footer-copy {
  color: #94a3b8;
}

:root[data-theme='dark'] .footer-link {
  color: #e5e7eb;
}

:root[data-theme='dark'] .footer-link:hover {
  color: #22c55e;
}

:root[data-theme='dark'] #copy-toast {
  background: #22c55e;
  color: #052e16;
}
/* ================= MOBILE ================= */
@media (max-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-actions {
    justify-content: center;
  }


  /*sidebar */
  .site-sidebar .menu-list a {
  border-radius: 6px;
  transition: all 0.2s ease;
}

.site-sidebar .menu-list a:hover {
  background-color: #f5f5f5;
  padding-left: 12px;
}
.site-sidebar .menu-list a:hover {
  background-color: #f5f5f5 !important;
}


}


/* =====================================================
   GLOBAL DARK BACKGROUND FIX
   ===================================================== */

:root[data-theme='dark']{
  --bg:#0f172a;     /* softer dark */
  --card:#111c2e;   /* slightly lighter card */
}

/* Remove white Bulma surfaces */
:root[data-theme='dark'] .box,
:root[data-theme='dark'] .notification,
:root[data-theme='dark'] .card,
:root[data-theme='dark'] .page-body {
  background: var(--card) !important;
  border-color: rgba(255,255,255,0.08);
  color: var(--text);
}
