/* ==========================================================================
   1. LIGHT THEME SCHEME DESIGN TOKENS & ROOT VARIABLES
   ========================================================================== */
:root {
  --body-bg-color: #f8fafc;
  --navbar-bg-color: #ffffff;
  --sidebar-bg-color: #ffffff;
  --panel-card-bg: #ffffff;
  --text-main-dark: #0f172a;
  --text-muted-gray: #64748b;
  --brand-primary-blue: #2563eb;
  --brand-hover-blue: #1d4ed8;
  --accent-purple: #7c3aed;
  --border-light-tint: #e2e8f0;

  --grade-primary-btn-bg: #f0fdf4;
  --grade-primary-border: #4ade80;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--body-bg-color);
  color: var(--text-main-dark);
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   2. BRAND HEADER & NAVBAR OPERATION ELEMENTS
   ========================================================================== */
.main-navbar {
  background-color: var(--navbar-bg-color);
  border-bottom: 1px solid var(--border-light-tint);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.nav-brand-side {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-menu-toggle-btn {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-main-dark);
  cursor: pointer;
}

.platform-logo {
  background: linear-gradient(135deg, var(--brand-primary-blue), var(--accent-purple));
  color: #ffffff;
  font-weight: 900;
  font-size: 18px;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.logo-text-block {
  display: flex;
  flex-direction: column;
}

.instructor-title {
  font-weight: 800;
  font-size: 15px;
  color: var(--text-main-dark);
  line-height: 1.2;
}

.instructor-subtitle {
  font-size: 11px;
  color: var(--text-muted-gray);
  font-weight: 600;
}

.nav-center-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.translation-toggle-btn {
  background-color: #f1f5f9;
  border: 1px solid var(--border-light-tint);
  padding: 8px 14px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-main-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.translation-toggle-btn:hover {
  background-color: #e2e8f0;
}

.nav-user-side {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-auth-action {
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-auth-action.login {
  background-color: var(--brand-primary-blue);
  color: #ffffff;
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.btn-auth-action.login:hover {
  background-color: var(--brand-hover-blue);
}

.user-avatar-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #f1f5f9;
  border: 2px solid var(--border-light-tint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

/* ==========================================================================
   3. APP WRAPPER LAYOUT & PLATFORM SIDEBAR
   ========================================================================== */
.app-layout-wrapper {
  display: flex;
  min-height: calc(100vh - 65px);
  position: relative;
}

.platform-sidebar {
  width: 260px;
  background-color: var(--sidebar-bg-color);
  border-right: 1px solid var(--border-light-tint);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: sticky;
  top: 65px;
  height: calc(100vh - 65px);
  transition: transform 0.3s ease;
}

html[dir="rtl"] .platform-sidebar {
  border-right: none;
  border-left: 1px solid var(--border-light-tint);
}

.sidebar-navigation-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.2s ease;
}

html[dir="rtl"] .sidebar-link {
  text-align: right;
}

.sidebar-link .link-icon {
  font-size: 18px;
}

.sidebar-link .link-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted-gray);
}

.sidebar-link:hover {
  background-color: #f8fafc;
}

.sidebar-link.active {
  background-color: #eff6ff;
}

.sidebar-link.active .link-text {
  color: var(--brand-primary-blue);
}

.sidebar-footer-brand {
  padding-top: 15px;
  border-top: 1px solid var(--border-light-tint);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted-gray);
  line-height: 1.4;
}

/* ==========================================================================
   4. MAIN VIEWPORT CONTAINER AND WORKSPACE CARDS
   ========================================================================== */
.platform-viewport-container {
  flex: 1;
  padding: 32px;
  background-color: var(--body-bg-color);
  max-width: 1200px;
  margin: 0 auto;
}

.viewport-panel-view {
  animation: fadeInFrame 0.4s ease-out;
}

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

.hero-welcome-banner-card {
  background: linear-gradient(135deg, #1e3a8a, #3b82f6);
  border-radius: 16px;
  padding: 40px;
  color: #ffffff;
  margin-bottom: 32px;
  box-shadow: 0 10px 15px -3px rgba(30, 58, 138, 0.1);
}

.hero-welcome-banner-card h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 12px;
}

.hero-welcome-banner-card p {
  font-size: 15px;
  opacity: 0.9;
  max-width: 650px;
  line-height: 1.6;
  margin-bottom: 24px;
}

.btn-hero-explore-trigger {
  background-color: #ffffff;
  color: var(--brand-primary-blue);
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-hero-explore-trigger:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.section-headline-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main-dark);
  margin-bottom: 20px;
}

/* ==========================================================================
   5. ACADEMIC GRADE SELECTION BUTTONS GRID
   ========================================================================== */
.academic-grades-grid-layout {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.grade-selection-button {
  background-color: var(--panel-card-bg);
  border: 1px solid var(--border-light-tint);
  border-radius: 12px;
  padding: 24px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.01);
}

.grade-selection-button .grade-badge-title {
  font-size: 18px;
  font-weight: 900;
  color: var(--text-main-dark);
}

.grade-selection-button .grade-meta-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted-gray);
}

.grade-selection-button.level-primary:hover {
  border-color: #4ade80;
  background-color: #f0fdf4;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px -4px rgba(74, 222, 128, 0.15);
}

.grade-selection-button.level-prep:hover {
  border-color: #a78bfa;
  background-color: #f5f3ff;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px -4px rgba(167, 139, 250, 0.15);
}

/* ==========================================================================
   6. COURSES AND TIMELINE ACCORDION CANVAS COMPONENTS
   ========================================================================== */
.courses-display-grid-canvas {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.course-card-node {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.course-card-node:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px -5px rgba(0,0,0,0.05) !important;
}

.loading-spinner {
  text-align: center;
  padding: 40px;
  font-weight: 700;
  color: var(--text-muted-gray);
  grid-column: 1 / -1;
}

/* Accordion Component */
.accordion-header {
  transition: background-color 0.2s ease;
}

.accordion-header:hover {
  background-color: #f1f5f9 !important;
}

.accordion-arrow-icon {
  font-size: 11px;
  color: var(--text-muted-gray);
  transition: transform 0.2s ease;
}

/* ==========================================================================
   7. FLOATING ACTION WHATSAPP ENGINE HUB
   ========================================================================== */
.whatsapp-floating-action-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: #25d366;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3);
  z-index: 999;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

html[dir="rtl"] .whatsapp-floating-action-widget {
  right: auto;
  left: 24px;
}

.whatsapp-floating-action-widget:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 14px rgba(37, 211, 102, 0.4);
}

/* ==========================================================================
   8. STUDENT GATE & HONORS BADGE ANIMATIONS
   ========================================================================== */
.profile-badge-honors {
  margin-top: 8px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #b45309;
  padding: 8px 12px;
  border-radius: 6px;
  font-weight: 800;
  text-align: center;
  font-size: 14px;
  animation: pulseBadge 2s infinite;
}

/* Custom interactive input fields styling inside the Student Gate Onboarding overlay form */
#studentGateRegistrationForm input:focus {
  border-color: var(--brand-primary-blue) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  background-color: #ffffff;
}

#studentGateRegistrationForm button[type="submit"]:hover {
  background-color: var(--brand-hover-blue) !important;
}

@keyframes pulseBadge {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   9. MEDIA BREAKPOINTS AND MOBILE GRAPHICS MANAGEMENT
   ========================================================================== */
@media (max-width: 768px) {
  .mobile-menu-toggle-btn {
    display: block;
  }

  .platform-sidebar {
    position: fixed;
    top: 65px;
    left: 0;
    transform: translateX(-100%);
    z-index: 1100;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.05);
    background-color: #ffffff;
  }

  html[dir="rtl"] .platform-sidebar {
    left: auto;
    right: 0;
    transform: translateX(100%);
    box-shadow: -4px 0 10px rgba(0, 0, 0, 0.05);
  }

  .platform-sidebar.open {
    transform: translateX(0);
  }

  .platform-viewport-container {
    padding: 16px;
  }

  .hero-welcome-banner-card {
    padding: 24px;
  }

  .hero-welcome-banner-card h1 {
    font-size: 22px;
  }

  .academic-grades-grid-layout {
    grid-template-columns: 1fr;
  }
}