/* ============================================================
   Mechanical Academic Portal — Custom Styles (Bootstrap 5 Overrides)
   Minimal overrides — Bootstrap does the heavy lifting
   ============================================================ */

/* Animation System */
@import url('./animations.css');

:root {
  --sidebar-width: 250px;
}

body {
  background: #f8fafc; /* Professional cold off-white */
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif; /* Modern stack prioritizing Inter if added */
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: #fff;
  border-right: 1px solid rgba(0, 0, 0, 0.08); /* Softer border */
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform 0.3s;
}

.sidebar-brand {
  padding: 20px;
  border-bottom: 1px solid #dee2e6;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand img,
.sidebar-brand .brand-icon {
  width: 36px;
  height: 36px;
  font-size: 1.5rem;
}

.sidebar-brand h5 {
  margin: 0;
  font-weight: 700;
}

.sidebar-brand small {
  color: #6c757d;
  font-size: 0.75rem;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: #495057;
  font-size: 0.9rem;
  border-radius: 0;
  transition: all 0.15s;
}

.sidebar-nav .nav-link:hover {
  background: #e9ecef;
  color: #0d6efd;
}

.sidebar-nav .nav-link.active {
  background: #e7f1ff;
  color: #0d6efd;
  font-weight: 600;
  border-right: 3px solid #0d6efd;
}

.sidebar-nav .nav-link i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid #dee2e6;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #0d6efd;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

/* ── Main Content ────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.top-bar {
  background: rgba(255, 255, 255, 0.85); /* Semi-transparent */
  backdrop-filter: blur(12px); /* Glassmorphism */
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08); /* Softer line */
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1020;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.02); /* Crisp under shadow */
}

.top-bar h4 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em; /* Tighter premium typography */
}

.page-body {
  padding: 24px;
}

/* ── Stat Cards ──────────────────────── */
.stat-card {
  border: 1px solid rgba(0, 0, 0, 0.05); /* Very subtle border */
  border-radius: 16px; /* Smooth professional radius */
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.025);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.1);
}

.stat-card .card-body {
  padding: 20px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 12px;
}

.stat-icon.blue {
  background: #e7f1ff;
  color: #0d6efd;
}

.stat-icon.green {
  background: #d1fae5;
  color: #10b981;
}

.stat-icon.orange {
  background: #fef3c7;
  color: #f59e0b;
}

.stat-icon.red {
  background: #fee2e2;
  color: #ef4444;
}

.stat-icon.purple {
  background: #ede9fe;
  color: #8b5cf6;
}

.stat-icon.cyan {
  background: #cffafe;
  color: #06b6d4;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: #1e293b;
}

.stat-label {
  font-size: 0.85rem;
  color: #6c757d;
}

/* ── Course Cards ────────────────────── */
.course-card .card-body {
  padding: 20px;
}

.course-card .course-code {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Auth Pages ──────────────────────── */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  border: none;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}



/* ── Attendance ──────────────────────── */
.attendance-status.present {
  color: #10b981;
  font-weight: 600;
}

.attendance-status.absent {
  color: #ef4444;
  font-weight: 600;
}

.attendance-status.late {
  color: #f59e0b;
  font-weight: 600;
}

/* ── Toast Container ─────────────────── */
.toast-container-custom {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
}

/* ── Misc ────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: #6c757d;
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 12px;
  display: block;
  color: #adb5bd;
}

.spinner-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
}

/* ── Mobile & Touch (iOS / Android) ─── */
.menu-toggle {
  display: none;
}

