/* ============================================
   SYSTIMATE - ADDITIONAL MODERN ENHANCEMENTS
   Footer, Auth Pages, and Page-Specific Styles
   ============================================ */

/* === FOOTER ENHANCEMENTS === */
.main-footer {
  background: var(--bg-primary);
  border-top: 1px solid var(--border-default);
  padding: var(--space-16) 0 var(--space-8);
  margin-top: auto;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  display: inline-block;
  margin-bottom: var(--space-4);
  transition: all var(--transition-base);
}

.footer-brand:hover {
  transform: translateY(-2px);
}

.footer-description {
  color: var(--text-tertiary);
  line-height: 1.7;
  margin-bottom: var(--space-6);
  font-size: 0.9375rem;
}

.footer-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-5);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  position: relative;
  padding-bottom: var(--space-3);
}

.footer-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--color-primary);
  border-radius: var(--radius-full);
}

[dir="rtl"] .footer-title::after {
  left: auto;
  right: 0;
}

.footer-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links ul li {
  margin-bottom: var(--space-3);
}

.footer-links ul li a {
  color: var(--text-tertiary);
  font-size: 0.9375rem;
  transition: all var(--transition-fast);
  display: inline-block;
  position: relative;
}

.footer-links ul li a::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width var(--transition-base);
}

.footer-links ul li a:hover {
  color: var(--color-primary);
}

.footer-links ul li a:hover::before {
  width: 100%;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  color: var(--text-tertiary);
  font-size: 0.9375rem;
}

.contact-item i {
  color: var(--color-primary);
  font-size: 1.125rem;
  width: 20px;
  text-align: center;
}

.contact-item a {
  color: var(--text-tertiary);
  transition: color var(--transition-fast);
}

.contact-item a:hover {
  color: var(--color-primary);
}

.social-links {
  display: flex;
  gap: var(--space-3);
}

.social-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 1.125rem;
  transition: all var(--transition-base);
  text-decoration: none;
}

.social-icon:hover {
  background: var(--color-primary);
  color: white;
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(var(--color-primary-rgb), 0.35);
}

.footer-bottom {
  border-top: 1px solid var(--border-default);
  margin-top: var(--space-12);
  padding-top: var(--space-8);
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

/* === AUTH PAGES === */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  padding: var(--space-8);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  animation: scaleIn 0.4s ease-out;
}

.auth-header {
  background: var(--text-primary);
  padding: var(--space-8);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.auth-header::before {
  display: none;
}

.auth-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-4);
  border-radius: var(--radius-full);
  background: white;
  padding: var(--space-3);
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}

.auth-title {
  color: white !important;
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: var(--space-2);
  position: relative;
  z-index: 1;
}

.auth-subtitle {
  color: rgba(255, 255, 255, 0.85) !important;
  font-size: 0.9375rem;
  margin: 0;
  position: relative;
  z-index: 1;
}

.auth-body {
  padding: var(--space-8);
}

.auth-form .form-group {
  margin-bottom: var(--space-5);
}

.auth-form .btn-primary {
  width: 100%;
  padding: 0.875rem;
  margin-top: var(--space-4);
  font-size: 1rem;
}

.auth-footer {
  text-align: center;
  padding: var(--space-5) var(--space-8) var(--space-6);
  color: var(--text-tertiary);
  font-size: 0.875rem;
  border-top: 1px solid var(--border-light);
}

.auth-footer a {
  color: var(--color-primary);
  font-weight: 600;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.remember-me input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.remember-me label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-6) 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-default);
}

/* === SUBJECT CARDS === */
.subject-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition-slow);
  height: 100%;
}

.subject-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-6px);
  border-color: var(--color-primary-light);
}

.subject-card-img {
  height: 160px;
  object-fit: cover;
  width: 100%;
  transition: transform var(--transition-slow);
}

.subject-card:hover .subject-card-img {
  transform: scale(1.05);
}

.subject-card-body {
  padding: var(--space-5);
}

