/* AspireTutor LMS - Custom Modern Design System */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg-primary: #0f172a;
  --bg-surface: #1e293b;
  --bg-card: rgba(30, 41, 59, 0.85);
  --bg-card-hover: rgba(51, 65, 85, 0.9);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #6366f1;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-light: #cbd5e1;

  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-glow: rgba(99, 102, 241, 0.35);
  --accent-secondary: #06b6d4;
  --accent-success: #10b981;
  --accent-warning: #f59e0b;
  --accent-danger: #ef4444;

  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.1) 0%, transparent 40%);
  background-attachment: fixed;
}

a {
  color: var(--accent-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: #67e8f9;
}

code, pre {
  word-break: break-all !important;
  overflow-wrap: anywhere !important;
  white-space: pre-wrap !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-main);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

h1 { font-size: 2.25rem; font-weight: 700; }
h2 { font-size: 1.75rem; font-weight: 600; }
h3 { font-size: 1.35rem; font-weight: 600; }

/* Layout Wrappers */
.app-container {
  display: flex;
  flex: 1;
  width: 100%;
}

.sidebar {
  width: 260px;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-color);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  background: linear-gradient(135deg, #818cf8, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  list-style: none;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-item a:hover, .nav-item.active a {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border-left: 3px solid var(--accent-primary);
}

.main-content {
  flex: 1;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* Header Navbar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
}

/* Cards & Glassmorphic UI */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  border-color: rgba(99, 102, 241, 0.3);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.card-header > div {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.grid-cols-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.grid-cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-cols-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-cols-1 { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }

/* Study Hub Specific 1fr + 2fr Layout Grid */
.study-hub-layout {
  display: grid;
  grid-template-columns: minmax(0, 340px) 1fr;
  gap: 1.5rem;
  align-items: start;
}
.study-hub-layout > * { min-width: 0; max-width: 100%; box-sizing: border-box; }

/* Grid Child Boundary & Form Overflow Prevention */
.grid-cols-4 > *, .grid-cols-3 > *, .grid-cols-2 > *, .grid-cols-1 > * {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Page Header Flex Utility */
.page-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  gap: 1rem;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.mobile-menu-toggle {
  display: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}

@media (max-width: 1024px) {
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
  .study-hub-layout { grid-template-columns: minmax(0, 280px) 1fr; }
}

@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
  }

  .app-container {
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.75rem 1rem;
    gap: 0.75rem;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
  }

  .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 40px;
    padding: 0.4rem 0.75rem;
  }

  .nav-menu {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
  }

  .nav-menu.show-mobile-nav {
    display: flex;
  }

  .main-content {
    padding: 1rem 0.75rem 95px !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: clip; /* clip prevents cutting scrollable children like subject slider */
  }
  .study-hub-layout { grid-template-columns: 1fr !important; }

  .top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
    padding-bottom: 0.85rem;
    margin-bottom: 1.25rem;
    width: 100%;
  }

  .user-profile-badge {
    width: 100%;
    justify-content: space-between;
    padding: 0.5rem 0.85rem;
    box-sizing: border-box;
  }

  .page-header-flex {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    width: 100%;
  }

  .grid-cols-4, .grid-cols-3, .grid-cols-2 {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
    width: 100%;
  }

  /* Force all grid items and inline styles to span 1 column */
  .grid-cols-4 > *, .grid-cols-3 > *, .grid-cols-2 > *,
  [style*="grid-column"] {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .card {
    padding: 1.15rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    overflow: visible;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding-bottom: 0.85rem;
    margin-bottom: 1.25rem;
    width: 100%;
  }

  .card-header h1, .card-header h2, .card-header h3, .card-header h4 {
    margin: 0;
    word-break: break-word;
  }

  .card-header .btn {
    align-self: flex-start;
  }

  .table-responsive {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    margin-bottom: 1rem;
    display: block !important;
    box-sizing: border-box !important;
    border-radius: var(--radius-sm);
  }

  .table {
    min-width: 600px !important;
    width: 100% !important;
    font-size: 0.875rem;
  }

  .table th {
    white-space: nowrap !important;
    padding: 0.75rem 0.85rem !important;
    font-size: 0.775rem !important;
  }

  .table td {
    padding: 0.75rem 0.85rem !important;
    font-size: 0.85rem !important;
    vertical-align: middle;
  }

  .table td .badge, .table td code {
    white-space: nowrap !important;
  }

  .stat-card {
    padding: 1rem !important;
    gap: 0.85rem !important;
  }

  .stat-icon {
    width: 44px !important;
    height: 44px !important;
    font-size: 1.25rem !important;
    flex-shrink: 0;
  }

  .stat-val {
    font-size: 1.5rem !important;
  }

  .stat-lbl {
    font-size: 0.8rem !important;
    line-height: 1.3;
  }

  .timetable-slot-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
    width: 100%;
    box-sizing: border-box;
  }

  .timetable-slot-card > div {
    width: 100%;
  }

  .timetable-slot-card .btn,
  .timetable-slot-card .badge-success,
  .timetable-slot-card .badge-warning {
    width: 100% !important;
    text-align: center;
    box-sizing: border-box;
    justify-content: center;
    display: flex;
  }

  .form-control, .btn {
    font-size: 0.9rem;
    width: 100%;
    box-sizing: border-box;
  }

  .btn {
    max-width: 100%;
    white-space: normal;
    text-align: center;
  }

  .option-box {
    padding: 0.85rem 1rem;
    min-height: 48px;
    align-items: center;
    word-break: break-word;
  }

  .zen-timer-circle {
    width: 170px;
    height: 170px;
    margin: 1.5rem 0;
  }

  .zen-timer-val {
    font-size: 2.5rem;
  }

  .certificate-frame {
    padding: 1.5rem 0.85rem;
    border-width: 6px;
    margin: 0 0.25rem;
  }

  .certificate-title {
    font-size: 1.6rem;
  }
}