/* Tables scroll horizontally on small screens */
.table-responsive-auto {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
  }

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

  .menu-toggle {
    display: inline-flex;
  }

  /* Safe area insets for iPhone notch / home indicator */
  .page-body {
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .top-bar {
    padding: 10px 16px;
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
  }

  /* Touch-friendly form controls — 44px min per Apple HIG */
  .form-control,
  .form-select,
  .btn {
    min-height: 44px;
    font-size: 16px !important;
    /* prevents iOS zoom on focus */
  }

  .form-check-input {
    width: 22px;
    height: 22px;
    margin-top: 0.15rem;
  }

  .form-check-label {
    padding-left: 4px;
    font-size: 0.95rem;
    line-height: 1.6;
  }

  /* Stack form columns on mobile */
  .row.g-3>[class*="col-md-"] {
    flex: 0 0 100%;
    max-width: 100%;
  }

  /* Stat cards: 2 per row on mobile */
  .stat-value {
    font-size: 1.4rem;
  }

  .stat-card .card-body {
    padding: 14px;
  }

  /* Tables: horizontal scroll */
  .card-body.p-0 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table {
    min-width: 600px;
  }

  .table th,
  .table td {
    white-space: nowrap;
    font-size: 0.82rem;
    padding: 8px 10px;
  }

  /* Test modal: fullscreen on mobile */
  .modal-dialog {
    margin: 0;
    max-width: 100%;
    height: 100%;
  }

  .modal-content {
    border-radius: 0;
    height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    /* dynamic viewport for iOS */
  }

  .modal-body {
    padding: 12px;
  }

  /* Question nav dots — larger tap targets on mobile */
  .q-nav-dot {
    min-width: 38px !important;
    min-height: 38px !important;
    padding: 4px 8px !important;
    font-size: 0.8rem !important;
  }

  /* Previous/Next buttons full-width on very small screens */
  #prev-q-btn,
  #next-q-btn {
    min-width: 90px;
    min-height: 44px;
  }

  /* Question card in student view */
  .card-body h6 {
    font-size: 1rem;
    line-height: 1.5;
  }

  /* Create test form: larger textareas */
  .q-text {
    min-height: 80px;
  }

  /* Auth card */
  .auth-card {
    max-width: 95%;
    margin: 12px;
  }

  /* Confirmation modal responsive */
  .lms-confirm-box {
    width: 95%;
  }

  /* Top bar heading */
  .top-bar h4 {
    font-size: 1.1rem;
  }
}

/* ── Extra small screens (< 480px) ─── */
@media (max-width: 480px) {
  .page-body {
    padding: 10px;
  }

  .top-bar {
    padding: 8px 12px;
  }

  .top-bar h4 {
    font-size: 1rem;
  }

  /* Nav dots wrap tightly */
  .question-nav {
    gap: 3px !important;
  }

  .q-nav-dot {
    min-width: 32px !important;
    min-height: 32px !important;
    font-size: 0.7rem !important;
  }

  /* Stack prev/next vertically if needed */
  #prev-q-btn,
  #next-q-btn {
    font-size: 0.85rem;
  }

  .stat-value {
    font-size: 1.2rem;
  }

  .stat-icon {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
    margin-bottom: 8px;
  }
}

/* ── iOS-specific fixes ────────────── */
@supports (-webkit-touch-callout: none) {

  /* Smooth momentum scrolling */
  .modal-body,
  .page-body,
  .card-body {
    -webkit-overflow-scrolling: touch;
  }

  /* Prevent text size adjust on orientation change */
  body {
    -webkit-text-size-adjust: 100%;
  }

  /* Fix 100vh issue on iOS Safari (address bar) */
  .modal-content {
    min-height: -webkit-fill-available;
  }

  /* Prevent double-tap zoom on buttons */
  .btn,
  .form-check-input,
  .q-nav-dot {
    touch-action: manipulation;
  }
}

/* ── Animations ──────────────────────── */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

@keyframes pulseOpacity {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }

  100% {
    opacity: 1;
  }
}

.pulse-loading {
  animation: pulseOpacity 1.5s infinite ease-in-out;
}

/* ── Toast Slide-In / Slide-Out ─────── */
@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(100px) scale(0.95);
  }
}