.subject-card-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: var(--space-2);
  color: var(--text-primary);
}

.subject-card-text {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  line-height: 1.6;
  margin-bottom: var(--space-4);
}

.subject-card-footer {
  padding: var(--space-4) var(--space-5);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* === LECTURE CARDS === */
.lecture-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  transition: all var(--transition-base);
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}

.lecture-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-light);
}

.lecture-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--color-primary-50);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  font-size: 1.25rem;
  flex-shrink: 0;
}

.lecture-content {
  flex: 1;
}

.lecture-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-1);
  color: var(--text-primary);
}

.lecture-meta {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}

/* === STUDENT CARDS === */
.student-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  transition: all var(--transition-base);
}

.student-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-light);
}

.student-avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 3px solid var(--color-primary-100);
}

[data-mdb-theme="dark"] .student-avatar {
  border-color: var(--color-primary-50);
}

.student-info {
  flex: 1;
}

.student-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.student-details {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}

/* === BOOK CARDS (LIBRARY) === */
.book-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition-slow);
}

.book-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-6px);
}

.book-cover {
  height: 220px;
  object-fit: cover;
  width: 100%;
  transition: transform var(--transition-slow);
}

.book-card:hover .book-cover {
  transform: scale(1.05);
}

.book-info {
  padding: var(--space-5);
}

.book-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: var(--space-2);
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-author {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  margin-bottom: var(--space-3);
}

.book-footer {
  padding: var(--space-4) var(--space-5);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* === QUIZ CARDS === */
.quiz-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  transition: all var(--transition-slow);
}

.quiz-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--color-primary-light);
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-4);
}

.quiz-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.quiz-meta {
  display: flex;
  gap: var(--space-4);
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  margin-bottom: var(--space-4);
}

.quiz-meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.quiz-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-light);
}

/* === REPORT CARDS === */
.report-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  transition: all var(--transition-slow);
}

.report-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.report-stat-box {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-align: center;
}

.report-stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: var(--space-2);
}

.report-stat-label {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* === EMPTY STATES === */
.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-8);
  color: var(--text-tertiary);
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-6);
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--text-muted);
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

.empty-state-text {
  font-size: 0.9375rem;
  color: var(--text-tertiary);
  margin-bottom: var(--space-6);
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* === LOADING STATES === */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-toast);
  backdrop-filter: blur(4px);
}

[data-mdb-theme="dark"] .loading-overlay {
  background: rgba(15, 23, 42, 0.8);
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-default);
  border-top-color: var(--color-primary);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

/* === LUXURY TOAST NOTIFICATIONS === */
.toast-wrapper {
  position: fixed !important;
  top: 1.5rem !important;
  right: 1.5rem !important;
  z-index: 999999 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0.75rem !important;
  max-width: 25rem !important;
  width: calc(100vw - 3rem) !important;
  pointer-events: none !important;
}

[dir="rtl"] .toast-wrapper {
  right: auto !important;
  left: 1.5rem !important;
}

.toast {
  pointer-events: auto !important;
  position: relative !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  min-width: 300px !important;
  padding: 1rem 1.125rem 1.125rem 1rem !important;
  border-radius: 1.125rem !important;
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.4), 0 0 20px -2px var(--toast-glow, rgba(0, 0, 0, 0.2)) !important;
  backdrop-filter: blur(16px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
  background: var(--toast-bg, rgba(15, 23, 42, 0.92)) !important;
  color: var(--toast-text, #f8fafc) !important;
  border: 1px solid var(--toast-border, rgba(255, 255, 255, 0.12)) !important;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
  animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  margin: 0 !important;
}

.toast:hover {
  transform: translateY(-2px) scale(1.01) !important;
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.5), 0 0 24px 0px var(--toast-glow, rgba(0, 0, 0, 0.3)) !important;
}

.toast-body {
  display: flex !important;
  align-items: flex-start !important;
  gap: 0.875rem !important;
  padding: 0 !important;
  flex: 1 !important;
}

