/* ==========================================================================
   APSIS PRO UJIAN 2026 - Master Design Tokens & Core Layout
   Berdasarkan 06_DESIGN_APSIS_PRO_v1.0 & Visual Mockup Resmi
   ========================================================================== */

:root {
  /* Brand Colors */
  --brand-50: #EFF6FF;
  --brand-100: #DBEAFE;
  --brand-200: #BFDBFE;
  --brand-500: #3B82F6;
  --brand-600: #2563EB;
  --brand-700: #1D4ED8;
  --brand-800: #1E40AF;
  --brand-900: #1E3A8A;

  /* Accent Emerald / Cyan */
  --accent-cyan: #06B6D4;
  --accent-emerald: #10B981;

  /* Neutrals (Light Mode Scale) */
  --neutral-0: #FFFFFF;
  --neutral-50: #F8FAFC;
  --neutral-100: #F1F5F9;
  --neutral-200: #E2E8F0;
  --neutral-300: #CBD5E1;
  --neutral-400: #94A3B8;
  --neutral-500: #64748B;
  --neutral-600: #475569;
  --neutral-700: #334155;
  --neutral-800: #1E293B;
  --neutral-900: #0F172A;

  /* Universal High-Contrast Tokens */
  --text-white: #FFFFFF;
  --text-main: #0F172A;
  --text-heading: #1E293B;
  --text-body: #334155;
  --text-muted: #64748B;
  --text-brand: #1E40AF;
  --text-brand-accent: #2563EB;

  /* Semantic Alerts */
  --success-50: #F0FDF4;
  --success-500: #22C55E;
  --success-700: #15803D;

  --warning-50: #FFFBEB;
  --warning-500: #F59E0B;
  --warning-800: #92400E;

  --danger-50: #FEF2F2;
  --danger-500: #EF4444;
  --danger-700: #B91C1C;

  --info-50: #F0F9FF;
  --info-500: #0EA5E9;
  --info-700: #0369A1;

  /* Elevation Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.15);

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Font */
  --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ==========================================================================
   Dark Mode Master Tokens - Inverted High Contrast Scale
   ========================================================================== */
[data-theme="dark"] {
  /* Surfaces */
  --neutral-0: #1E293B;       /* Card surface */
  --neutral-50: #0F172A;      /* App background */
  --neutral-100: #1E293B;     /* Muted surface */
  --neutral-200: #334155;     /* Dividers & Borders */
  --neutral-300: #475569;     /* Subtle borders */

  /* Inverted High-Contrast Text Scale */
  --neutral-400: #94A3B8;     /* Muted text */
  --neutral-500: #CBD5E1;     /* Secondary/Label text */
  --neutral-600: #E2E8F0;     /* Body text */
  --neutral-700: #F1F5F9;     /* Primary text */
  --neutral-800: #F8FAFC;     /* Strong headings */
  --neutral-900: #FFFFFF;     /* Brightest titles */

  /* Adaptive Text Variables */
  --text-main: #FFFFFF;
  --text-heading: #F8FAFC;
  --text-body: #E2E8F0;
  --text-muted: #CBD5E1;
  --text-brand: #93C5FD;
  --text-brand-accent: #60A5FA;

  /* Brand adjustments for dark mode */
  --brand-50: rgba(37, 99, 235, 0.16);
  --brand-100: rgba(37, 99, 235, 0.25);
  --brand-200: rgba(37, 99, 235, 0.35);

  /* Semantic Alerts */
  --success-50: rgba(16, 185, 129, 0.15);
  --success-500: #34D399;
  --success-700: #6EE7B7;

  --warning-50: rgba(245, 158, 11, 0.15);
  --warning-500: #FBBF24;
  --warning-800: #FDE68A;

  --danger-50: rgba(239, 68, 68, 0.15);
  --danger-500: #F87171;
  --danger-700: #FCA5A5;

  --info-50: rgba(14, 165, 233, 0.15);
  --info-500: #38BDF8;
  --info-700: #7DD3FC;

  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Custom Sleek Scrollbars across whole app */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--neutral-300);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--neutral-400);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}

html, body {
  height: 100%;
  font-family: var(--font-sans);
  background-color: var(--neutral-50);
  color: var(--neutral-900);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* Master Layout */
#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar Navigation */
.app-sidebar {
  width: 260px;
  background-color: var(--neutral-0);
  border-right: 1px solid var(--neutral-200);
  display: flex;
  flex-direction: column;
  transition: width var(--transition-normal);
  z-index: 40;
  flex-shrink: 0;
}

.sidebar-brand {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--neutral-200);
}

.sidebar-brand img {
  height: 38px;
  width: auto;
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  color: var(--neutral-600);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke-width: 2;
  stroke: var(--neutral-400);
  transition: stroke var(--transition-fast);
}

.nav-item:hover {
  background-color: var(--brand-50);
  color: var(--brand-600);
}

.nav-item:hover svg {
  stroke: var(--brand-600);
}

.nav-item.active {
  background-color: var(--brand-600) !important;
  color: #FFFFFF !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  font-weight: 700;
}

.nav-item.active svg {
  stroke: #FFFFFF !important;
}

.nav-item.active span {
  color: #FFFFFF !important;
}

[data-theme="dark"] .nav-item {
  color: #CBD5E1;
}

[data-theme="dark"] .nav-item svg {
  stroke: #94A3B8;
}

[data-theme="dark"] .nav-item:hover {
  background-color: rgba(37, 99, 235, 0.18);
  color: #60A5FA;
}

