/* Dedicated Student Mobile Navigation */
.student-mobile-nav {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 24px;
  z-index: 1061; /* Higher than regular mobile nav to avoid conflicts */
  padding: 8px 16px;
  display: none;
  align-items: center;
  justify-content: space-around;
  gap: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15),
    0 4px 10px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  animation: slideUpStudentNav 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  overflow: visible;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  width: 90%;
  max-width: 400px;
  min-width: 320px;
}

.student-mobile-nav::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

@keyframes slideUpStudentNav {
  from {
    transform: translate(-50%, 100px);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

.student-mobile-nav .nav-item {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.student-mobile-nav .nav-link {
  color: #94a3b8;
  padding: 8px 4px;
  border-radius: 12px;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  height: 44px;
  text-decoration: none;
  position: relative;
}

.student-mobile-nav .nav-link i {
  font-size: 1.2rem;
  transition: all 0.3s ease;
  z-index: 2;
}

.student-mobile-nav .nav-link span {
  font-size: 0;
  opacity: 0;
  height: 0;
  transition: all 0.3s ease;
  white-space: nowrap;
}

/* Active State */
.student-mobile-nav .nav-link.active {
  color: var(--primary) !important;
  background: transparent !important;
  transform: translateY(-4px);
}

.student-mobile-nav .nav-link.active i {
  transform: translateY(-1px) scale(1.3);
  filter: drop-shadow(0 4px 8px rgba(67, 97, 238, 0.3));
}

.student-mobile-nav .nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  z-index: 3;
  box-shadow: 0 2px 4px rgba(67, 97, 238, 0.4);
}

.student-mobile-nav .nav-link:not(.active) {
  transform: translateY(0);
}

.student-mobile-nav .nav-link:not(.active) i {
  transform: translateY(0) scale(1);
}

/* Badge styling for student nav */
.student-mobile-nav .nav-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #ef4444;
  color: white;
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 0.65rem;
  font-weight: 600;
  min-width: 16px;
  text-align: center;
  z-index: 3;
}

.student-mobile-nav .nav-badge.rounded-circle {
  width: 8px;
  height: 8px;
  padding: 0;
}

/* Hover effects */
.student-mobile-nav .nav-link:active {
  transform: scale(0.9);
}

/* Mobile display */
@media (max-width: 768px) {
  .student-mobile-nav {
    display: flex !important;
  }
}

/* Small mobile phones */
@media (max-width: 380px) {
  .student-mobile-nav {
    width: 95%;
    min-width: 300px;
    padding: 6px 12px;
    gap: 2px;
  }
  .student-mobile-nav .nav-link {
    padding: 6px 2px;
    height: 40px;
  }
  .student-mobile-nav .nav-link.active {
    transform: translateY(-3px);
  }
  .student-mobile-nav .nav-link.active i {
    transform: translateY(-1px) scale(1.25);
  }
  .student-mobile-nav .nav-link.active::after {
    bottom: -2px;
    width: 5px;
    height: 5px;
  }
  .student-mobile-nav .nav-link i {
    font-size: 1.1rem;
  }
}

/* Very small mobile phones */
@media (max-width: 320px) {
  .student-mobile-nav {
    width: 98%;
    min-width: 280px;
    padding: 4px 8px;
  }
  .student-mobile-nav .nav-link {
    padding: 4px 1px;
    height: 38px;
  }
  .student-mobile-nav .nav-link.active {
    transform: translateY(-2px);
  }
  .student-mobile-nav .nav-link.active i {
    transform: translateY(-1px) scale(1.2);
  }
  .student-mobile-nav .nav-link.active::after {
    bottom: -1px;
    width: 4px;
    height: 4px;
  }
  .student-mobile-nav .nav-link i {
    font-size: 1rem;
  }
}

/* Alternative: Always show on mobile regardless of :has() support */
@media (max-width: 768px) {
  body .student-mobile-nav {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}

/* Force hide regular mobile nav on student pages */
@media (max-width: 768px) {
  .student-mobile-nav ~ .mobile-bottom-nav,
  .mobile-bottom-nav:not(.student-mobile-nav) {
    display: none !important;
  }
}

/* Safe area insets for notched phones */
@supports (padding: max(0px)) {
  .student-mobile-nav {
    bottom: max(20px, calc(10px + env(safe-area-inset-bottom)));
    padding-bottom: 10px;
  }
}

/* Prevent conflicts with other mobile navigations */
.mobile-bottom-nav:not(.student-mobile-nav) {
  z-index: 1060; /* Lower than student nav */
}

/* Hide regular mobile nav when student nav is present */
body:has(.student-mobile-nav) .mobile-bottom-nav:not(.student-mobile-nav) {
  display: none !important;
}

/* Dedicated Student Instructor Mobile Navigation */
.student-instructor-mobile-nav {
  --si-nav-bottom-offset: 12px;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  transform: none;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  z-index: 1061; /* Higher than regular mobile nav to avoid conflicts */
  padding: 10px 12px var(--si-nav-bottom-offset);
  display: none;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
  animation: slideUpStudentInstructorNav 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  overflow: visible;
  width: 100%;
  max-width: none;
  transition: transform 0.28s ease, opacity 0.28s ease, box-shadow 0.28s ease;
  will-change: transform, opacity;
}

.student-instructor-mobile-nav::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

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

.student-instructor-mobile-nav .nav-item {
  display: flex;
  align-items: center;
  flex: 1 1 0;
  min-width: 0;
}

.student-instructor-mobile-nav .nav-link {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  min-width: 0;
  width: 100%;
  height: 44px;
  padding: 0;
  border-radius: 18px;
  transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  align-self: flex-end;
}

.student-instructor-mobile-nav .nav-icon {
  position: relative;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.student-instructor-mobile-nav .nav-link i {
  font-size: 1.2rem;
  transition: transform 0.25s ease, filter 0.25s ease;
}

/* Active State */
.student-instructor-mobile-nav .nav-link.active,
#studentInstructorMobileNav .nav-link.active {
  color: var(--primary) !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border-color: transparent;
  border-bottom-color: transparent;
  border-radius: 16px 16px 0 0;
  box-shadow: none;
  outline: none;
  margin-bottom: calc(-1 * var(--si-nav-bottom-offset));
  padding-bottom: var(--si-nav-bottom-offset);
  height: calc(44px + var(--si-nav-bottom-offset));
}

.student-instructor-mobile-nav .nav-link.active i {
  transform: translateY(-2px);
  filter: drop-shadow(0 4px 8px rgba(67, 97, 238, 0.3));
}

.student-instructor-mobile-nav .nav-link.active::before,
.student-instructor-mobile-nav .nav-link.active::after,
#studentInstructorMobileNav .nav-link.active::before,
#studentInstructorMobileNav .nav-link.active::after {
  content: none !important;
  display: none !important;
}

/* Badge styling for student instructor nav */
.student-instructor-mobile-nav .nav-badge {
  position: absolute;
  top: -3px;
  right: -6px;
  font-size: 0.63rem;
  padding: 2px 5px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.28);
}