.toast-icon-box {
  width: 2.5rem !important;
  height: 2.5rem !important;
  border-radius: 0.875rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.125rem !important;
  flex-shrink: 0 !important;
  background: var(--toast-icon-bg, rgba(255, 255, 255, 0.1)) !important;
  color: var(--toast-icon-color, #ffffff) !important;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2) !important;
}

.toast-content {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.15rem !important;
}

.toast-title {
  font-size: 0.9375rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em !important;
  color: var(--toast-text, #ffffff) !important;
  line-height: 1.3 !important;
}

.toast-message {
  font-size: 0.875rem !important;
  font-weight: 450 !important;
  color: var(--toast-subtext, rgba(255, 255, 255, 0.85)) !important;
  line-height: 1.4 !important;
}

.toast-close {
  background: transparent !important;
  border: none !important;
  color: var(--toast-subtext, rgba(255, 255, 255, 0.6)) !important;
  opacity: 0.8 !important;
  padding: 0.35rem !important;
  margin-left: 0.5rem !important;
  margin-top: -0.25rem !important;
  cursor: pointer !important;
  border-radius: 0.5rem !important;
  transition: all 0.2s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 1.875rem !important;
  height: 1.875rem !important;
}

.toast-close:hover {
  opacity: 1 !important;
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.15) !important;
  transform: scale(1.1) !important;
}

.toast-progress {
  position: absolute !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 3px !important;
  background: rgba(255, 255, 255, 0.15) !important;
  overflow: hidden !important;
}

.toast-progress-bar {
  height: 100% !important;
  background: var(--toast-bar-color, #ffffff) !important;
  width: 100% !important;
  transform-origin: left !important;
  animation: toastProgress 5s linear forwards !important;
}

.toast:hover .toast-progress-bar {
  animation-play-state: paused !important;
}

/* Success Variant */
.toast-success,
.toast.bg-green-500,
.toast.bg-emerald-500 {
  --toast-bg: rgba(6, 44, 30, 0.94);
  --toast-border: rgba(16, 185, 129, 0.4);
  --toast-glow: rgba(16, 185, 129, 0.35);
  --toast-icon-bg: rgba(16, 185, 129, 0.25);
  --toast-icon-color: #34d399;
  --toast-text: #ffffff;
  --toast-subtext: #a7f3d0;
  --toast-bar-color: #10b981;
}

/* Danger / Error Variant */
.toast-danger,
.toast-error,
.toast.bg-red-500,
.toast.bg-rose-500 {
  --toast-bg: rgba(45, 11, 14, 0.94);
  --toast-border: rgba(239, 68, 68, 0.4);
  --toast-glow: rgba(239, 68, 68, 0.35);
  --toast-icon-bg: rgba(239, 68, 68, 0.25);
  --toast-icon-color: #f87171;
  --toast-text: #ffffff;
  --toast-subtext: #fca5a5;
  --toast-bar-color: #ef4444;
}

/* Warning Variant */
.toast-warning,
.toast.bg-yellow-500,
.toast.bg-amber-500 {
  --toast-bg: rgba(45, 27, 8, 0.94);
  --toast-border: rgba(245, 158, 11, 0.4);
  --toast-glow: rgba(245, 158, 11, 0.35);
  --toast-icon-bg: rgba(245, 158, 11, 0.25);
  --toast-icon-color: #fbbf24;
  --toast-text: #ffffff;
  --toast-subtext: #fde68a;
  --toast-bar-color: #f59e0b;
}

/* Info / Default Variant */
.toast-info,
.toast.bg-primary,
.toast.bg-blue-500 {
  --toast-bg: rgba(15, 23, 42, 0.94);
  --toast-border: rgba(129, 140, 248, 0.4);
  --toast-glow: rgba(129, 140, 248, 0.35);
  --toast-icon-bg: rgba(129, 140, 248, 0.25);
  --toast-icon-color: #a5b4fc;
  --toast-text: #ffffff;
  --toast-subtext: #e0e7ff;
  --toast-bar-color: #a5b4fc;
}

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

@keyframes toastFadeOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(40px) scale(0.92);
  }
}