[data-theme="dark"] .nav-item:hover svg {
  stroke: #60A5FA;
}

[data-theme="dark"] .nav-item.active {
  background-color: #2563EB !important;
  color: #FFFFFF !important;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--neutral-200);
  background: var(--neutral-50);
}

.mode-badge-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--neutral-0);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--neutral-200);
}

.mode-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  color: var(--neutral-400);
}

.mode-active-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-600);
}

/* App Main Content Area */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--neutral-50);
}

/* Top App Header */
.app-header {
  height: 68px;
  background-color: var(--neutral-0);
  border-bottom: 1px solid var(--neutral-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  z-index: 30;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.school-selector-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: var(--neutral-50);
  border: 1px solid var(--neutral-200);
  padding: 6px 14px;
  border-radius: var(--radius-full);
}

.school-selector-box svg {
  color: var(--brand-600);
}

.school-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--neutral-900);
}

[data-theme="dark"] .school-selector-box {
  background-color: #0F172A;
  border-color: #334155;
}

[data-theme="dark"] .school-selector-box svg {
  color: #60A5FA;
}

[data-theme="dark"] .school-name {
  color: #FFFFFF !important;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Role Switcher Pill */
.role-switcher {
  display: flex;
  background: var(--neutral-100);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--neutral-200);
}

.role-btn {
  border: none;
  background: transparent;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--neutral-600);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}

.role-btn:hover {
  color: var(--brand-500);
}

.role-btn.active {
  background-color: var(--brand-600);
  color: #FFFFFF !important;
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

[data-theme="dark"] .role-switcher {
  background: #0F172A;
  border-color: #334155;
}

[data-theme="dark"] .role-btn {
  color: #CBD5E1;
}

[data-theme="dark"] .role-btn:hover {
  color: #60A5FA;
}

[data-theme="dark"] .role-btn.active {
  background-color: #2563EB;
  color: #FFFFFF !important;
}

.user-avatar-badge {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--brand-600), var(--accent-cyan));
  color: #FFFFFF !important;
  font-weight: 700;
  font-size: 14px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
  cursor: pointer;
}

/* Scrollable View Container */
.content-body {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
}

/* Bootstrap 5.3 Inspired Smooth Motion Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes bsFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes bsSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes bsScaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.animate-fade-in, .bs-fade-in {
  animation: bsFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.bs-slide-up {
  animation: bsSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.bs-scale-in {
  animation: bsScaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Math Typography */
.math-tex, i {
  font-family: 'Cambria Math', 'Times New Roman', serif;
}

sup {
  font-size: 0.75em;
  vertical-align: super;
}

/* Mobile Hamburger Toggle Button */
.mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  cursor: pointer;
  color: var(--neutral-800);
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 18px;
}

.mobile-menu-btn:hover {
  background: var(--neutral-100);
  border-color: var(--brand-500);
}

/* Mobile Sidebar Backdrop Overlay */
.sidebar-backdrop-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 49;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop-overlay.active {
  display: block;
  opacity: 1;
}

/* ==========================================================================
   MULTI-DEVICE RESPONSIVE AUDIT (IPAD/TABLET, MOBILE, ULTRA-WIDE)
   ========================================================================== */

/* 1. TABLET & IPAD (<= 1024px) */
@media (max-width: 1024px) {
  .mobile-menu-btn {
    display: inline-flex;
  }

  .app-sidebar {
    position: fixed;
    top: 0;
    left: -290px;
    width: 280px;
    height: 100vh;
    z-index: 50;
    box-shadow: none;
    transition: left 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .app-sidebar.sidebar-mobile-open {
    left: 0;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  }

  .app-header {
    padding: 0 20px;
  }

  .content-body {
    padding: 20px;
  }

  .role-switcher .role-btn {
    padding: 5px 10px;
    font-size: 12px;
  }

  .school-selector-box .school-name {
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* 2. MOBILE PHONE (<= 768px) */
@media (max-width: 768px) {
  .app-header {
    height: auto;
    min-height: 60px;
    padding: 10px 14px;
    gap: 10px;
    flex-wrap: wrap;
  }

  .header-left {
    gap: 8px;
    flex: 1;
  }

  .school-selector-box {
    padding: 4px 10px;
    font-size: 11px;
  }

  .school-selector-box .school-name {
    max-width: 130px;
    font-size: 11px;
  }

  .header-right {
    gap: 8px;
  }

  .role-switcher {
    padding: 2px;
  }

  .role-switcher .role-btn {
    padding: 4px 8px;
    font-size: 11px;
  }

  .btn-logout {
    padding: 5px 9px;
    font-size: 11px;
  }

  .landing-back-btn {
    padding: 5px 8px;
    font-size: 11px;
  }

  .user-avatar-badge {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .content-body {
    padding: 14px 10px;
  }
}

/* 3. SMALL PHONES (<= 480px) */
@media (max-width: 480px) {
  .header-right {
    width: 100%;
    justify-content: space-between;
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px solid var(--neutral-200);
  }

  .role-switcher {
    flex: 1;
    justify-content: center;
  }

  .school-selector-box .school-name {
    max-width: 110px;
  }
}

/* 4. ULTRA-WIDE DESKTOP (>= 1600px) */
@media (min-width: 1600px) {
  .content-body {
    padding: 36px 48px;
    max-width: 1800px;
    margin: 0 auto;
    width: 100%;
  }
}

