@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Lexend:wght@400;500;600;700;800&family=Noto+Sans+Sinhala:wght@400;500;600;700&display=swap');

:root {
  --moodle-bg: #f8f9fa;
  --moodle-primary: #0f4c81; /* Premium Moodle blue */
  --moodle-accent: #f26f21;  /* Classic Orange accent */
  --moodle-success: #198754;
  --moodle-card-bg: #ffffff;
  --moodle-border: #dee2e6;
  --moodle-text: #212529;
  --moodle-text-muted: #6c757d;
  --sidebar-width: 260px;
}

body {
  font-family: 'Noto Sans Sinhala', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--moodle-bg);
  color: var(--moodle-text);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .moodle-brand {
  font-family: 'Noto Sans Sinhala', 'Lexend', sans-serif;
}

/* Collapsible Left Navigation Drawer */
.moodle-drawer {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background-color: #ffffff;
  border-right: 1px solid var(--moodle-border);
  z-index: 1045;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  padding-top: 75px;
  box-shadow: 4px 0 25px rgba(0, 0, 0, 0.07);
}

.moodle-drawer.collapsed {
  transform: translateX(-100%);
  box-shadow: none;
}

/* Mobile & Overlay Backdrop for Drawer */
.moodle-drawer-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  z-index: 1035;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.moodle-drawer-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

/* Main Content Wrapper adjust to sidebar */
.moodle-content-wrapper {
  margin-left: var(--sidebar-width);
  transition: margin-left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 100vh;
  padding-top: 70px;
}

.moodle-content-wrapper.full-width {
  margin-left: 0;
}

@media (max-width: 991.98px) {
  .moodle-content-wrapper {
    margin-left: 0 !important;
  }
}

/* Moodle Top Navigation Header */
.moodle-header {
  height: 70px;
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  background-color: #ffffff;
  border-bottom: 1px solid var(--moodle-border);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: justify;
}

/* Moodle Cards */
.moodle-card {
  background: var(--moodle-card-bg);
  border: 1px solid var(--moodle-border);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.moodle-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.07);
}

/* Navigation Drawer Links */
.drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: var(--moodle-text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  border-left: 4px solid transparent;
  transition: all 0.2s ease;
}

.drawer-link:hover {
  background-color: #f1f3f5;
  color: var(--moodle-primary);
}

.drawer-link.active {
  background-color: #e8f0fe;
  color: var(--moodle-primary);
  border-left-color: var(--moodle-primary);
  font-weight: 600;
}

