/* ============================================================================
   1. FRONT PAGE (HOME) - NON-LOGGED-IN USERS
   ============================================================================
   Creates a centered welcome card with login form for visitors
   Only visible to: body.pagelayout-frontpage.notloggedin
   ---------------------------------------------------------------------------- */

/* Hide the default Moodle page title on front page */
body.pagelayout-frontpage.notloggedin #page-header h1 {
  display: none !important;
}

/* Set light gray background for entire front page */
body.pagelayout-frontpage.notloggedin,
body.pagelayout-frontpage.notloggedin #page,
body.pagelayout-frontpage.notloggedin #page-content,
body.pagelayout-frontpage.notloggedin #region-main,
body.pagelayout-frontpage.notloggedin #topofscroll {
  background: #f2f4f6 !important;
}

/* Center the welcome card both vertically and horizontally */
body.pagelayout-frontpage.notloggedin #region-main {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 60vh !important;
  padding: 2rem !important;
}

/* --- Welcome Card Container --- */
#maru-welcome-card {
  background: white !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 1rem !important;
  padding: 3rem 2.5rem !important;
  max-width: 500px !important;
  width: 100% !important;
  box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.1),
              0 8px 10px -6px rgb(0 0 0 / 0.1) !important;
  text-align: center !important;
}

/* Main title: "日本工学院オンラインコース" */
#maru-welcome-card h1 {
  font-size: 1.875rem !important;
  font-weight: 600 !important;
  color: #111827 !important;
  margin: 0 0 2rem 0 !important;
  line-height: 1.3 !important;
}

/* Subtitle text: "こちらから受講コースにアクセスしてください" */
#maru-welcome-card .access-text {
  font-size: 1rem !important;
  color: #6b7280 !important;
  margin-bottom: 1.5rem !important;
}

/* Container for Login/Signup buttons (when using fallback mode) */
#maru-welcome-card .button-container {
  display: flex !important;
  gap: 1rem !important;
  justify-content: center !important;
}

/* --- Welcome Card Buttons --- */
#maru-welcome-card .welcome-btn {
  flex: 1 !important;
  max-width: 200px !important;
  background: #2563eb !important; /* Blue background */
  color: white !important;
  border: none !important;
  border-radius: 0.5rem !important;
  padding: 0.875rem 1.5rem !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  text-decoration: none !important;
  display: inline-block !important;
  text-align: center !important;
}

/* Hover effect for buttons - darker blue and lift up */
#maru-welcome-card .welcome-btn:hover {
  background: #1d4ed8 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1) !important;
  color: white !important;
}

/* Active state - remove lift */
#maru-welcome-card .welcome-btn:active {
  transform: translateY(0) !important;
}

/* Secondary button (Signup) - outlined style instead of filled */
#maru-welcome-card .welcome-btn-secondary {
  background: white !important;
  color: #2563eb !important;
  border: 2px solid #2563eb !important;
}

#maru-welcome-card .welcome-btn-secondary:hover {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border-color: #1d4ed8 !important;
}

/* --- Login Form Elements --- */
#maru-login-form {
  width: 100% !important;
  margin-bottom: 1.5rem !important;
}

/* Each form field wrapper (username, password) */
.maru-form-group {
  margin-bottom: 1rem !important;
}

/* Input fields styling (username and password) */
.maru-input {
  width: 100% !important;
  padding: 0.875rem 1rem !important;
  border: 2px solid #e5e7eb !important;
  border-radius: 0.5rem !important;
  font-size: 1rem !important;
  transition: all 0.2s !important;
  background: #f2f4f6 !important;
  box-sizing: border-box !important;
}