@keyframes toastProgress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

.toast.is-hiding {
  animation: toastFadeOut 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

/* === NAVIGATION BUTTONS === */
.navigation-buttons {
  position: fixed;
  display: flex;
  gap: var(--space-3);
  z-index: var(--z-sticky);
  left: 50%;
  transform: translateX(-50%);
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--glass-border);
}

.nav-button {
  background: transparent;
  color: var(--color-primary);
  border: none;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 1.125rem;
  border-radius: var(--radius-full);
}

.nav-button:hover {
  background: var(--color-primary-50);
  color: var(--color-primary-dark);
  transform: scale(1.1);
}

@media (min-width: 769px) {
  .navigation-buttons {
    top: var(--space-5);
  }
}

@media (max-width: 768px) {
  .navigation-buttons {
    bottom: var(--space-5);
    top: auto;
  }
}

/* === WHATSAPP BUTTON === */
.whatsapp {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  background: #25D366;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
  transition: all var(--transition-base);
  z-index: var(--z-fixed);
}

.whatsapp:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 32px rgba(37, 211, 102, 0.5);
}

[dir="rtl"] .whatsapp {
  left: var(--space-6);
  right: auto;
}

/* === PAGE HEADERS === */
.page-header {
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-6);
  border-bottom: 2px solid var(--border-light);
}

.page-header h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  margin-bottom: var(--space-2);
  color: var(--text-primary);
}

.page-header p {
  color: var(--text-tertiary);
  font-size: 1rem;
  margin: 0;
}

.page-header-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
  flex-wrap: wrap;
}

/* === SIDEBAR === */
.sidebar {
  width: 280px;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border-default);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  overflow-y: auto;
  transition: all var(--transition-slow);
  z-index: var(--z-sticky);
  padding: var(--space-6);
}

[dir="rtl"] .sidebar {
  left: auto;
  right: 0;
  border-right: none;
  border-left: 1px solid var(--border-default);
}

.sidebar.collapsed {
  transform: translateX(-100%);
}

[dir="rtl"] .sidebar.collapsed {
  transform: translateX(100%);
}

/* Layout container with fixed sidebar */
.layout-container .main-content {
  margin-inline-start: 280px;
  padding: var(--space-6);
  min-height: 100vh;
}

.layout-container .main-content.expanded {
  margin-inline-start: 0;
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav-item {
  margin-bottom: var(--space-1);
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9375rem;
  transition: all var(--transition-fast);
}

.sidebar-nav-link:hover {
  background: var(--color-primary-50);
  color: var(--color-primary);
}

.sidebar-nav-link.active {
  background: var(--color-primary);
  color: white;
}

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

/* === MAIN CONTENT WITH SIDEBAR === */
.main-content-with-sidebar {
  margin-left: 280px;
  padding: var(--space-8);
  transition: margin var(--transition-slow);
}

[dir="rtl"] .main-content-with-sidebar {
  margin-left: 0;
  margin-right: 280px;
}

.main-content-with-sidebar.expanded {
  margin-left: 0;
}

[dir="rtl"] .main-content-with-sidebar.expanded {
  margin-right: 0;
}

/* === RESPONSIVE ADJUSTMENTS === */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  [dir="rtl"] .sidebar {
    transform: translateX(100%);
  }
  
  .sidebar.show {
    transform: translateX(0);
  }
  
  .main-content-with-sidebar {
    margin-left: 0;
  }
  
  [dir="rtl"] .main-content-with-sidebar {
    margin-right: 0;
  }
}

@media (max-width: 767.98px) {
  .auth-card {
    max-width: 100%;
  }
  
  .auth-body {
    padding: var(--space-6);
  }
  
  .page-header-actions {
    flex-direction: column;
  }
  
  .page-header-actions .btn {
    width: 100%;
  }
}