/* Activity Icons & Checkboxes */
.activity-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.icon-blue { background-color: #3b82f6; }
.icon-red { background-color: #ef4444; }
.icon-green { background-color: #10b981; }
.icon-orange { background-color: #f59e0b; }

.moodle-checkbox {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 2px solid var(--moodle-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: #fff;
}

.moodle-checkbox.checked {
  background-color: var(--moodle-success);
  border-color: var(--moodle-success);
  color: #fff;
}

/* Timeline Activity List */
.timeline-item {
  position: relative;
  padding-left: 20px;
  border-left: 2px solid var(--moodle-border);
  padding-bottom: 20px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--moodle-primary);
}

.timeline-item.done::before {
  background-color: var(--moodle-success);
}

/* Course progress rings */
.progress-ring-circle {
  transition: stroke-dashoffset 0.35s;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

/* Custom interactive sections */
.section-header {
  background-color: #f8f9fa;
  border: 1px solid var(--moodle-border);
  border-radius: 6px;
  padding: 16px 20px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.section-header:hover {
  background-color: #e9ecef;
}

/* Profile Dropdown Header styling */
.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 4px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.user-menu-btn:hover {
  background-color: #f1f3f5;
}

/* Breadcrumbs customization */
.moodle-breadcrumb {
  background-color: transparent;
  padding: 0;
  margin-bottom: 20px;
}

.moodle-breadcrumb a {
  color: var(--moodle-primary);
  text-decoration: none;
}

.moodle-breadcrumb a:hover {
  text-decoration: underline;
}

/* Quick Tab selectors */
.moodle-tab-btn {
  font-weight: 500;
  padding: 8px 16px;
  border: none;
  background: none;
  border-bottom: 3px solid transparent;
  color: var(--moodle-text-muted);
  transition: all 0.2s ease;
}

.moodle-tab-btn:hover, .moodle-tab-btn.active {
  color: var(--moodle-primary);
  border-bottom-color: var(--moodle-primary);
}

/* Custom Modal/Popup styled for Moodle */
.moodle-popup-dialog {
  border-radius: 8px;
  border: 0;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.moodle-popup-header {
  border-bottom: 1px solid var(--moodle-border);
  padding: 16px 24px;
}

.moodle-popup-body {
  padding: 24px;
}

.moodle-popup-footer {
  border-top: 1px solid var(--moodle-border);
  padding: 16px 24px;
}

/* Tailwind & Bootstrap Collapse Conflict Fix */
.collapse.show {
  visibility: visible !important;
  display: block !important;
}
.collapsing {
  visibility: visible !important;
}

/* ==========================================================================
   Promotional Announcements Banner / Ad Slider Styles
   ========================================================================== */
.promo-carousel-container {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background-color: #0f172a;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  min-height: 270px;
  touch-action: pan-y;
}

.promo-carousel-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  width: 100%;
  height: 100%;
}

.promo-slide {
  min-width: 100%;
  position: relative;
  overflow: hidden;
  user-select: none;
}

.promo-slide-img {
  width: 100%;
  height: 100%;
  min-height: 280px;
  max-height: 320px;
  object-fit: cover;
  display: block;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.promo-carousel-container:hover .promo-slide-img {
  transform: scale(1.04);
}

.promo-slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.15) 0%, rgba(15, 23, 42, 0.45) 45%, rgba(15, 23, 42, 0.94) 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 22px;
  color: #ffffff;
  z-index: 2;
}

.text-shadow {
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.backdrop-blur {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Glassmorphism Carousel Navigation Controls */
.promo-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 6;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.promo-carousel-container:hover .promo-nav-btn,
.promo-carousel-container:focus-within .promo-nav-btn {
  opacity: 1;
}

.promo-nav-btn:hover {
  background: rgba(255, 255, 255, 0.95);
  color: #0f4c81;
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.promo-nav-prev {
  left: 14px;
}

.promo-nav-next {
  right: 14px;
}

/* Animated Pagination Indicators */
.promo-indicators {
  position: absolute;
  bottom: 16px;
  right: 22px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 6;
}

.promo-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.promo-indicator-dot.active {
  width: 24px;
  background: #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.85);
}

/* ==========================================================================
   Modernized Text Announcements Cards
   ========================================================================== */
.announcement-card-modern {
  background: #ffffff;
  border: 1px solid #eef0f3;
  border-radius: 12px;
  padding: 16px 18px;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
  border-left: 4px solid #0f4c81;
}

.announcement-card-modern:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(15, 76, 129, 0.08);
  border-color: #dbe2ea;
}

.announcement-card-modern.cat-notice {
  border-left-color: #0f4c81;
}

.announcement-card-modern.cat-offer {
  border-left-color: #198754;
}

.announcement-card-modern.cat-launch {
  border-left-color: #6f42c1;
}

.announcement-card-modern.cat-alert {
  border-left-color: #dc3545;
}

.announcement-card-modern.cat-event {
  border-left-color: #0dcaf0;
}

@media (max-width: 767.98px) {
  .promo-slide-img {
    min-height: 240px;
    max-height: 260px;
  }
  .promo-slide-overlay {
    padding: 16px;
  }
  .promo-nav-btn {
    opacity: 0.85;
    width: 32px;
    height: 32px;
  }
}

/* ==========================================================================
   Professional Available Courses Section & Card Styles
   ========================================================================== */
.courses-section-wrapper {
  background: #ffffff;
  border-radius: 24px;
  border: 1px solid #eef2f6;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}

.courses-search-box {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 9999px;
  padding: 4px 16px;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
}
.courses-search-box:focus-within {
  background: #ffffff;
  border-color: #2b529a;
  box-shadow: 0 0 0 4px rgba(43, 82, 154, 0.12);
}
.courses-search-box input {
  border: none;
  background: transparent;
  outline: none;
  box-shadow: none;
  font-size: 0.9rem;
  color: #1e293b;
  width: 100%;
  padding: 6px 8px;
}

.category-btn-pro {
  border: 1.5px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  border-radius: 9999px;
  padding: 7px 18px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  white-space: nowrap;
}
.category-btn-pro:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #1e293b;
  transform: translateY(-1px);
}
.category-btn-pro.active {
  background: linear-gradient(135deg, #2b529a 0%, #1e3a6d 100%);
  border-color: #2b529a;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(43, 82, 154, 0.32);
}

/* Modern Pro Course Card with Interactive Mouse Pointer Animations */
.course-card-pro {
  background: #ffffff;
  border: 1.5px solid #eef2f6;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  width: 100%;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              border-color 0.3s ease;
  position: relative;
  cursor: pointer;
}

/* Subtle glowing top accent bar on card hover */
.course-card-pro::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5px;
  background: linear-gradient(90deg, #2b529a 0%, #06b6d4 50%, #f59e0b 100%);
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: 10;
}

.course-card-pro:hover {
  transform: translateY(-10px) scale(1.012);
  border-color: #2b529a;
  box-shadow: 0 24px 48px rgba(43, 82, 154, 0.16), 0 8px 18px rgba(43, 82, 154, 0.08);
}

.course-card-pro:hover::before {
  opacity: 1;
}

/* Thumbnail Wrap & Light Sweep Shimmer */
.course-thumb-wrap {
  position: relative;
  overflow: hidden;
  height: 180px;
  background: #0f172a;
}

/* Diagonal Light Sweep Reflection on mouse over */
.course-thumb-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  left: -130%;
  width: 80%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.38) 50%, transparent 100%);
  transform: skewX(-25deg);
  pointer-events: none;
  z-index: 3;
  transition: none;
}

.course-card-pro:hover .course-thumb-wrap::after {
  left: 150%;
  transition: left 0.85s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.course-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s cubic-bezier(0.25, 0.8, 0.25, 1), filter 0.35s ease;
  cursor: pointer;
  display: block;
}

.course-card-pro:hover .course-thumb-img {
  transform: scale(1.09);
  filter: brightness(1.04);
}

/* Floating Category & Level Badges */
.course-badge-cat {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  color: #ffffff;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 2;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.3s ease;
}

.course-card-pro:hover .course-badge-cat {
  transform: translateY(-3px);
  background: rgba(43, 82, 154, 0.90);
}

.course-badge-level {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  color: #1e293b;
  padding: 4px 11px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  z-index: 2;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.course-card-pro:hover .course-badge-level {
  transform: translateY(-3px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.20);
}

/* Title Hover Transition */
.course-title-link {
  color: #1e293b;
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  transition: color 0.25s ease, transform 0.25s ease;
  cursor: pointer;
  display: block;
}

.course-card-pro:hover .course-title-link {
  color: #2b529a;
}

/* Tutor Avatar Micro-Glow on mouse pointer */
.course-tutor-avatar {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.course-card-pro:hover .course-tutor-avatar {
  transform: scale(1.12);
  box-shadow: 0 0 0 3px rgba(43, 82, 154, 0.30);
}

/* Action button micro-interactions inside course card */
.course-card-pro .btn {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.course-card-pro:hover .btn {
  transform: translateY(-2px);
}

.course-card-pro:hover .btn.btn-primary {
  box-shadow: 0 8px 22px rgba(43, 82, 154, 0.38);
}

.course-card-pro .btn i {
  transition: transform 0.25s ease;
}

.course-card-pro:hover .btn i {
  transform: translateX(3px);
}

/* ==========================================================================
   MOBILE & RESPONSIVE DESIGN SYSTEM (STUDENT & TEACHER PANELS)
   Optimized for smartphones, tablets, and touch-screen viewports
   ========================================================================== */

/* Universal Layout & Touch Adjustments */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* Drawer & Backdrop Responsiveness */
@media (max-width: 991.98px) {
  .moodle-drawer {
    width: min(290px, 86vw) !important;
    max-width: 86vw;
    z-index: 1055 !important;
    box-shadow: 6px 0 28px rgba(0, 0, 0, 0.16) !important;
  }
  
  .moodle-drawer-backdrop {
    z-index: 1050 !important;
  }

  .moodle-content-wrapper {
    margin-left: 0 !important;
    padding-top: 68px;
  }
}

/* Tablets and Mobile Landscape / Portrait (< 768px) */
@media (max-width: 767.98px) {
  /* Header Bar */
  .moodle-header {
    height: 64px !important;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  .moodle-header .moodle-brand {
    font-size: 1.1rem !important;
    gap: 0.35rem;
  }

  .moodle-header .moodle-brand img {
    height: 26px !important;
  }

  .moodle-header .dropdown-menu {
    max-width: calc(100vw - 20px) !important;
    right: 0 !important;
    left: auto !important;
  }

  /* Content Wrapper Padding */
  .moodle-content-wrapper {
    padding-top: 64px !important;
  }

  .moodle-content-wrapper .container,
  .moodle-content-wrapper .container-fluid {
    padding-left: 12px !important;
    padding-right: 12px !important;
    padding-top: 1rem !important;
  }

  /* Page Headers & Action Bars */
  .panel-header-responsive {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.85rem !important;
  }

  .panel-header-responsive h1 {
    font-size: 1.35rem !important;
  }

  .panel-header-responsive .header-actions-group {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
  }

  .panel-header-responsive .header-actions-group .btn,
  .panel-header-responsive .header-actions-group a.btn {
    flex: 1 1 auto !important;
    min-height: 38px;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center;
    font-size: 0.8rem !important;
  }

  /* Card Padding */
  .moodle-card {
    padding: 1.15rem !important;
    border-radius: 14px !important;
  }

  /* Course Row inside Dashboard */
  .moodle-course-item {
    padding: 0.85rem !important;
  }

  .course-actions-responsive {
    width: 100% !important;
    margin-top: 0.75rem !important;
    padding-top: 0.75rem !important;
    border-top: 1px solid #eef2f6 !important;
    justify-content: flex-start !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
  }

  .course-actions-responsive .btn,
  .course-actions-responsive a.btn {
    flex: 1 1 auto !important;
    min-height: 38px;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.82rem !important;
    padding: 0.45rem 0.85rem !important;
  }

  /* Classroom Video Player Responsiveness */
  .video-wrapper,
  .video-container,
  #player-container,
  #yt-player-target {
    min-height: auto !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
  }

  .video-wrapper video,
  .video-container video,
  #player-container iframe,
  #yt-player-target iframe {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 16 / 9 !important;
    object-fit: contain !important;
  }

  /* Classroom Quiz Banner */
  .enter-quiz-banner {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 1.15rem 1.25rem !important;
    gap: 1rem !important;
    text-align: left !important;
  }

  .enter-quiz-banner .enter-quiz-btn,
  .enter-quiz-banner #enter-quiz-banner-btn,
  .enter-quiz-banner a.btn {
    width: 100% !important;
    min-height: 44px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    font-size: 0.9rem !important;
  }

  /* Syllabus Lesson Items */
  .lesson-outline-item {
    padding: 0.75rem 0.85rem !important;
    border-radius: 10px !important;
  }

  /* Detailed Lesson Progress Breakdown */
  .lesson-progress-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
    padding: 0.75rem !important;
  }

  .lesson-progress-row .lesson-progress-title {
    max-width: 100% !important;
    width: 100% !important;
  }

  .lesson-progress-row .lesson-progress-status {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.5rem !important;
  }

  /* Teacher Create Course Collapse Wizard */
  .wizard-steps-header {
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem !important;
    display: flex !important;
    gap: 0.5rem !important;
  }

  .wizard-step-header {
    flex-shrink: 0 !important;
    font-size: 0.82rem !important;
  }

  /* Filter Panel in Teacher Assignments */
  .filter-panel {
    padding: 1rem !important;
    border-radius: 14px !important;
  }

  .filter-btn-group {
    display: flex !important;
    width: 100% !important;
  }

  .filter-btn-group .btn {
    flex: 1 1 0 !important;
    padding: 0.45rem 0.25rem !important;
    font-size: 0.75rem !important;
    text-align: center !important;
    justify-content: center !important;
    display: flex !important;
    align-items: center !important;
  }

  /* KPI Stat Cards (Teacher Assignments & Student Analytics) */
  .kpi-row-responsive > [class*="col-"] {
    margin-bottom: 0.5rem;
  }

  .kpi-card {
    padding: 0.85rem 1rem !important;
    border-radius: 12px !important;
  }

  .kpi-card h3,
  .kpi-card h4 {
    font-size: 1.35rem !important;
  }

  /* Table Panels */
  .table-panel-header {
    padding: 1rem 1.15rem !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
  }

  .table-responsive {
    border-radius: 12px;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #eef2f6;
  }

  .submissions-table td,
  .submissions-table th,
  .custom-table td,
  .custom-table th {
    padding: 0.65rem 0.75rem !important;
    font-size: 0.8rem !important;
  }

  /* Modals on Mobile */
  .modal-dialog {
    margin: 0.5rem !important;
    max-width: calc(100% - 1rem) !important;
  }

  .modal-content {
    border-radius: 16px !important;
  }

  .modal-body {
    padding: 1.15rem !important;
  }

  .modal-footer {
    padding: 0.85rem 1.15rem !important;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .modal-footer .btn {
    flex: 1 1 auto;
    min-height: 42px;
  }
}

/* Extra Small Phones (< 576px: 360px - 575px) */
@media (max-width: 575.98px) {
  /* Brand text on ultra-compact headers */
  .moodle-brand span.brand-text-subtle {
    display: none !important;
  }

  /* Touch targets minimum size */
  .btn, .form-control, .form-select {
    min-height: 40px;
  }

  /* Course Card thumbnail */
  .course-thumb-box-mobile {
    width: 60px !important;
    height: 60px !important;
    min-width: 60px !important;
    object-fit: cover !important;
    border-radius: 8px !important;
  }

  /* Certificate Stepper in Modal */
  .cert-tracker-stepper {
    padding: 0 0.25rem !important;
  }

  .cert-tracker-stepper .rounded-circle {
    width: 30px !important;
    height: 30px !important;
    font-size: 0.75rem !important;
  }

  .cert-tracker-stepper span.fs-9 {
    font-size: 0.68rem !important;
    letter-spacing: -0.02em;
    line-height: 1.2;
  }

  .cert-tracker-stepper small.fs-9 {
    font-size: 0.62rem !important;
  }

  /* Quiz Option Cards */
  .option-card {
    padding: 0.85rem 1rem !important;
    gap: 0.75rem !important;
  }

  .option-badge {
    width: 30px !important;
    height: 30px !important;
    font-size: 0.8rem !important;
  }

  /* Teacher Question Builder */
  .question-card-header {
    padding: 0.85rem 1rem !important;
  }

  .question-card .p-4 {
    padding: 1rem !important;
  }
}