.student-instructor-mobile-nav .nav-badge.rounded-circle {
  width: 10px;
  height: 10px;
  padding: 0;
  min-width: 10px;
  top: 0;
  right: 0;
}

/* Hover effects */
.student-instructor-mobile-nav .nav-link:not(.active):active {
  transform: scale(0.94);
}

.student-instructor-mobile-nav .nav-link.active:active {
  transform: scale(0.98);
}

/* Mobile display */
@media (max-width: 768px) {
  .student-instructor-mobile-nav {
    display: flex !important;
  }
}

/* Alternative: Always show on mobile regardless of :has() support */
@media (max-width: 768px) {
  body .student-instructor-mobile-nav {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}

/* Force hide regular mobile nav on student instructor pages */
@media (max-width: 768px) {
  .student-instructor-mobile-nav ~ .mobile-bottom-nav,
  .mobile-bottom-nav:not(.student-instructor-mobile-nav) {
    display: none !important;
  }
}

/* Safe area insets for notched phones */
@supports (padding: max(0px)) {
  .student-instructor-mobile-nav {
    bottom: 0;
    --si-nav-bottom-offset: max(12px, calc(12px + env(safe-area-inset-bottom)));
  }
}

/* Prevent conflicts with other mobile navigations */
.mobile-bottom-nav:not(.student-instructor-mobile-nav) {
  z-index: 1060; /* Lower than student instructor nav */
}

/* Hide regular mobile nav when student instructor nav is present */
body:has(.student-instructor-mobile-nav) .mobile-bottom-nav:not(.student-instructor-mobile-nav) {
  display: none !important;
}

/* Shared floating-nav hide/show state */
.student-mobile-nav,
.student-instructor-mobile-nav,
.mobile-bottom-nav {
  transition: transform 0.28s ease, opacity 0.28s ease, box-shadow 0.28s ease;
  will-change: transform, opacity;
}

.student-mobile-nav.nav-hidden,
.mobile-bottom-nav.nav-hidden {
  transform: translate(-50%, calc(100% + 32px)) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none;
  box-shadow: none;
}

.student-instructor-mobile-nav.nav-hidden {
  transform: translateY(calc(100% + 16px)) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none;
  box-shadow: none;
}

@media (max-width: 380px) {
  .student-instructor-mobile-nav {
    width: 100%;
    gap: 4px;
    --si-nav-bottom-offset: 10px;
    padding: 8px 8px var(--si-nav-bottom-offset);
    border-radius: 16px 16px 0 0;
  }

  .student-instructor-mobile-nav .nav-link {
    height: 42px;
  }

  .student-instructor-mobile-nav .nav-link.active {
    height: calc(42px + var(--si-nav-bottom-offset));
  }
}

/* Mobile-First CSS Enhancements */

/* Bottom Navigation Bar */
/* Bottom Navigation Bar - Glassmorphic Floating Dock */
.mobile-bottom-nav {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 24px;
  z-index: 1060;
  padding: 10px 20px;
  display: none;
  align-items: center;
  justify-content: space-around; /* Evenly distribute items */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15),
    0 4px 10px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  animation: slideUpNav 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  width: 90%;
  max-width: 400px;
}