/* Mobile Fixed Bottom Navigation for Student Portal */
.mobile-bottom-nav {
  display: none !important;
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    z-index: 9999;
    justify-content: space-around;
    align-items: center;
    padding: 0.35rem 0.5rem;
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.5);
  }

  .nav-bottom-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.725rem;
    font-weight: 600;
    text-decoration: none;
    min-width: 56px;
    min-height: 48px;
    border-radius: var(--radius-md);
    transition: all 0.15s ease;
  }

  .nav-bottom-item.active, .nav-bottom-item:hover {
    color: #818cf8;
    background: rgba(99, 102, 241, 0.15);
  }

  .nav-bottom-icon {
    font-size: 1.25rem;
    line-height: 1;
    margin-bottom: 2px;
  }
}

/* Modern Mobile Offcanvas Navigation Drawer */
body.mobile-nav-open {
  overflow: hidden !important;
}

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 13, 22, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 100000 !important;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  display: flex;
  justify-content: flex-end;
}

.mobile-nav-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.mobile-nav-sheet {
  width: 85%;
  max-width: 340px;
  height: 100%;
  background: #0f172a;
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.7);
  overflow-y: auto;
  padding: 1.25rem 1rem 5.5rem 1rem;
  box-sizing: border-box;
}

.mobile-nav-backdrop.active .mobile-nav-sheet {
  transform: translateX(0);
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.mobile-nav-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-nav-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #ef4444;
}

.mobile-nav-user-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.mobile-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  color: #cbd5e1;
  font-size: 0.925rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
}

.mobile-nav-link:hover {
  background: rgba(99, 102, 241, 0.12);
  color: #fff;
}

.mobile-nav-link.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(79, 70, 229, 0.25));
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #818cf8;
  font-weight: 700;
}

.mobile-nav-link-icon {
  font-size: 1.2rem;
  width: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Precise Touch Target Scaling down to 320px Viewports */
@media (max-width: 480px) {
  h1 { font-size: 1.5rem; word-break: break-word; }
  h2 { font-size: 1.25rem; word-break: break-word; }
  h3 { font-size: 1.1rem; word-break: break-word; }

  .main-content {
    padding: 0.85rem 0.5rem 95px !important;
  }

  .card {
    padding: 0.95rem 0.75rem;
    border-radius: var(--radius-sm);
  }

  .btn, .form-control {
    min-height: 44px;
    font-size: 0.875rem;
  }

  .option-box {
    min-height: 48px;
    padding: 0.75rem 0.85rem;
    font-size: 0.875rem;
  }

  #exam-countdown-container > div {
    min-width: 48px !important;
    padding: 0.35rem 0.4rem !important;
  }
}