/* === VIDEO PLAYER OVERLAY === */
.video-player-container {
  display: none;
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  align-items: center;
  justify-content: center;
}

.video-player-container.is-active,
.video-player-container[style*="block"],
.video-player-container[style*="flex"] {
  display: flex !important;
}

.video-backdrop {
  position: absolute;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
}

.video-player-content {
  position: relative;
  z-index: 1;
  width: min(1100px, 95vw);
  max-height: 90vh;
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#bunnyPlayer {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

#bunnyPlayer iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Close button (non-fullscreen) */
.video-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.video-close-btn:hover {
  background: rgba(0, 0, 0, 0.85);
  transform: scale(1.1);
}

/* Loading overlay */
.video-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  gap: var(--space-4);
}

.video-loading-overlay.is-hidden {
  display: none !important;
}

.video-loading-spinner {
  width: 3rem;
  height: 3rem;
  border: 3px solid var(--border-default);
  border-top-color: var(--color-primary);
  border-radius: var(--radius-full);
  animation: spin 1s linear infinite;
}

.video-loading-text {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
}

/* Student name overlay */
.student-name-overlay {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  z-index: 5;
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  pointer-events: none;
}

/* Fullscreen interceptor */
.fullscreen-interceptor {
  position: absolute;
  top: 0;
  right: 0;
  width: 60px;
  height: 60px;
  z-index: 6;
  cursor: pointer;
}



/* Prevent body scroll when modal is open */
body.video-modal-open {
  overflow: hidden;
}

/* === PRINT STYLES === */
@media print {
  .no-print,
  .navigation-buttons,
  .whatsapp,
  .sidebar,
  #mainNav {
    display: none !important;
  }
  
  .main-content-with-sidebar {
    margin: 0 !important;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #cbd5e1;
    break-inside: avoid;
  }
  
  body {
    background: white;
    color: black;
  }
}