/* Input focus state - highlight with blue border and shadow */
.maru-input:focus {
  outline: none !important;
  border-color: #2563eb !important;
  background: white !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

/* Placeholder text color */
.maru-input::placeholder {
  color: #9ca3af !important;
}

/* Login button (submit) - full width */
.maru-login-btn {
  width: 100% !important;
  max-width: 100% !important;
  margin-bottom: 0 !important;
}

/* --- Divider between Login and Signup --- */
/* Creates a horizontal line with "または" (or) in the center */
.maru-divider {
  display: flex !important;
  align-items: center !important;
  text-align: center !important;
  margin: 1.5rem 0 !important;
  color: #9ca3af !important;
  font-size: 0.875rem !important;
}

/* Lines on either side of "または" */
.maru-divider::before,
.maru-divider::after {
  content: '' !important;
  flex: 1 !important;
  border-bottom: 1px solid #e5e7eb !important;
}

.maru-divider span {
  padding: 0 1rem !important;
}

.maru-gateway-intro {
  max-width: 900px;
  margin: 3rem auto 0;
  text-align: center;
  padding: 0 1.5rem;
}

.maru-gateway-intro h1 {
  font-size: 2rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 1rem 0;
  line-height: 1.3;
}

.maru-gateway-intro p {
  font-size: 1.0625rem;
  color: #6b7280;
  line-height: 1.6;
  margin: 0 0 0.5rem 0;
}

.maru-gateway-intro p:last-child {
  margin-bottom: 0;
}

/* Tighten the gap to the tiles since the intro now sits above them */
.maru-gateway-intro + .maru-gateway {
  margin-top: 2rem;
}

@media (max-width: 768px) {
  .maru-gateway-intro h1 {
    font-size: 1.5rem;
  }
  .maru-gateway-intro p {
    font-size: 1rem;
  }
}

/* ============================================================================
   GATEWAY LAYOUT (two big tiles on landing)
   Only used when MARU_LAYOUT = 'gateway' in mycourses.php.
   ============================================================================ */

.maru-gateway {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  max-width: 900px;
  margin: 4rem auto;
}

.maru-gateway-tile {
  display: block;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(0);
}

.maru-gateway-tile:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 32px -8px rgb(0 0 0 / 0.15),
              0 12px 16px -8px rgb(0 0 0 / 0.1);
  border-color: #2563eb;
  text-decoration: none;
  color: inherit;
}

.maru-gateway-image {
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.maru-gateway-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.maru-gateway-tile:hover .maru-gateway-image img {
  transform: scale(1.05);
}

.maru-gateway-tile:hover .maru-gateway-image {
  filter: brightness(1.05);
}

.maru-gateway-initial {
  font-size: 6rem;
  color: white;
  font-weight: 600;
  text-shadow: 0 4px 12px rgb(0 0 0 / 0.15);
}

.maru-gateway-label {
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  color: #111827;
}

.maru-gateway-tile:hover .maru-gateway-label {
  color: #2563eb;
}

/* Distinct gradients for the two tiles. */
.gateway-gradient-1 { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.gateway-gradient-2 { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.gateway-gradient-3 { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.gateway-gradient-4 { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.gateway-gradient-5 { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }

/* Mobile: stack the two tiles vertically. */
@media (max-width: 768px) {
  .maru-gateway {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 2rem auto;
  }
  .maru-gateway-image { height: 180px; }
  .maru-gateway-initial { font-size: 4.5rem; }
  .maru-gateway-label { font-size: 1.25rem; }
}

/* --- Mobile Responsive Adjustments --- */
@media (max-width: 768px) {
  /* Reduce padding on mobile */
  #maru-welcome-card {
    padding: 2rem 1.5rem !important;
  }

  /* Smaller title on mobile */
  #maru-welcome-card h1 {
    font-size: 1.5rem !important;
  }

  /* Stack buttons vertically on mobile */
  #maru-welcome-card .button-container {
    flex-direction: column !important;
  }

  /* Full width buttons on mobile */
  #maru-welcome-card .welcome-btn {
    max-width: 100% !important;
  }

  /* Prevent iOS zoom on input focus by using 16px minimum */
  .maru-input {
    font-size: 16px !important;
  }
}


/* ============================================================================
   2. NAVIGATION MENU CUSTOMIZATION
   ============================================================================
   Hides default Moodle navigation items (Home, Dashboard, My courses)
   These are replaced with custom "Enrol" and "Courses" menu items
   ---------------------------------------------------------------------------- */

/* Hide "Home" menu item (data-key="home") */
.primary-navigation li[data-key="home"],
nav.moremenu li[data-key="home"] {
  display: none !important;
}

/* Hide "Dashboard" menu item (data-key="myhome") */
.primary-navigation li[data-key="myhome"],
nav.moremenu li[data-key="myhome"] {
  display: none !important;
}

/* Hide "My courses" menu item (data-key="mycourses") */
.primary-navigation li[data-key="mycourses"],
nav.moremenu li[data-key="mycourses"] {
  display: none !important;
}

/* Additional fallback: Hide any links still pointing to /my/courses.php */
.primary-navigation .nav-link[href*="/my/courses.php"],
nav.moremenu .nav-link[href*="/my/courses.php"],
.primary-navigation li:has(.nav-link[href*="/my/courses.php"]),
nav.moremenu li:has(.nav-link[href*="/my/courses.php"]) {
  display: none !important;
}


/* ============================================================================
   3. GLOBAL LAYOUT ADJUSTMENTS
   ============================================================================
   Removes Moodle's default width constraints for full-width layouts
   ---------------------------------------------------------------------------- */

/* Force full-width layout across all pages */
.main-inner,
.header-maxwidth,
#region-main-box,
#page-wrapper {
  max-width: none !important;
  width: 100% !important;
}