@media (max-width: 340px) {
  body {
    font-size: 0.85rem;
  }
  .card {
    padding: 0.75rem 0.5rem;
  }
  .nav-bottom-label {
    display: none;
  }
  .nav-bottom-icon {
    font-size: 1.4rem;
  }
}

/* Stat Widgets */
.stat-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.stat-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-icon.primary { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.stat-icon.success { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.stat-icon.warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.stat-icon.cyan { background: rgba(6, 182, 212, 0.15); color: #22d3ee; }

.stat-val { font-size: 1.85rem; font-weight: 700; font-family: var(--font-heading); }
.stat-lbl { color: var(--text-muted); font-size: 0.875rem; }

/* Buttons & Inputs */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  min-height: 44px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.925rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  font-family: var(--font-body);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-hover));
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.btn-secondary {
  background: var(--bg-surface);
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: #334155;
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
}

.btn-sm { padding: 0.35rem 0.75rem; min-height: 36px; font-size: 0.825rem; }

.timetable-slot-card {
  background: var(--bg-surface);
  padding: 1rem 1.25rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow: visible;
}

.form-label {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-light);
  max-width: 100%;
}

.form-control {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: #ffffff;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.95rem;
  min-height: 44px;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  text-overflow: ellipsis !important;
  overflow: visible !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  color-scheme: dark;
}

/* Ensure containers of dropdowns and date/time pickers float freely without clipping */
.form-group, .card, .grid-cols-2, .grid-cols-3, .grid-cols-4 {
  overflow: visible !important;
}

input[type="date"],
input[type="time"],
input[type="datetime-local"] {
  color-scheme: dark;
  position: relative;
}

select, select.form-control {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  background-color: var(--bg-surface) !important;
  color: #ffffff !important;
  padding: 0.65rem 2.25rem 0.65rem 1rem !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-md) !important;
  font-family: var(--font-body) !important;
  font-size: 0.9rem !important;
  min-height: 44px !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.85rem center !important;
  background-size: 1.1rem !important;
  cursor: pointer;
  text-overflow: ellipsis !important;
  overflow: hidden !important;
  white-space: nowrap !important;
}

select:focus, select.form-control:focus {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 3px var(--accent-glow) !important;
  outline: none !important;
}

.form-control::placeholder {
  color: #94a3b8;
  opacity: 0.8;
}

