/**
 * SKC CBT — Master Stylesheet
 * SDN Suryakencana CBM
 * Modern, Clean, Educational Technology UI/UX
 */

:root {
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --primary-900: #1e3a8a;

  --accent-500: #06b6d4;
  --accent-600: #0891b2;

  --success-50: #ecfdf5;
  --success-500: #10b981;
  --success-700: #047857;

  --warning-50: #fffbeb;
  --warning-500: #f59e0b;
  --warning-700: #b45309;

  --danger-50: #fef2f2;
  --danger-500: #ef4444;
  --danger-700: #b91c1c;

  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.08);
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-2xl: 1.5rem;
}

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

body {
  font-family: var(--font-sans);
  background-color: #f8fafc;
  color: var(--slate-800);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary-600);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--primary-700);
}

/* ====================================================================
   LAYOUT COMPONENTS (SIDEBAR & TOPBAR)
   ==================================================================== */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 270px;
  background: #ffffff;
  border-right: 1px solid var(--slate-200);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  transition: transform 0.25s ease-in-out;
}

.sidebar-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--slate-100);
}

.school-logo-badge {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary-600), var(--accent-600));
  color: #ffffff;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.school-brand-text h1 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--slate-900);
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.school-brand-text p {
  font-size: 0.75rem;
  color: var(--slate-500);
  font-weight: 500;
}

.sidebar-menu {
  padding: 1rem 0.75rem;
  flex: 1;
  overflow-y: auto;
}

.menu-section-title {
  padding: 0.5rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate-400);
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--slate-600);
  margin-bottom: 0.25rem;
  transition: all 0.15s ease;
}

.menu-item:hover {
  background-color: var(--slate-100);
  color: var(--primary-600);
}

.menu-item.active {
  background: linear-gradient(135deg, var(--primary-50), #eff6ff);
  color: var(--primary-700);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.08);
}

.menu-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
}

.main-content {
  margin-left: 270px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 68px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--slate-200);
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.toggle-sidebar-btn {
  display: none;
  background: none;
  border: 1px solid var(--slate-200);
  padding: 0.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  color: var(--slate-700);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--slate-200);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--slate-700);
  font-size: 0.85rem;
}

.user-info {
  line-height: 1.2;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--slate-800);
}

.user-role-label {
  font-size: 0.75rem;
  color: var(--slate-500);
}

.content-body {
  padding: 1.75rem;
  flex: 1;
}

.footer {
  padding: 1.25rem 1.75rem;
  border-top: 1px solid var(--slate-200);
  background: #ffffff;
  color: var(--slate-500);
  font-size: 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ====================================================================
   CARDS & GRIDS
   ==================================================================== */
.card {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 0.5rem;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--slate-500);
}

.grid-cols-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.grid-cols-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

/* ====================================================================
   STATISTIC KPI CARDS
   ==================================================================== */
.stat-card {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-icon.blue { background: var(--primary-50); color: var(--primary-600); }
.stat-icon.emerald { background: var(--success-50); color: var(--success-500); }
.stat-icon.amber { background: var(--warning-50); color: var(--warning-500); }
.stat-icon.purple { background: #faf5ff; color: #9333ea; }

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--slate-900);
  line-height: 1;
}

.stat-label {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--slate-500);
  margin-top: 0.35rem;
}

/* ====================================================================
   BADGES & PILLS
   ==================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.badge-purple { background: #f3e8ff; color: #7e22ce; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-indigo { background: #e0e7ff; color: #3730a3; }
.badge-emerald { background: #d1fae5; color: #065f46; }
.badge-teal { background: #ccfbf1; color: #115e59; }
.badge-amber { background: #fef3c7; color: #92400e; }
.badge-gray { background: #f1f5f9; color: #475569; }

/* ====================================================================
   BUTTONS
   ==================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  line-height: 1.25;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-700), var(--primary-900));
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
  background: var(--slate-100);
  color: var(--slate-700);
}

.btn-secondary:hover {
  background: var(--slate-200);
  color: var(--slate-900);
}

.btn-danger {
  background: var(--danger-500);
  color: #ffffff;
}

.btn-danger:hover {
  background: var(--danger-700);
}

.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  border-radius: 1rem;
}

/* ====================================================================
   ALERTS
   ==================================================================== */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.alert-success {
  background-color: var(--success-50);
  color: var(--success-700);
  border: 1px solid #a7f3d0;
}

.alert-danger {
  background-color: var(--danger-50);
  color: var(--danger-700);
  border: 1px solid #fecaca;
}

.alert-warning {
  background-color: var(--warning-50);
  color: var(--warning-700);
  border: 1px solid #fde68a;
}

/* ====================================================================
   AUTH PAGE SPECIAL STYLING
   ==================================================================== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #eff6ff 0%, #e0e7ff 50%, #f8fafc 100%);
  padding: 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: var(--radius-2xl);
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  border: 1px solid rgba(226, 232, 240, 0.8);
  padding: 2.25rem 2rem;
}

.auth-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, var(--primary-600), var(--accent-600));
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.75rem;
  font-weight: 800;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.3);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--slate-700);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-family: inherit;
  border: 1px solid var(--slate-300);
  border-radius: 0.75rem;
  background: #ffffff;
  transition: all 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* ====================================================================
   KIDS-FRIENDLY CUES (STUDENT INTERFACE)
   ==================================================================== */
.student-banner {
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  color: #ffffff;
  border-radius: var(--radius-2xl);
  padding: 2rem;
  margin-bottom: 1.75rem;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);
}

.student-banner h2 {
  font-size: 1.65rem;
  font-weight: 800;
}

.student-banner p {
  opacity: 0.9;
  font-size: 1rem;
  margin-top: 0.25rem;
}

.exam-card-student {
  background: #ffffff;
  border: 2px solid var(--slate-200);
  border-radius: var(--radius-2xl);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.exam-card-student:hover {
  border-color: var(--primary-500);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* Responsive queries */
@media (max-width: 991px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .toggle-sidebar-btn {
    display: inline-flex;
  }
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-dialog {
  background: #ffffff;
  border-radius: 1.25rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  width: 100%;
  max-width: 520px;
  overflow: hidden;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--slate-100);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--slate-400);
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover { color: var(--slate-700); }

.modal-body {
  padding: 1.25rem 1.5rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--slate-100);
  background: var(--slate-50);
}