.mobile-bottom-nav::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.mobile-bottom-nav.scrollable {
  justify-content: flex-start;
  gap: 8px;
}

/* Add scroll indicators */
.mobile-bottom-nav.scrollable::before,
.mobile-bottom-nav.scrollable::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 20px;
  z-index: 1;
  pointer-events: none;
}

.mobile-bottom-nav.scrollable::before {
  left: 0;
  background: linear-gradient(to right, rgba(255, 255, 255, 0.9), transparent);
}

.mobile-bottom-nav.scrollable::after {
  right: 0;
  background: linear-gradient(to left, rgba(255, 255, 255, 0.9), transparent);
}

@keyframes slideUpNav {
  from {
    transform: translate(-50%, 100px);
    opacity: 0;
  }

  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

.mobile-bottom-nav .nav-item {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.mobile-bottom-nav .nav-link {
  color: #94a3b8;
  padding: 8px;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-decoration: none;
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0; /* Prevent items from shrinking */
}

/* When nav is scrollable, make items more compact */
.mobile-bottom-nav.scrollable .nav-link {
  width: 44px;
  height: 44px;
  padding: 6px;
  gap: 2px;
}

.mobile-bottom-nav .nav-link i {
  font-size: 1.4rem;
  transition: all 0.3s ease;
  z-index: 2;
}

/* Smaller icons for scrollable nav */
.mobile-bottom-nav.scrollable .nav-link i {
  font-size: 1.2rem;
}

.mobile-bottom-nav .nav-link span {
  font-size: 0;
  /* Hide text by default for clean look */
  opacity: 0;
  height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* Active State */
.mobile-bottom-nav .nav-link.active {
  color: var(--primary) !important;
  background: transparent !important;
}

.mobile-bottom-nav .nav-link.active i {
  transform: translateY(-2px);
  filter: drop-shadow(0 4px 8px rgba(67, 97, 238, 0.3));
}

.mobile-bottom-nav .nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background-color: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--primary);
}

/* Hover effects for improved interactivity */
.mobile-bottom-nav .nav-link:active {
  transform: scale(0.9);
}

/* Mobile scrollable tabs */
.mobile-scrollable-tabs {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  border-bottom: 1px solid #dee2e6;
  white-space: nowrap;
  gap: 0.5rem;
  padding: 0 0.5rem;
}

.mobile-scrollable-tabs::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.mobile-scrollable-tabs .nav-item {
  flex-shrink: 0;
}

.mobile-scrollable-tabs .nav-link {
  min-width: 60px;
  padding: 0.75rem 1rem;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 0.5rem 0.5rem 0 0;
  background: transparent;
  color: #6c757d;
  text-align: center;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  font-size: 0.75rem;
}

.mobile-scrollable-tabs .nav-link i {
  font-size: 1.25rem;
  margin: 0;
}

.mobile-scrollable-tabs .nav-link.active {
  background: white;
  color: var(--primary);
  border-color: #dee2e6;
  border-bottom-color: white;
  font-weight: 600;
}

.mobile-scrollable-tabs .nav-link:hover {
  color: var(--primary);
  background: rgba(67, 97, 238, 0.05);
}

/* Add scroll indicators for mobile tabs */
.mobile-scrollable-tabs::before,
.mobile-scrollable-tabs::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 1px; /* Account for border */
  width: 30px;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-scrollable-tabs::before {
  left: 0;
  background: linear-gradient(to right, white, transparent);
}

.mobile-scrollable-tabs::after {
  right: 0;
  background: linear-gradient(to left, white, transparent);
}

.mobile-scrollable-tabs.scroll-start::before {
  opacity: 0;
}

.mobile-scrollable-tabs.scroll-end::after {
  opacity: 0;
}

.mobile-scrollable-tabs.scrolling::before,
.mobile-scrollable-tabs.scrolling::after {
  opacity: 1;
}

/* Position relative for gradient overlays */
.mobile-scrollable-tabs {
  position: relative;
}

/* Touch feedback for mobile tabs */
.mobile-scrollable-tabs .nav-link:active {
  transform: scale(0.95);
}

/* Hover shadow effects */
.hover-shadow {
  transition: all 0.2s ease;
}

.hover-shadow:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* Card hover effects */
.card {
  transition: all 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Mobile file viewer improvements */
@media (max-width: 768px) {
  .list-group-item {
    border-radius: 8px !important;
    margin-bottom: 8px;
  }
  
  .dropdown-menu {
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  }
  
  .btn-sm {
    min-height: 32px;
    font-size: 0.875rem;
  }
}

/* Mobile Layout Adjustments */
@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex !important;
  }

  /* Add bottom padding to account for fixed nav */
  body {
    padding-bottom: 80px !important;
  }

  .admin-main-content,
  .student-main-content,
  .instructor-main-content {
    padding-bottom: 80px;
  }

  /* Hide desktop sidebar on mobile */
  .sidebar {
    transform: translateX(-100%) !important;
  }

  .sidebar.show {
    transform: translateX(0) !important;
    width: 280px;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.2);
  }

  /* Keep course tabs on single line */
  .nav-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    border-bottom: 1px solid #dee2e6 !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  .nav-tabs .nav-item {
    flex-shrink: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-bottom: 3px solid transparent !important;
  }
  
  .nav-tabs .nav-link {
    border: none !important;
    border-bottom: 3px solid transparent !important;
    border-radius: 0 !important;
    padding: 0.5rem 0.75rem !important;
    white-space: nowrap !important;
    font-size: 0.875rem !important;
    min-width: auto !important;
    flex-shrink: 0 !important;
  }
  
  .nav-tabs .nav-link.active {
    border-bottom-color: var(--primary) !important;
    background: transparent !important;
    color: var(--primary) !important;
  }
  
  .nav-tabs .nav-link i {
    margin-right: 0.25rem !important;
  }
  
  .nav-tabs .nav-link span {
    display: none !important;
  }
  
  /* Show only icon on mobile */
  .nav-tabs .nav-link i {
    display: block !important;
    margin: 0 !important;
    font-size: 1.1rem !important;
  }
  
  .list-group-item {
    border-radius: 8px !important;
    margin-bottom: 8px;
  }
  
  .dropdown-menu {
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  }
  
  .btn-sm {
    min-height: 32px;
    font-size: 0.875rem;
  }
  
  /* Mobile cards */
  .card {
    margin-bottom: 1rem;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.05);
  }
  
  /* Mobile tables */
  .table-responsive {
    border-radius: 12px;
    overflow: hidden;
  }
  
  .table {
    font-size: 0.875rem;
  }
  
  /* Mobile buttons */
  .btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
  }
  
  /* Mobile forms */
  .form-control,
  .form-select {
    min-height: 44px;
    font-size: 16px;
  }
  
  /* Mobile navigation */
  .navbar {
    padding: 0.75rem 1rem;
  }
  
  /* Mobile spacing */
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  /* Mobile typography */
  h1 {
    font-size: 1.75rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  h3 {
    font-size: 1.25rem;
  }
  
  h4 {
    font-size: 1.125rem;
  }
}