/* ============================================================================
   4. CUSTOM COURSES PAGE (/mycourses.php)
   ============================================================================
   Modern, image-focused design for the custom course display page
   Only applies to pages containing #maru-courses-container
   ---------------------------------------------------------------------------- */

/* --- Page Background (Light gray) --- */
body:has(#maru-courses-container),
body:has(#maru-courses-container) #page,
body:has(#maru-courses-container) #page-content,
body:has(#maru-courses-container) #region-main,
body:has(#maru-courses-container) .main-inner,
body:has(#maru-courses-container) #topofscroll {
  background: #f9fafb !important;
}

/* Transparent background for main inner container */
body:has(#maru-courses-container) #topofscroll.main-inner {
  background-color: transparent !important;
  padding: 0 !important;
}

/* --- Main Container --- */
#maru-courses-container {
  max-width: 1400px !important;
  margin: 2rem auto !important;
  padding: 0 2rem !important;
  width: 100% !important;
}

/* --- Main Tab Navigation (コース / 補足資料 / 講師資料) --- */
.maru-main-tabs {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

/* Individual main tab pill */
.maru-tab {
  padding: 0.625rem 1.5rem;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 9999px; /* Fully rounded pill shape */
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9375rem;
  color: #6b7280; /* Gray text when inactive */
  transition: all 0.2s;
  text-decoration: none; /* needed because the enrol pill is an <a> */
  display: inline-block;
}

/* Hover state for main tabs */
.maru-tab:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

/* Active main tab - blue background */
.maru-tab.active {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

/* Teacher resources pill (講師資料) — indigo, staff-only area */
.maru-tab[data-area="maru-teacher"] {
  background: #eef2ff;
  color: #4338ca;
  border-color: #c7d2fe;
  font-weight: 600;
}

.maru-tab[data-area="maru-teacher"]:hover {
  background: #e0e7ff;
  border-color: #a5b4fc;
}

.maru-tab[data-area="maru-teacher"].active {
  background: #4f46e5;
  color: white;
  border-color: #4f46e5;
}

/* Enrolment pill (コース登録) — light pink, pushed to far right */
.maru-tab-enroll {
  background: #fce7f3 !important;
  color: #be185d !important;
  border-color: #fbcfe8 !important;
  font-weight: 600 !important;
  margin-left: auto !important; /* Pushes button to the right */
}

.maru-tab-enroll:hover {
  background: #fbcfe8 !important;
  color: #9f1239 !important;
  border-color: #f9a8d4 !important;
}

.maru-tab-enroll.active {
  background: #ec4899 !important;
  color: white !important;
  border-color: #ec4899 !important;
}

/* --- Sub Tab Navigation (Category filters for Additional Materials) --- */
.maru-sub-tabs {
  display: none; /* Hidden by default */
  gap: 0.5rem;
  padding: 0 0 1.5rem 0;
  flex-wrap: wrap;
}

/* Show sub-tabs when a parent tab with sub-categories is selected */
.maru-sub-tabs.active {
  display: flex;
}

/* Individual sub-tab button */
.maru-sub-tab {
  padding: 0.5rem 1rem;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem; /* Slightly rounded corners */
  cursor: pointer;
  font-size: 0.875rem;
  color: #6b7280;
  transition: all 0.2s;
}

/* Hover state for sub-tabs */
.maru-sub-tab:hover {
  background: #e5e7eb;
  color: #111827;
}

/* Active sub-tab - blue background */
.maru-sub-tab.active {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

/* --- Section Heading (e.g., "Courses", category names) --- */
.maru-section-heading {
  font-size: 1.875rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 1.5rem;
}

/* --- Course Grid Layout --- */
/* Responsive grid that adapts to screen size */
.maru-course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* ============================================================================
   VISUAL CARDS (Main "Courses" category - コース)
   ============================================================================
   Nike-style product cards with:
   - Top 50%: Course image or gradient with initial
   - Bottom 50%: Title, description, and "Start" button
   ---------------------------------------------------------------------------- */

.maru-card.visual-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(0);
  display: flex;
  flex-direction: column;
  height: 280px; /* Fixed height: 140px image + 140px content */
  position: relative;
}

/* Hover effect - lift card up and add shadow */
.maru-card.visual-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1),
              0 8px 10px -6px rgb(0 0 0 / 0.1);
  border-color: #2563eb; /* Blue border on hover */
}

/* --- Image Container (Top 50%) --- */
.maru-card.visual-card .maru-card-image {
  width: 100%;
  height: 50%; /* Exactly half the card */
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* Default gradient */
  position: relative;
  margin: 0;
  padding: 0;
}

/* Course image - covers entire top half */
.maru-card.visual-card .maru-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Crop to fill space */
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
}

/* Slight zoom on hover */
.maru-card.visual-card:hover .maru-card-image img {
  transform: scale(1.05);
}

/* --- Fallback when no course image --- */
/* Shows first letter of course title on gradient background */
.maru-card.visual-card .maru-card-image.no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: white;
  font-weight: 600;
  text-shadow: 0 2px 4px rgb(0 0 0 / 0.1);
}

/* Five different gradient colors for variety */
.maru-card-image.no-image.gradient-1 {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* Purple */
}

.maru-card-image.no-image.gradient-2 {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); /* Pink */
}

.maru-card-image.no-image.gradient-3 {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); /* Blue */
}