select option, select.form-control option {
  background-color: #0f172a !important;
  color: #ffffff !important;
  padding: 0.75rem 1rem !important;
  font-size: 0.9rem !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Tables */
.table-responsive {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table th, .table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.table th {
  background: rgba(15, 23, 42, 0.6);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.825rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table tbody tr {
  transition: background 0.15s ease;
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* Badges & Tags */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-primary { background: rgba(99, 102, 241, 0.2); color: #a5b4fc; border: 1px solid rgba(99, 102, 241, 0.3); }
.badge-success { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-warning { background: rgba(245, 158, 11, 0.2); color: #fde047; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-danger { background: rgba(239, 68, 68, 0.2); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3); }

/* Progress Bars */
.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: var(--bg-surface);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Zen Focus Overlay */
.zen-overlay {
  position: fixed;
  inset: 0;
  background: #090d16;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.zen-timer-circle {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  border: 6px solid var(--accent-primary);
  box-shadow: 0 0 50px var(--accent-glow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 2rem 0;
  background: rgba(30, 41, 59, 0.5);
}

.zen-timer-val {
  font-size: 3.5rem;
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 2px;
  color: #fff;
}

/* Question Option Selection */
.option-box {
  background: var(--bg-surface);
  border: 2px solid var(--border-color);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s ease;
}

.option-box:hover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.08);
}

.option-box.selected {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.2);
}

.option-key {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* Certificate Styles */
.certificate-frame {
  background: #ffffff;
  color: #1e293b;
  padding: 3rem;
  border: 12px double #6366f1;
  border-radius: 8px;
  text-align: center;
  max-width: 850px;
  margin: 0 auto;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  position: relative;
}

.certificate-title {
  font-size: 2.75rem;
  color: #312e81;
  font-family: 'Outfit', serif;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

@media print {
  body.printing-certificate * { visibility: hidden; }
  body.printing-certificate .certificate-frame, body.printing-certificate .certificate-frame * { visibility: visible; }
  body.printing-certificate .certificate-frame { position: absolute; left: 0; top: 0; width: 100%; box-shadow: none; }
}

/* Math & Chemistry Notation Styling (MathJax) */
mjx-container {
  color: var(--text-main) !important;
  font-size: 105% !important;
  margin: 0 0.2rem !important;
  outline: none !important;
}

mjx-container[jax="CHTML"][display="true"] {
  margin: 1rem 0 !important;
}

/* Modal Dialog System */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(9, 13, 22, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 999999999 !important;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  overflow-y: auto;
}

.modal-dialog {
  position: relative;
  z-index: 9999999999 !important;
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1.5px solid var(--accent-primary);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95), 0 0 35px rgba(99, 102, 241, 0.35);
  box-sizing: border-box;
  background: #1e293b !important;
}

/* Bulk Selection & Action Toolbar */
.bulk-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.98));
  border: 1.5px solid var(--accent-primary);
  border-radius: 12px;
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6), 0 0 20px rgba(99, 102, 241, 0.25);
  flex-wrap: wrap;
  transition: all 0.2s ease;
}

.bulk-actions-bar.hidden {
  display: none !important;
}

.bulk-select-chk {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent-primary);
}

@media (max-width: 640px) {
  .modal-backdrop {
    padding: 0.75rem 0.5rem;
    align-items: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .modal-dialog {
    max-height: 94vh;
    padding: 1.15rem 0.85rem;
    margin: auto 0;
  }
  .bulk-actions-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}

/* True Edge-to-Edge Immersive Protected PDF Reader */
.secure-pdf-fullscreen-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: #090d16;
  z-index: 99999999 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  box-sizing: border-box;
}

.secure-pdf-fullscreen-dialog {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  background: #090d16 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

/* Header & Nav Notification Badges */
.header-bell-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: var(--text-main);
  transition: all 0.2s ease;
}

.header-bell-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--accent-primary);
}

.bell-count-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent-danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-full);
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
}

.nav-notif-badge {
  background: var(--accent-danger);
  color: #fff;
  font-size: 0.725rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
}

.bottom-nav-badge {
  position: absolute;
  top: 4px;
  right: 12px;
  background: var(--accent-danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Notification Item Cards */
.notification-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1rem;
  transition: all 0.2s ease;
  position: relative;
}

.notification-card.unread {
  border-left: 4px solid var(--accent-primary);
  background: rgba(99, 102, 241, 0.08);
}

.notification-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.notification-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.notif-type-badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.notif-type-announcement { background: rgba(99, 102, 241, 0.2); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.4); }
.notif-type-test_alert { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.notif-type-urgent { background: rgba(239, 68, 68, 0.2); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.4); }
.notif-type-info { background: rgba(6, 182, 212, 0.2); color: #67e8f9; border: 1px solid rgba(6, 182, 212, 0.4); }
.notif-type-assignment { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.4); }

/* Mobile Responsive Calendar Grid Adjustments */
@media (max-width: 600px) {
  .calendar-card {
    padding: 1rem 0.75rem !important;
  }
  .cal-day-cell {
    min-height: 48px !important;
    padding: 0.25rem 0.15rem !important;
  }
  .cal-day-cell span {
    font-size: 0.75rem !important;
  }
  .cal-day-cell div {
    font-size: 0.55rem !important;
    padding: 1px 2px !important;
  }
}

/* Mobile-First Study Hub & Notes System Styles */
.study-subject-slider {
  display: flex;
  gap: 0.65rem;
  overflow-x: auto;
  padding: 0.75rem 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.5) transparent;
  -webkit-overflow-scrolling: touch;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  margin-bottom: 1.5rem;
}

.study-subject-slider::-webkit-scrollbar {
  height: 5px;
}
.study-subject-slider::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.4);
  border-radius: 10px;
}