/* Touch-friendly interactions */
.touch-target {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Swipe indicators */
.swipe-hint {
  position: relative;
  overflow: hidden;
}

.swipe-hint::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  animation: swipeHint 2s infinite;
}

@keyframes swipeHint {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

/* Pull-to-refresh indicator */
.pull-to-refresh {
  position: fixed;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  padding: 12px 24px;
  border-radius: 0 0 24px 24px;
  z-index: 999;
  transition: top 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.pull-to-refresh.show {
  top: 0;
}

.pull-to-refresh i {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Mobile course cards */
.course-card-mobile {
  background: white;
  border-radius: 16px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.course-card-mobile:active {
  transform: scale(0.98);
}

.course-card-mobile .course-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--dark);
}

.course-card-mobile .course-meta {
  font-size: 0.875rem;
  color: #64748b;
  margin-bottom: 0.75rem;
}

.course-card-mobile .course-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
}

.course-card-mobile .stat-item {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #64748b;
}

/* Mobile dashboard widgets */
.mobile-widget {
  background: white;
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.mobile-widget .widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.mobile-widget .widget-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--dark);
}

.mobile-widget .widget-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

/* Floating Action Button */
.fab {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  box-shadow: 0 4px 20px rgba(67, 97, 238, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  z-index: 998;
  transition: all 0.2s ease;
}

.fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(67, 97, 238, 0.5);
}

.fab:active {
  transform: scale(0.95);
}

/* Mobile animations */
.mobile-slide-up {
  animation: mobileSlideUp 0.3s ease-out;
}

@keyframes mobileSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

/* Safe area insets for notched phones */
/* Safe area insets for notched phones */
@supports (padding: max(0px)) {
  .mobile-bottom-nav {
    bottom: max(20px, calc(10px + env(safe-area-inset-bottom)));
    padding-bottom: 10px;
    /* Keep padding consistent */
  }

  /* Adjust pull-to-refresh to account for notch if at top, though usually browser handles this. 
     We focus on bottom nav spacing here. */

  .admin-main-content,
  .student-main-content,
  .instructor-main-content,
  .main-content {
    padding-bottom: max(100px, calc(80px + env(safe-area-inset-bottom)));
  }
}