.maru-card-image.no-image.gradient-4 {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); /* Green */
}

.maru-card-image.no-image.gradient-5 {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); /* Orange */
}

/* --- Content Area (Bottom 50%) --- */
.maru-card.visual-card .maru-card-content {
  padding: 1.5rem;
  height: 50%; /* Bottom half */
  display: flex;
  flex-direction: column;
  position: relative;
}

/* --- Course Title --- */
.maru-card.visual-card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
  line-height: 1.4;
}

/* Title turns blue on hover */
.maru-card.visual-card:hover h3 {
  color: #2563eb;
}

/* --- Course Description --- */
/* Truncated to 3 lines with ellipsis */
.maru-card.visual-card .maru-card-description {
  margin: 0 0 1rem 0;
  font-size: 0.875rem;
  color: #6b7280 !important;
  line-height: 1.5;
  flex-grow: 1; /* Takes up remaining space */
  display: -webkit-box;
  -webkit-line-clamp: 3; /* Limit to 3 lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Start Button --- */
/* Positioned at bottom right of content area */
.maru-card.visual-card .maru-start-button {
  align-self: flex-end;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 0.5rem;
  padding: 0.625rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  pointer-events: none; /* Card itself is clickable, button is just visual */
}

/* Button darkens on card hover */
.maru-card.visual-card:hover .maru-start-button {
  background: #1d4ed8;
  transform: translateY(-1px);
}

/* --- Link wrapper (makes entire card clickable) --- */
.maru-card.visual-card > a {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

/* ============================================================================
   SIMPLE CARDS (Additional Materials / Teacher Resources and other categories)
   ============================================================================
   Text-based cards without images - simpler design
   ---------------------------------------------------------------------------- */

.maru-card.simple-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(0);
}

/* Lighter hover effect than visual cards */
.maru-card.simple-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1),
              0 8px 10px -6px rgb(0 0 0 / 0.1);
  border-color: #d1d5db; /* Gray border on hover */
}

/* Link wrapper */
.maru-card.simple-card a {
  text-decoration: none;
  color: inherit;
  display: block;
  padding: 1.5rem;
}

/* Course title in simple card */
.maru-card.simple-card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
  line-height: 1.4;
}

/* Course description in simple card (no truncation) */
.maru-card.simple-card .maru-card-description {
  margin: 0;
  font-size: 0.9375rem;
  color: #6b7280 !important;
  line-height: 1.5;
}