.subject-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(51, 65, 85, 0.9);
  border: 1.5px solid rgba(148, 163, 184, 0.25);
  padding: 0.55rem 1rem;
  border-radius: 999px;
  color: #cbd5e1;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.08);
}

.subject-pill:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.65);
  background: rgba(71, 85, 105, 0.95);
  color: #fff;
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.28);
  text-decoration: none;
}

.subject-pill.active {
  background: linear-gradient(135deg, #4338ca, #6366f1) !important;
  border-color: #818cf8 !important;
  color: #ffffff !important;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.55) !important;
  font-weight: 700;
}

.subject-pill .pill-progress {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  color: #e2e8f0;
}
.subject-pill.active .pill-progress {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

/* Accordion Drawer Component */
.chapter-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.4) transparent;
}

.chapter-accordion::-webkit-scrollbar {
  width: 4px;
}
.chapter-accordion::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.4);
  border-radius: 10px;
}

.accordion-chapter-item {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: visible;
  transition: border-color 0.2s ease;
}

.accordion-chapter-item.active-chapter {
  border-color: var(--accent-primary);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
}

.accordion-header-btn {
  width: 100%;
  padding: 0.85rem 1rem;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #f1f5f9 !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  font-family: inherit;
  font-size: 0.925rem;
  font-weight: 600;
  cursor: pointer;
  gap: 0.5rem;
  outline: none !important;
}

.accordion-header-btn:hover {
  background: rgba(255, 255, 255, 0.04) !important;
}

.accordion-topic-list {
  display: flex;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  padding: 0.4rem 0.6rem 0.75rem 0.6rem;
  gap: 0.35rem;
  border-top: 1px dashed var(--border-color);
  background: rgba(10, 15, 30, 0.6);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  width: 100%;
  box-sizing: border-box;
}

.topic-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-light);
  font-size: 0.845rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
  background: rgba(255, 255, 255, 0.025);
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
}

.topic-list-item:hover {
  background: rgba(99, 102, 241, 0.12);
  color: #fff;
}

.topic-list-item.active-topic {
  background: rgba(99, 102, 241, 0.22);
  color: #a5b4fc;
  border-left: 3px solid var(--accent-primary);
  font-weight: 700;
}

/* Mobile Sticky Reader Bottom Bar */
.sticky-study-bar {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.75rem 1rem;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.5);
}

/* Notes Reader Formatting */
.notes-body-content {
  font-size: 1.025rem;
  line-height: 1.8;
  color: #e2e8f0;
}

.notes-body-content h1,
.notes-body-content h2,
.notes-body-content h3 {
  color: #ffffff;
  margin: 1.5rem 0 0.75rem 0;
}

.notes-body-content p {
  margin-bottom: 1.15rem;
}

.notes-body-content ul,
.notes-body-content ol {
  margin: 1rem 0 1.25rem 1.5rem;
}

.notes-body-content li {
  margin-bottom: 0.4rem;
}

.notes-body-content pre {
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem;
  border-radius: 10px;
  overflow-x: auto;
  font-family: monospace;
  font-size: 0.9rem;
  margin: 1rem 0;
}

/* Strict Assessment Proctoring & Anti-Cheat Styles */
.proctor-blurred {
  filter: blur(28px) brightness(0.35) !important;
  pointer-events: none !important;
  user-select: none !important;
  transition: filter 0.15s ease;
}

.proctor-locked-container {
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  -webkit-touch-callout: none !important;
}

.proctor-watermark-overlay {
  position: fixed;
  inset: -20vw;
  pointer-events: none;
  z-index: 50;
  overflow: hidden;
  opacity: 0.055;
  display: flex;
  flex-wrap: wrap;
  gap: 4rem 5rem;
  justify-content: center;
  align-items: center;
  transform: rotate(-22deg);
  user-select: none;
}

.proctor-watermark-item {
  font-size: 1rem;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* Pulse Glow for Strict Security Mode */
.security-pulse-dot {
  width: 10px;
  height: 10px;
  background: #10b981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 rgba(16, 185, 129, 0.7);
  animation: securityPulse 2s infinite;
}

@keyframes securityPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}