@keyframes toastProgressShrink {
  from {
    width: 100%;
  }

  to {
    width: 0%;
  }
}

.lms-toast-enter {
  animation: toastSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.lms-toast-exit {
  animation: toastSlideOut 0.3s ease forwards;
}

.lms-toast-progress {
  height: 3px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 0 0 6px 6px;
  animation: toastProgressShrink linear forwards;
}

/* ── Confirmation Modal ─────────────── */
.lms-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.lms-confirm-box {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  width: 90%;
  max-width: 420px;
  overflow: hidden;
}

.lms-confirm-header {
  padding: 20px 24px 12px;
}

.lms-confirm-body {
  padding: 0 24px 20px;
  color: #495057;
}

.lms-confirm-footer {
  padding: 12px 24px;
  border-top: 1px solid #dee2e6;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@keyframes confirmEnter {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes confirmBoxEnter {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes confirmExit {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

.lms-confirm-enter {
  animation: confirmEnter 0.2s ease forwards;
}

.lms-confirm-enter .lms-confirm-box {
  animation: confirmBoxEnter 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.lms-confirm-exit {
  animation: confirmExit 0.2s ease forwards;
}

/* ── Card & Table Entrance Animations ── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card:not([data-animate]),
.stat-card:not([data-animate]) {
  animation: fadeInUp 0.4s ease-out both;
}

/* Stagger stat cards (only those not using scroll-reveal) */
:not([data-animate])>.col-md-3:nth-child(1) .stat-card,
:not([data-animate])>.col-6:nth-child(1) .stat-card {
  animation-delay: 0.05s;
}

:not([data-animate])>.col-md-3:nth-child(2) .stat-card,
:not([data-animate])>.col-6:nth-child(2) .stat-card {
  animation-delay: 0.12s;
}

:not([data-animate])>.col-md-3:nth-child(3) .stat-card,
:not([data-animate])>.col-6:nth-child(3) .stat-card {
  animation-delay: 0.19s;
}

:not([data-animate])>.col-md-3:nth-child(4) .stat-card,
:not([data-animate])>.col-6:nth-child(4) .stat-card {
  animation-delay: 0.26s;
}

/* Table rows fade in */
@keyframes tableRowFadeIn {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.table tbody tr {
  animation: tableRowFadeIn 0.3s ease both;
}

.table tbody tr:nth-child(n+2) {
  animation-delay: calc(0.03s * var(--row-index, 0));
}

/* ── Enhanced Button Micro-Animations ── */
.btn {
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active:not(:disabled) {
  transform: translateY(0) scale(0.97);
  transition-duration: 0.08s;
}

.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* ── Smooth Tab Content Transitions ──── */
#tab-mark,
#tab-overview,
#tab-history,
#tab-report,
.tab-content-animated {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#tab-mark:not(.d-none),
#tab-overview:not(.d-none),
#tab-history:not(.d-none),
#tab-report:not(.d-none) {
  animation: fadeIn 0.35s ease-out;
}

/* ── Page Content Entrance ─────────── */
.page-body {
  animation: fadeIn 0.5s ease-out;
}

/* ── Nav Pills Animation ────────────── */
.nav-pills .nav-link {
  transition: all 0.25s ease;
}

.nav-pills .nav-link:hover {
  transform: translateY(-1px);
}

.nav-pills .nav-link.active {
  box-shadow: 0 3px 10px rgba(13, 110, 253, 0.3);
}

/* ── Empty State Float ──────────────── */
.empty-state .empty-icon,
.empty-state i {
  animation: floatBounce 3s ease-in-out infinite;
}

@keyframes floatBounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

/* ── Modal Backdrop Enhancement ─────── */
.modal.show .modal-dialog {
  animation: confirmBoxEnter 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ── Loading Shimmer ────────────────── */
.skeleton-row {
  height: 42px;
  margin-bottom: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, #e9ecef 25%, #f1f3f4 50%, #e9ecef 75%);
  background-size: 200% 100%;
  animation: shimmerLight 1.5s infinite;
}

@keyframes shimmerLight {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* ── Progress Bar Pulse ─────────────── */
.progress-bar-animated {
  animation: progress-bar-stripes 1s linear infinite, progressPulse 2s ease-in-out infinite;
}

@keyframes progressPulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.85;
  }
}

/* ── Sidebar Link Hover Slide ────────── */
.sidebar-nav .nav-link {
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.sidebar-nav .nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: #0d6efd;
  transition: width 0.3s ease;
}

.sidebar-nav .nav-link:hover::after {
  width: 100%;
}

/* ── Course Card Hover Glow ─────────── */
.course-card {
  transition: all 0.3s ease;
}

.course-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* ── Password Prompt Modal ──────────── */
#lms-password-modal .input-group {
  border-radius: 8px;
  overflow: hidden;
}

#lms-password-modal .input-group .form-control:focus {
  box-shadow: none;
  border-color: #dc3545;
}

#lms-password-modal .input-group-text {
  border-color: #dee2e6;
}

#lms-password-modal .lms-confirm-header h5 {
  color: #dc3545;
}

/* ════════════════════════════════════════
   PREMIUM LOADING OVERLAY
   ════════════════════════════════════════ */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-size: 400% 400%;
  animation: gradientShift 8s ease infinite;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.loading-overlay.active {
  opacity: 1;
  visibility: visible;
}

.loading-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loading-card {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  padding: 48px 56px;
  text-align: center;
  animation: loadCardEnter 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.loading-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  animation: logoPulse 2s ease-in-out infinite;
  margin-bottom: 20px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
}

.loading-title {
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.loading-subtitle {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

/* Dot wave loader */
.dot-wave {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.dot-wave span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  animation: dotBounce 1.4s ease-in-out infinite both;
}

.dot-wave span:nth-child(1) {
  animation-delay: -0.32s;
}

.dot-wave span:nth-child(2) {
  animation-delay: -0.16s;
}

.dot-wave span:nth-child(3) {
  animation-delay: 0s;
}

.dot-wave span:nth-child(4) {
  animation-delay: 0.16s;
}

@keyframes dotBounce {

  0%,
  80%,
  100% {
    transform: scale(0.4);
    opacity: 0.4;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes loadCardEnter {
  from {
    opacity: 0;
    transform: scale(0.85) translateY(30px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes logoPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* ════════════════════════════════════════
   ANIMATED AUTH BACKGROUND
   ════════════════════════════════════════ */
.auth-wrapper {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-size: 400% 400%;
  animation: gradientShift 12s ease infinite;
}

/* Floating orbs */
.auth-wrapper::before,
.auth-wrapper::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.25;
  pointer-events: none;
}

.auth-wrapper::before {
  width: 400px;
  height: 400px;
  background: rgba(255, 255, 255, 0.3);
  top: -80px;
  right: -120px;
  animation: floatOrb1 8s ease-in-out infinite;
}

.auth-wrapper::after {
  width: 350px;
  height: 350px;
  background: rgba(118, 75, 162, 0.25);
  bottom: -100px;
  left: -80px;
  animation: floatOrb2 10s ease-in-out infinite;
}

@keyframes floatOrb1 {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(-40px, 60px) scale(1.1);
  }

  66% {
    transform: translate(30px, -30px) scale(0.95);
  }
}

@keyframes floatOrb2 {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(50px, -50px) scale(1.15);
  }
}

/* ════════════════════════════════════════
   AUTH CARD ENTRANCE ANIMATION
   ════════════════════════════════════════ */
.auth-card:not([data-animate]) {
  position: relative;
  z-index: 1;
  animation: authCardEnter 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  opacity: 0;
}

.auth-card[data-animate] {
  position: relative;
  z-index: 1;
}

@keyframes authCardEnter {
  from {
    opacity: 0;
    transform: scale(0.88) translateY(40px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ════════════════════════════════════════
   PASSWORD VISIBILITY TOGGLE
   ════════════════════════════════════════ */
.password-wrapper {
  position: relative;
}

.password-wrapper .form-control {
  padding-right: 48px;
  width: 100%;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #495057;
  cursor: pointer;
  padding: 6px 8px;
  font-size: 1.15rem;
  line-height: 1;
  transition: color 0.2s ease;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: auto;
}

.password-toggle:hover {
  color: #0d6efd;
  transform: translateY(-50%);
  box-shadow: none;
}

.password-toggle:focus {
  outline: none;
  color: #0d6efd;
}

.password-toggle:active {
  transform: translateY(-50%);
  box-shadow: none;
}

/* ════════════════════════════════════════
   SMOOTH TAB CONTENT TRANSITION
   ════════════════════════════════════════ */
#email-login-form,
#urn-login-form {
  animation: tabSlideIn 0.35s ease-out;
}

@keyframes tabSlideIn {
  from {
    opacity: 0;
    transform: translateX(12px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ════════════════════════════════════════
   INDEX PAGE LOADING SCREEN
   ════════════════════════════════════════ */
.splash-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-size: 400% 400%;
  animation: gradientShift 8s ease infinite;
  position: relative;
  overflow: hidden;
}

.splash-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  padding: 48px 40px;
  text-align: center;
  animation: loadCardEnter 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.splash-card img {
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
  animation: logoPulse 2s ease-in-out infinite;
}

.splash-card h3 {
  color: #fff;
  font-weight: 700;
  margin-top: 16px;
  letter-spacing: -0.01em;
}

.splash-card p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

/* ════════════════════════════════════════
   CUSTOM UI UTILITIES
   ════════════════════════════════════════ */
.tracking-wide {
  letter-spacing: 0.05em;
}

.min-h-32 {
  min-height: 2rem;
}

.border-dashed {
  border-style: dashed !important;
}

.bg-gradient {
  background-size: 200% auto;
  transition: 0.5s;
}

.group-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08) !important;
}

.rounded-4 {
  border-radius: 1rem !important;
}

.rounded-top-4 {
  border-top-left-radius: 1rem !important;
  border-top-right-radius: 1rem !important;
}

.rounded-bottom-4 {
  border-bottom-left-radius: 1rem !important;
  border-bottom-right-radius: 1rem !important;
}

/* ══════════════════════════════════════════
   GUEST MODE STYLES
   ══════════════════════════════════════════ */

/* ── Sidebar: Guest Mode Banner ────────── */
.guest-mode-banner {
  background: linear-gradient(135deg, #ff9800, #f57c00);
  color: #fff;
  padding: 10px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  animation: guestBannerPulse 3s ease-in-out infinite;
}

.guest-demo-badge {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.25);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  animation: guestDemoPulse 2s ease-in-out infinite;
}

@keyframes guestBannerPulse {

  0%,
  100% {
    background: linear-gradient(135deg, #ff9800, #f57c00);
  }

  50% {
    background: linear-gradient(135deg, #ffa726, #fb8c00);
  }
}

@keyframes guestDemoPulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* ── Sidebar: Guest Role Switcher ──────── */
.guest-role-switcher {
  background: #f8f9fa;
  border: 1px dashed #dee2e6;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 12px;
}

.guest-role-switcher .btn {
  font-size: 0.72rem;
  padding: 4px 6px;
  min-height: 32px;
}

/* ── Sidebar: Guest Avatar ─────────────── */
.user-avatar.guest-avatar {
  background: linear-gradient(135deg, #ff9800, #f57c00);
  box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

/* ── Login Page: Guest Section ─────────── */
.guest-login-section {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border: 1px solid #dee2e6;
  border-radius: 12px;
  padding: 20px;
  margin: 8px 0;
}

.guest-login-header {
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  color: #343a40;
  margin-bottom: 6px;
}

.guest-role-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 18px;
  border-radius: 10px;
  border: 2px solid #dee2e6;
  background: #fff;
  color: #495057;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.guest-role-card i {
  font-size: 1.4rem;
}

.guest-role-card span {
  font-size: 0.78rem;
  font-weight: 600;
}

.guest-role-card:hover {
  border-color: #ff9800;
  background: #fff8e1;
  color: #e65100;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(255, 152, 0, 0.2);
}

.guest-role-card:active {
  transform: translateY(0) scale(0.96);
}

#guest-admin-btn:hover {
  border-color: #dc3545;
  background: #fff5f5;
  color: #dc3545;
  box-shadow: 0 6px 20px rgba(220, 53, 69, 0.2);
}

#guest-teacher-btn:hover {
  border-color: #0d6efd;
  background: #e7f1ff;
  color: #0d6efd;
  box-shadow: 0 6px 20px rgba(13, 110, 253, 0.2);
}

#guest-student-btn:hover {
  border-color: #198754;
  background: #d1fae5;
  color: #198754;
  box-shadow: 0 6px 20px rgba(25, 135, 84, 0.2);
}

/* ── Guest Toast Notifications ─────────── */
@keyframes guestToastIn {
  from {
    opacity: 0;
    transform: translateX(40px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes guestToastOut {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateX(40px) scale(0.95);
  }
}

#guest-toast-container {
  pointer-events: none;
}

.guest-toast-msg {
  pointer-events: auto;
}

/* ── Global Professional Buttons (Strictly Minimal / High-Contrast) ── */
.btn {
  border-radius: 6px !important;
  font-weight: 500 !important;
  letter-spacing: normal !important;
  transition: all 0.15s ease !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
  border: 1px solid transparent !important;
  text-transform: none !important;
}

.btn:not(.btn-link):not(.btn-sm) {
  padding: 0.5rem 1rem !important;
}

.btn:active {
  transform: scale(0.98) !important;
  box-shadow: none !important;
}

/* Primary Action - High Visibility Blue */
.btn-primary {
  background-color: #2563eb !important;
  color: #ffffff !important;
}
.btn-primary:hover {
  background-color: #1d4ed8 !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
}

/* Destructive Action - High Visibility Red */
.btn-danger {
  background-color: #dc2626 !important;
  color: #ffffff !important;
}
.btn-danger:hover {
  background-color: #b91c1c !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
}

/* Contextual Actions - Clean Flat Colors */
.btn-success {
  background-color: #10b981 !important;
  color: #ffffff !important;
  border: 1px solid transparent !important;
}
.btn-success:hover {
  background-color: #059669 !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
}

.btn-warning {
  background-color: #f59e0b !important;
  color: #ffffff !important;
  border: 1px solid transparent !important;
}
.btn-warning:hover {
  background-color: #d97706 !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
}

.btn-info {
  background-color: #06b6d4 !important;
  color: #ffffff !important;
  border: 1px solid transparent !important;
}
.btn-info:hover {
  background-color: #0891b2 !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
}

.btn-secondary {
  background-color: #6b7280 !important;
  color: #ffffff !important;
  border: 1px solid transparent !important;
}
.btn-secondary:hover {
  background-color: #4b5563 !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
}

/* Base outline styling */
.btn-outline-primary {
  background-color: #ffffff !important;
  border: 1px solid #d1d5db !important;
  color: #1f2937 !important;
}
.btn-outline-primary:hover {
  background-color: #f3f4f6 !important;
  border-color: #9ca3af !important;
  color: #111827 !important;
}

/* Demo Access Subtle Link */
.demo-access-link {
  opacity: 0.5;
  transition: opacity 0.3s ease;
}
.demo-access-link:hover {
  opacity: 1;
}

/* Fix disabled state visibility */
.btn:disabled {
  opacity: 0.65 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
}