/* --- Empty State Message --- */
/* Shown when no courses exist in a category */
.maru-empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #9ca3af;
  font-size: 0.9375rem;
}

/* --- Mobile Responsive Adjustments --- */
@media (max-width: 768px) {
  /* Reduce padding on mobile */
  #maru-courses-container {
    padding: 0 1rem !important;
  }

  /* Single column grid on mobile */
  .maru-course-grid {
    grid-template-columns: 1fr;
  }

  /* Slightly shorter cards on mobile */
  .maru-card.visual-card {
    height: 260px;
  }
}


/* ============================================================================
   5. DASHBOARD (ENROL PAGE) STYLING (/my/)
   ============================================================================
   Clean styling for the Dashboard page with coupon enrollment block
   ---------------------------------------------------------------------------- */

/* --- Hide Dashboard Page Title --- */
body.pagelayout-mydashboard #page-header h1 {
  display: none !important;
}

/* --- Dashboard Page Background (Light gray) --- */
body.pagelayout-mydashboard,
body.pagelayout-mydashboard #page,
body.pagelayout-mydashboard #page-content,
body.pagelayout-mydashboard #region-main,
body.pagelayout-mydashboard .main-inner {
  background: #f9fafb !important;
}

/* --- Dashboard Content Container --- */
body.pagelayout-mydashboard #region-main-box {
  max-width: 1400px !important;
  margin: 0 auto !important;
  padding: 2rem !important;
}

/* --- Dashboard Page Header --- */
body.pagelayout-mydashboard #page-header {
  background: transparent !important;
  border: none !important;
  margin-bottom: 2rem;
}

/* --- Default Blocks (NO CARD STYLING) --- */
/* Remove styling from all blocks except coupon */
body.pagelayout-mydashboard .block {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  margin-bottom: 1.5rem !important;
}

/* ============================================================================
   COUPON BLOCK SPECIFIC STYLING
   ============================================================================
   Special styling for the coupon enrollment block
   Centered, clean design with custom form styling
   ---------------------------------------------------------------------------- */

body.pagelayout-mydashboard .block_coupon {
  background: white !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 0.75rem !important;
  padding: 2rem !important;
  width: 50% !important; /* Half width on desktop */
  margin: 2rem auto !important; /* Centered */
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1) !important;
}

/* Hide "Coupon" heading */
body.pagelayout-mydashboard .block_coupon .card-title {
  display: none !important;
}

/* Remove all padding and borders from wrapper divs */
body.pagelayout-mydashboard .block_coupon .card-body {
  padding: 0 !important;
  text-align: center !important;
  border: none !important;
}