.student-name-overlay-active {
  top: 50%;
  bottom: auto;
  left: 50%;
  z-index: 9999;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* === UNIFIED NON-AUTH FORM SYSTEM === */
body:not(.auth-page) input[type="text"]:not(.auth-form *):not(.auth-card *):not(.auth-redesign *),
body:not(.auth-page) input[type="email"]:not(.auth-form *):not(.auth-card *):not(.auth-redesign *),
body:not(.auth-page) input[type="password"]:not(.auth-form *):not(.auth-card *):not(.auth-redesign *),
body:not(.auth-page) input[type="number"]:not(.auth-form *):not(.auth-card *):not(.auth-redesign *),
body:not(.auth-page) input[type="datetime-local"]:not(.auth-form *):not(.auth-card *):not(.auth-redesign *),
body:not(.auth-page) input[type="date"]:not(.auth-form *):not(.auth-card *):not(.auth-redesign *),
body:not(.auth-page) input[type="time"]:not(.auth-form *):not(.auth-card *):not(.auth-redesign *),
body:not(.auth-page) input[type="search"]:not(.auth-form *):not(.auth-card *):not(.auth-redesign *),
body:not(.auth-page) input[type="url"]:not(.auth-form *):not(.auth-card *):not(.auth-redesign *),
body:not(.auth-page) select:not(.auth-form *):not(.auth-card *):not(.auth-redesign *),
body:not(.auth-page) textarea:not(.auth-form *):not(.auth-card *):not(.auth-redesign *),
.subject-select,
.quiz-input,
.assignment-input,
.lib-input,
.equation-input {
  background-color: var(--bg-surface, #ffffff) !important;
  border: 1.5px solid var(--border-default, #cbd5e1) !important;
  border-radius: 0.75rem !important;
  color: var(--text-primary, #0f172a) !important;
  font-size: 0.9375rem !important;
  font-weight: 450 !important;
  line-height: 1.5 !important;
  padding: 0.65rem 1rem !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease !important;
}

body:not(.auth-page) input[type="text"]:not(.auth-form *):not(.auth-card *):not(.auth-redesign *):hover,
body:not(.auth-page) input[type="email"]:not(.auth-form *):not(.auth-card *):not(.auth-redesign *):hover,
body:not(.auth-page) input[type="password"]:not(.auth-form *):not(.auth-card *):not(.auth-redesign *):hover,
body:not(.auth-page) input[type="number"]:not(.auth-form *):not(.auth-card *):not(.auth-redesign *):hover,
body:not(.auth-page) input[type="datetime-local"]:not(.auth-form *):not(.auth-card *):not(.auth-redesign *):hover,
body:not(.auth-page) input[type="date"]:not(.auth-form *):not(.auth-card *):not(.auth-redesign *):hover,
body:not(.auth-page) input[type="search"]:not(.auth-form *):not(.auth-card *):not(.auth-redesign *):hover,
body:not(.auth-page) select:not(.auth-form *):not(.auth-card *):not(.auth-redesign *):hover,
body:not(.auth-page) textarea:not(.auth-form *):not(.auth-card *):not(.auth-redesign *):hover {
  border-color: var(--border-hover, #94a3b8) !important;
}

body:not(.auth-page) input[type="text"]:not(.auth-form *):not(.auth-card *):not(.auth-redesign *):focus,
body:not(.auth-page) input[type="email"]:not(.auth-form *):not(.auth-card *):not(.auth-redesign *):focus,
body:not(.auth-page) input[type="password"]:not(.auth-form *):not(.auth-card *):not(.auth-redesign *):focus,
body:not(.auth-page) input[type="number"]:not(.auth-form *):not(.auth-card *):not(.auth-redesign *):focus,
body:not(.auth-page) input[type="datetime-local"]:not(.auth-form *):not(.auth-card *):not(.auth-redesign *):focus,
body:not(.auth-page) input[type="date"]:not(.auth-form *):not(.auth-card *):not(.auth-redesign *):focus,
body:not(.auth-page) input[type="search"]:not(.auth-form *):not(.auth-card *):not(.auth-redesign *):focus,
body:not(.auth-page) select:not(.auth-form *):not(.auth-card *):not(.auth-redesign *):focus,
body:not(.auth-page) textarea:not(.auth-form *):not(.auth-card *):not(.auth-redesign *):focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15) !important;
  outline: none !important;
}

/* Custom File Selector */
body:not(.auth-page) input[type="file"]:not(.auth-form *):not(.auth-card *):not(.auth-redesign *)::file-selector-button {
  background: var(--color-primary) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 0.5rem !important;
  padding: 0.4rem 0.875rem !important;
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  margin-right: 0.75rem !important;
  cursor: pointer !important;
  transition: background-color 0.2s ease !important;
}

body:not(.auth-page) input[type="file"]:not(.auth-form *):not(.auth-card *):not(.auth-redesign *):hover::file-selector-button {
  background: var(--color-primary-dark) !important;
  transform: none !important;
}

[dir="rtl"] body:not(.auth-page) input[type="file"]:not(.auth-form *):not(.auth-card *):not(.auth-redesign *)::file-selector-button {
  margin-right: 0 !important;
  margin-left: 0.75rem !important;
}

/* Checkboxes and Radios */
body:not(.auth-page) input[type="checkbox"]:not(.auth-form *):not(.auth-card *):not(.auth-redesign *),
body:not(.auth-page) input[type="radio"]:not(.auth-form *):not(.auth-card *):not(.auth-redesign *) {
  accent-color: #6366f1 !important;
  cursor: pointer !important;
}

/* === MODERN WORKSPACE FORM CARD SYSTEM === */

/* Form Page Container */
.app-form-container,
body:not(.auth-page) .profile-update-container {
  max-width: 52rem !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 2.5rem 1rem !important;
  width: 100% !important;
}

/* App Form Card & Universal Form Centering Guarantee */
.app-form-card,
body:not(.auth-page) .profile-update-card,
body:not(.auth-page) .auth-card:not(.auth-redesign *) {
  background: var(--bg-surface, #ffffff) !important;
  border: 1px solid var(--border-default, #e2e8f0) !important;
  border-radius: 1.25rem !important;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.05), 0 0 1px 1px rgba(0, 0, 0, 0.02) !important;
  overflow: hidden !important;
  transition: all 0.25s ease !important;
  margin-left: auto !important;
  margin-right: auto !important;
  margin-bottom: 2rem !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: 52rem !important;
}

/* Force Bootstrap Grid Form Offsets & Containers to Center */
body:not(.auth-page) .row:has(> .col-md-6.offset-md-3),
body:not(.auth-page) .row:has(> .col-md-8) {
  justify-content: center !important;
}

body:not(.auth-page) .offset-md-3 {
  margin-left: auto !important;
  margin-right: auto !important;
  float: none !important;
}

/* Dark Mode Form Card */
[data-mdb-theme="dark"] .app-form-card,
[data-mdb-theme="dark"] body:not(.auth-page) .profile-update-card,
[data-mdb-theme="dark"] body:not(.auth-page) .auth-card:not(.auth-redesign *),
.dark .app-form-card,
.dark body:not(.auth-page) .profile-update-card {
  background: rgba(15, 23, 42, 0.85) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.4) !important;
  backdrop-filter: blur(16px) !important;
}

/* App Form Header */
.app-form-header,
body:not(.auth-page) .profile-header,
body:not(.auth-page) .auth-card:not(.auth-redesign *) .auth-header {
  padding: 1.75rem 2rem 1.5rem 2rem !important;
  border-bottom: 1px solid var(--border-light, #f1f5f9) !important;
  background: var(--bg-tertiary, #f8fafc) !important;
  display: flex !important;
  align-items: center !important;
  gap: 1.25rem !important;
  text-align: left !important;
}

[dir="rtl"] .app-form-header,
[dir="rtl"] body:not(.auth-page) .profile-header,
[dir="rtl"] body:not(.auth-page) .auth-card:not(.auth-redesign *) .auth-header {
  text-align: right !important;
}

[data-mdb-theme="dark"] .app-form-header,
[data-mdb-theme="dark"] body:not(.auth-page) .profile-header,
[data-mdb-theme="dark"] body:not(.auth-page) .auth-card:not(.auth-redesign *) .auth-header,
.dark .app-form-header {
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
  background: rgba(255, 255, 255, 0.03) !important;
}

/* Icon Badge */
.app-form-icon-badge,
body:not(.auth-page) .auth-card:not(.auth-redesign *) .auth-logo {
  width: 3.25rem !important;
  height: 3.25rem !important;
  border-radius: 0.875rem !important;
  background: var(--color-primary, #818cf8) !important;
  color: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.25rem !important;
  box-shadow: none !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
}

/* Header Text Wrapper */
.app-form-header-text {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.2rem !important;
}

/* Form Title */
.app-form-title,
body:not(.auth-page) .profile-header h2,
body:not(.auth-page) .auth-card:not(.auth-redesign *) .auth-title {
  font-size: 1.375rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
  color: var(--text-primary, #0f172a) !important;
  margin: 0 !important;
  line-height: 1.3 !important;
}

[data-mdb-theme="dark"] .app-form-title,
[data-mdb-theme="dark"] body:not(.auth-page) .profile-header h2,
[data-mdb-theme="dark"] body:not(.auth-page) .auth-card:not(.auth-redesign *) .auth-title,
.dark .app-form-title {
  color: #f8fafc !important;
}

/* Form Subtitle */
.app-form-subtitle,
body:not(.auth-page) .profile-header p,
body:not(.auth-page) .auth-card:not(.auth-redesign *) .auth-subtitle {
  font-size: 0.875rem !important;
  color: var(--text-tertiary, #64748b) !important;
  margin: 0 !important;
  font-weight: 450 !important;
}

[data-mdb-theme="dark"] .app-form-subtitle,
[data-mdb-theme="dark"] body:not(.auth-page) .profile-header p,
[data-mdb-theme="dark"] body:not(.auth-page) .auth-card:not(.auth-redesign *) .auth-subtitle,
.dark .app-form-subtitle {
  color: #94a3b8 !important;
}

/* Form Content Body */
.app-form-body,
body:not(.auth-page) .profile-form-container,
body:not(.auth-page) .auth-card:not(.auth-redesign *) .auth-form {
  padding: 2.25rem 2.25rem !important;
}

@media (max-width: 640px) {
  .app-form-body,
  body:not(.auth-page) .profile-form-container,
  body:not(.auth-page) .auth-card:not(.auth-redesign *) .auth-form {
    padding: 1.25rem !important;
  }
}

/* Form Action Buttons */
body:not(.auth-page) .auth-card:not(.auth-redesign *) .auth-button,
.btn-app-primary {
  width: 100% !important;
  background: var(--color-primary, #818cf8) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  font-size: 0.9375rem !important;
  padding: 0.85rem 1.75rem !important;
  border-radius: 0.5rem !important;
  border: none !important;
  box-shadow: none !important;
  cursor: pointer !important;
  transition: background-color 0.2s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
}

body:not(.auth-page) .auth-card:not(.auth-redesign *) .auth-button:hover,
.btn-app-primary:hover {
  background: var(--color-primary-dark, #6366f1) !important;
  transform: none !important;
  box-shadow: none !important;
}

.btn-app-secondary {
  background: var(--bg-tertiary, #f8fafc) !important;
  color: var(--text-secondary, #475569) !important;
  border: 1.5px solid var(--border-default, #cbd5e1) !important;
  font-weight: 600 !important;
  font-size: 0.9375rem !important;
  padding: 0.85rem 1.5rem !important;
  border-radius: 0.875rem !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  text-decoration: none !important;
}

.btn-app-secondary:hover {
  background: #f1f5f9 !important;
  color: #1e293b !important;
  border-color: #94a3b8 !important;
}

/* === LECTURE & GENERAL DROPDOWN MENUS === */
.dropdown,
.lecture-actions-dropdown {
  position: relative !important;
  z-index: 60 !important;
}

.dropdown-menu {
  display: none !important;
  position: absolute !important;
  top: 100% !important;
  z-index: 1050 !important;
  min-width: 10rem !important;
  padding: 0.5rem 0 !important;
  margin: 0.25rem 0 0 !important;
  font-size: 0.875rem !important;
  color: #1e293b !important;
  text-align: left !important;
  list-style: none !important;
  background-color: #ffffff !important;
  background-clip: padding-box !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  border-radius: 0.75rem !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05) !important;
}

/* Default LTR positioning */
:root:not([dir="rtl"]) .dropdown-menu:not(.right-0):not(.dropdown-menu-end) {
  left: 0 !important;
  right: auto !important;
}

/* Right-aligned dropdowns in LTR */
:root:not([dir="rtl"]) .dropdown-menu.right-0,
:root:not([dir="rtl"]) .dropdown-menu.dropdown-menu-end,
:root:not([dir="rtl"]) .lecture-actions-dropdown .dropdown-menu {
  right: 0 !important;
  left: auto !important;
}

.dark .dropdown-menu {
  background-color: #1e293b !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #f1f5f9 !important;
}

[dir="rtl"] .dropdown-menu {
  right: 0 !important;
  left: auto !important;
  text-align: right !important;
}

[dir="rtl"] .dropdown-menu.dropdown-menu-end {
  left: 0 !important;
  right: auto !important;
}

.dropdown-menu.show {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.detail-accordion-item.dropdown-open,
.detail-accordion-item:has(.dropdown-menu.show) {
  overflow: visible !important;
  z-index: 70 !important;
}