body.pagelayout-mydashboard .block_coupon .card-text {
  border: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.pagelayout-mydashboard .block_coupon .content {
  border: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.pagelayout-mydashboard .block_coupon .footer {
  border: none !important;
  border-top: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Center the form */
body.pagelayout-mydashboard .block_coupon form {
  border: none !important;
  margin: 0 auto !important;
  text-align: center !important;
}

/* --- Coupon Form Table --- */
/* Remove all borders from table */
body.pagelayout-mydashboard .block_coupon table {
  width: 100%;
  border: none !important;
  border-collapse: collapse !important;
  margin: 0 auto !important;
}

/* Remove all borders from table cells */
body.pagelayout-mydashboard .block_coupon table td {
  border: none !important;
  border-top: none !important;
  border-bottom: none !important;
  border-left: none !important;
  border-right: none !important;
  padding: 0.5rem 0 !important;
  text-align: center !important;
}

/* Remove borders from table rows */
body.pagelayout-mydashboard .block_coupon table tr,
body.pagelayout-mydashboard .block_coupon table tbody {
  border: none !important;
}

/* --- Form Label Text --- */
/* "Please enter your coupon code here:" */
body.pagelayout-mydashboard .block_coupon table tr:first-child td {
  font-size: 1.125rem !important;
  font-weight: 500 !important;
  color: #111827 !important;
  padding-bottom: 1rem !important;
  text-align: center !important;
  border: none !important;
}

/* --- Coupon Input Field --- */
body.pagelayout-mydashboard .block_coupon input[type="text"] {
  width: 100% !important;
  border: 2px solid #d1d5db !important;
  border-radius: 0.5rem !important;
  padding: 0.75rem 1rem !important;
  font-size: 1rem !important;
  transition: all 0.2s !important;
  background: #f9fafb !important;
  text-align: center !important;
}

/* Input focus state - blue border and shadow */
body.pagelayout-mydashboard .block_coupon input[type="text"]:focus {
  outline: none !important;
  border-color: #2563eb !important;
  background: white !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

/* --- Submit Button --- */
body.pagelayout-mydashboard .block_coupon input[type="submit"] {
  width: 100% !important;
  background: #2563eb !important;
  color: white !important;
  border: none !important;
  border-radius: 0.5rem !important;
  padding: 0.75rem 1.5rem !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  margin-top: 0.5rem !important;
  display: block !important;
}

/* Submit button hover effect */
body.pagelayout-mydashboard .block_coupon input[type="submit"]:hover {
  background: #1d4ed8 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1) !important;
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
  /* Reduce padding on mobile */
  body.pagelayout-mydashboard #region-main-box {
    padding: 1rem !important;
  }

  /* Coupon block takes up 90% of width on mobile */
  body.pagelayout-mydashboard .block_coupon {
    width: 90% !important;
    padding: 1.5rem !important;
  }

  /* Smaller label text on mobile */
  body.pagelayout-mydashboard .block_coupon table tr:first-child td {
    font-size: 1rem !important;
  }
}


/* ============================================================================
   6. MISCELLANEOUS UI TWEAKS
   ============================================================================ */

/* Hide the entire footer popover container ("Moodle ?" button) */
[data-region="footer-container-popover"] {
  display: none !important;
}

/* Hide the bell notifications icon for non-admins in the navbar */
body:not(:has([data-key="siteadminnode"]))
.popover-region-toggle[data-region="popover-region-toggle"] {
  display: none !important;
}

/* Keep admin icon aligned properly */
body:has([data-key="siteadminnode"])
.popover-region-toggle[data-region="popover-region-toggle"] {
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
}

/* Hide all activity icon containers in course overview */
.activity-icon.activityiconcontainer.courseicon {
  display: none !important;
}

/* Show it ONLY for users who can see Settings (admins/teachers) */
/*
.secondary-navigation:has([data-key="editsettings"]) nav.moremenu.navigation {
    display: block !important;
}
*/

/* Hide breadcrumb navigation */
#page-navbar {
  display: none !important;
}

/* Hide page header (breadcrumb + activity title) */
#page-header {
  display: none !important;
}

/* Hide SCORM "Review mode" header */
#scormtop {
  display: none !important;
}

/* Plain black text by default */
.activity-item .aalink {
  color: #000 !important;
  text-decoration: none !important;
}

/* Slightly different on hover (gray or underline) */
.activity-item .aalink:hover {
  color: #333 !important;
  /* OR add underline on hover: */
  /* text-decoration: underline !important; */
}

/* Reduce the width of the course overview list */
.section-item {
  width: 60%;
  margin: auto;
}

/* ============================================================================
   LANGUAGE MENU STYLING - Right side with icon
   ============================================================================
   NOTE: This whole block is currently commented out / disabled.
   ---------------------------------------------------------------------------- */

/* Remove border and background from language menu container
.langmenu {
    border: none !important;
    background: transparent !important;
}

.langmenu .dropdown {
    border: none !important;
}

/* Style the language toggle button
#lang-menu-toggle {
    border: none !important;
    background: transparent !important;
    color: #212529 !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 0.9375rem !important;
    font-weight: 400 !important;
    display: flex !important;
    align-items: center !important;
}

#lang-menu-toggle:hover {
    background: transparent !important;
    color: #0d6efd !important;
}

/* Fix the Font Awesome icon using ::before
#lang-menu-toggle i.fa-language::before {
    content: "\f1ab" !important;
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    font-size: 1.125rem !important;
    margin-right: 0.25rem !important;
    display: inline-block !important;
}

/* Remove caret
#lang-menu-toggle .caret {
    display: none !important;
}



*/

/* Hide the Navigation block on the dashboard */
[data-block="navigation"] {
  display: none !important;
}

/* Get rid of the "Jump to activity" menu at the bottom of the scorm file */
.activity-navigation {
  display: none;
}

/* Reserve scrollbar space so the layout doesn't shift between tabs */
html {
  scrollbar-gutter: stable;
}