/* ==========================================================================
   DESIGN SYSTEM & CUSTOM PROPERTIES
   ========================================================================== */
:root {
  /* Color Palette (HSL Tailored) */
  --bg-dark: hsl(224, 32%, 8%);
  --bg-darker: hsl(224, 32%, 5%);
  --bg-card: rgba(13, 20, 38, 0.6);
  --bg-nav: rgba(9, 13, 26, 0.75);

  --primary-hue: 250;
  --primary: hsl(var(--primary-hue), 84%, 63%);
  --primary-light: hsl(var(--primary-hue), 84%, 73%);
  --primary-glow: rgba(124, 58, 237, 0.35);

  --accent-cyan: hsl(190, 90%, 50%);
  --accent-cyan-glow: rgba(6, 182, 212, 0.3);
  --accent-purple: hsl(280, 85%, 60%);

  --badge-today-bg: rgba(16, 185, 129, 0.15);
  --badge-today-text: hsl(150, 84%, 60%);
  --badge-tomorrow-bg: rgba(59, 130, 246, 0.15);
  --badge-tomorrow-text: hsl(210, 95%, 70%);

  --text-white: hsl(210, 40%, 98%);
  --text-light: hsl(210, 25%, 88%);
  --text-gray: hsl(215, 20%, 72%);
  --text-muted: hsl(215, 15%, 52%);
  --chat-name-student: hsl(190, 90%, 65%);
  --chat-name-admin: hsl(25, 95%, 60%);

  --border-light: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(124, 58, 237, 0.3);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.45);

  --transition-smooth: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-fast: all 0.15s ease;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
}

/* System-based Light Mode overrides */
@media (prefers-color-scheme: light) {
  :root {
    --bg-dark: hsl(220, 25%, 97%);
    --bg-darker: hsl(220, 25%, 92%);
    --bg-card: rgba(255, 255, 255, 0.7);
    --bg-nav: rgba(245, 247, 250, 0.85);

    --accent-cyan: hsl(190, 95%, 35%);
    --accent-cyan-glow: rgba(6, 182, 212, 0.2);

    --badge-today-bg: rgba(16, 185, 129, 0.15);
    --badge-today-text: hsl(150, 84%, 30%);
    --badge-tomorrow-bg: rgba(59, 130, 246, 0.15);
    --badge-tomorrow-text: hsl(220, 90%, 45%);

    --text-white: hsl(224, 32%, 12%);
    --text-light: hsl(224, 25%, 18%);
    --text-gray: hsl(224, 15%, 38%);
    --text-muted: hsl(224, 10%, 54%);
    --chat-name-student: hsl(200, 85%, 35%);
    --chat-name-admin: hsl(25, 90%, 40%);

    --border-light: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(124, 58, 237, 0.25);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.06);
  }

  .glow-btn-outline {
    color: var(--text-white);
  }

  .modal-close {
    color: var(--text-muted);
  }

  .modal-close:hover {
    color: var(--text-white);
  }

  .dashboard-table th {
    color: var(--text-white);
  }

  /* Make sure highlights card icons look outstanding in light mode */
  .highlight-card i {
    color: var(--primary);
  }
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  color: var(--text-light);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
  background: hsl(var(--primary-hue), 25%, 25%);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Interactive Canvas Background Layer */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

#app-root {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Push all page content below the fixed navbar */
#app {
  padding-top: 72px;
  flex: 1;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-fast);
}

button,
input,
textarea,
select {
  font-family: inherit;
}

/* ==========================================================================
   UTILITY & GLASS COMPONENTS
   ========================================================================== */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  box-shadow: var(--glass-shadow);
  transition: var(--transition-smooth);
}

.glass-panel:hover {
  border-color: var(--border-hover);
  box-shadow: 0 12px 40px 0 rgba(124, 58, 237, 0.15);
}

.glow-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  vertical-align: middle;
  line-height: 1;
  gap: 8px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--primary));
  color: var(--text-white);
  border: none;
  border-radius: 8px;
  padding: 13px 24px 11px;
  font-weight: 600;
  font-family: var(--font-display);
  cursor: pointer;
  box-shadow: 0 4px 15px var(--accent-cyan-glow);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.glow-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  width: 200%;
  height: 100%;
  background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0) 100%);
  transform: skewX(-25deg);
  transition: 0.75s;
  opacity: 0;
}

.glow-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(6, 182, 212, 0.5);
}

.glow-btn:hover::after {
  left: 125%;
  opacity: 1;
}

.glow-btn-cyan {
  background: linear-gradient(135deg, var(--accent-cyan), var(--primary));
  box-shadow: 0 4px 15px var(--accent-cyan-glow);
}

.glow-btn-cyan:hover {
  box-shadow: 0 8px 25px rgba(6, 182, 212, 0.5);
}

.glow-btn-outline {
  background: transparent;
  color: var(--text-white);
  border: 1px solid var(--border-light);
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  vertical-align: middle;
  line-height: 1;
}

.glow-btn-outline:hover {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
  box-shadow: 0 0 15px var(--accent-cyan-glow);
}

.section-title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 3rem;
  background: linear-gradient(to right, var(--text-white), var(--primary-light), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: linear-gradient(to right, var(--primary), var(--accent-cyan));
  border-radius: 2px;
}

/* Animations */
.fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

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

/* Word Rotator Animation */
.securing-wrapper {
  white-space: nowrap;
}

.word-rotator-wrap {
  display: inline-block;
  perspective: 400px;
  text-align: left;
  vertical-align: bottom;
  white-space: nowrap;
  position: relative;
}

@media (max-width: 1024px) {
  .word-rotator-wrap {
    text-align: center;
    display: inline;
  }
}

.rotating-word {
  display: inline-block;
  background: linear-gradient(to right, var(--accent-cyan), var(--primary), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 15px rgba(124, 58, 237, 0.15));
  transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(0.55, 0.055, 0.675, 0.19), opacity 0.4s ease;
  transform-origin: center bottom;
  white-space: nowrap;
  position: relative;
  vertical-align: bottom;
}

.rotating-word.flip-out {
  transform: rotateX(-90deg) translateY(-10px);
  opacity: 0;
}

.rotating-word.flip-in {
  animation: flipInWord 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes flipInWord {
  0% {
    transform: rotateX(90deg) translateY(10px);
    opacity: 0;
  }

  100% {
    transform: rotateX(0deg) translateY(0);
    opacity: 1;
  }
}

/* ==========================================================================
   NAVIGATION BAR
   ========================================================================== */
.glass-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: var(--bg-nav);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition-smooth);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 1.5px;
  color: var(--text-white);
}

.logo-icon {
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 8px var(--primary-glow));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-gray);
  position: relative;
  padding: 6px 0;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-white);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(to right, var(--primary), var(--accent-cyan));
  transition: var(--transition-smooth);
  border-radius: 2px;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

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

.user-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.85rem;
  color: var(--text-gray);
}

.user-tag i {
  color: var(--accent-cyan);
}

.logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  vertical-align: middle;
  line-height: 1;
  gap: 8px;
  background: transparent;
  color: hsl(0, 85%, 65%);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 8px;
  padding: 9px 16px 7px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgb(239, 68, 68);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.2);
}

.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
  flex-direction: column;
  gap: 6px;
  width: 40px;
  height: 40px;
  justify-content: center;
  align-items: center;
}

.mobile-menu-toggle .bar {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--text-white);
  border-radius: 2px;
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s ease;
}

/* Hamburger to X Animation */
.mobile-menu-toggle.open .bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.mobile-menu-toggle.open .bar:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.open .bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Mobile actions hidden on desktop */
.mobile-only-action {
  display: none;
}

/* ==========================================================================
   PAGE LAYOUT & CONTAINER
   ========================================================================== */
#app {
  margin-top: 80px;
  flex: 1;
  min-height: calc(100vh - 80px - 280px);
}

/* ==========================================================================
   HOME / LANDING VIEW
   ========================================================================== */
.hero-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px;
  gap: 48px;
  min-height: calc(100vh - 80px);
}

.hero-content {
  flex: 1.2;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(124, 58, 237, 0.3);
  padding: 6px 16px;
  border-radius: 30px;
  color: var(--primary-light);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.badge-tag i {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.2);
    opacity: 0.6;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.hero-content h1 {
  font-family: var(--font-display);
  font-size: 4rem;
  line-height: 1.1;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 24px;
}

.hero-content h1 .rotating-word {
  background: linear-gradient(to right, var(--accent-cyan), var(--primary), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 15px rgba(124, 58, 237, 0.15));
}

.hero-content p {
  font-size: 1.15rem;
  color: var(--text-gray);
  margin-bottom: 40px;
  max-width: 580px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-graphics {
  flex: 0.8;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.graphic-orb {
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  filter: blur(60px);
  opacity: 0.3;
  position: absolute;
  animation: floatOrb 8s ease-in-out infinite alternate;
}

.graphic-card {
  width: 100%;
  max-width: 340px;
  padding: 32px;
  position: relative;
  z-index: 2;
  text-align: center;
  animation: floatCard 6s ease-in-out infinite;
}

.graphic-icon {
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: var(--accent-cyan);
  margin: 0 auto 24px;
  box-shadow: 0 0 20px var(--accent-cyan-glow);
}

.graphic-card h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 12px;
  color: var(--text-white);
}

@keyframes floatOrb {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(30px, -20px) scale(1.1);
  }
}

@keyframes floatCard {
  0% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-15px);
  }

  100% {
    transform: translateY(0);
  }
}

/* Stats Section */
.stats-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.stat-item {
  padding: 30px;
  text-align: center;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-white), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  margin-bottom: 10px;
}

.stat-label {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

/* Highlights Section */
.highlights-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 100px 24px;
}

.highlights-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.highlight-card {
  padding: 40px 30px;
}

.highlight-card i {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 24px;
  display: block;
}

.highlight-card h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--text-white);
  margin-bottom: 16px;
}

.highlight-card p {
  color: var(--text-gray);
  font-size: 0.95rem;
}

/* Testimonials Slider */
.testimonials-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 100px 24px;
}

.testimonial-container {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  padding: 40px;
  min-height: 280px;
}

.testimonial-slide {
  text-align: center;
  transition: var(--transition-smooth);
}

.quote-icon {
  font-size: 3rem;
  color: rgba(124, 58, 237, 0.15);
  margin-bottom: 20px;
}

.testimonial-text {
  font-size: 1.25rem;
  color: var(--text-light);
  font-style: italic;
  line-height: 1.7;
  margin-bottom: 24px;
}

.testimonial-author {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-white);
}

.testimonial-role {
  font-size: 0.85rem;
  color: var(--accent-cyan);
  text-transform: uppercase;
  margin-top: 4px;
}

.slider-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 30px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-light);
  cursor: pointer;
  transition: var(--transition-fast);
}

.dot.active {
  background: var(--primary);
  width: 24px;
  border-radius: 5px;
}

/* ==========================================================================
   COURSES VIEW
   ========================================================================== */
.courses-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px 100px;
}

.filter-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  vertical-align: middle;
  line-height: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  padding: 11px 20px 9px;
  border-radius: 30px;
  color: var(--text-gray);
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition-fast);
}

.filter-btn:hover,
.filter-btn.active {
  background: linear-gradient(135deg, var(--accent-cyan), var(--primary));
  color: var(--text-white);
  border-color: var(--accent-cyan);
  box-shadow: 0 4px 15px var(--accent-cyan-glow);
}

.courses-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.course-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.course-header {
  padding: 30px 30px 20px;
  border-bottom: 1px solid var(--border-light);
}

.course-cat {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--accent-cyan);
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.course-header h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--text-white);
  line-height: 1.3;
}

.course-body {
  padding: 24px 30px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.course-body p {
  color: var(--text-gray);
  font-size: 0.95rem;
  margin-bottom: 24px;
  flex-grow: 1;
}

.course-details {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  padding: 16px 0;
  margin-bottom: 24px;
  font-size: 0.85rem;
}

.detail-item i {
  color: var(--primary-light);
  margin-right: 6px;
}

.detail-item span {
  font-weight: 500;
  color: var(--text-white);
}

.course-footer {
  padding: 0 30px 30px;
  display: flex;
  gap: 12px;
}

.course-footer button {
  flex: 1;
  padding: 10px;
  font-size: 0.85rem;
}

/* Syllabus Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 6, 12, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 40px;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-box {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  color: var(--text-gray);
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.modal-close:hover {
  color: var(--text-white);
}

.modal-box h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--text-white);
  margin-bottom: 12px;
}

.modal-box p {
  color: var(--text-gray);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.modal-list-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--accent-cyan);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.syllabus-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 30px;
}

.syllabus-list li {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

.syllabus-list li i {
  color: var(--accent-cyan);
}

/* ==========================================================================
   AUTH PORTAL VIEWS
   ========================================================================== */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 80px - 280px);
  padding: 40px 24px;
}

.auth-card {
  width: 100%;
  max-width: 450px;
  padding: 40px;
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header i {
  font-size: 2.5rem;
  color: var(--accent-cyan);
  margin-bottom: 16px;
}

.auth-header h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--text-white);
}

.auth-header p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-container {
  position: relative;
}

.input-container i,
.input-container svg.svg-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: var(--transition-smooth);
  display: block;
}

.input-container:focus-within svg.svg-icon {
  color: var(--accent-cyan);
}

.auth-header svg.svg-icon-logo {
  color: var(--accent-cyan);
  margin-bottom: 16px;
  filter: drop-shadow(0 0 10px var(--accent-cyan-glow));
}

.input-container input,
.input-container textarea,
.input-container select {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 12px 16px 12px 44px;
  color: var(--text-white);
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.input-container input:focus,
.input-container textarea:focus,
.input-container select:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}

.auth-toggle {
  text-align: center;
  margin-top: 24px;
  font-size: 0.9rem;
  color: var(--text-gray);
}

.auth-toggle button {
  background: transparent;
  border: none;
  color: var(--accent-cyan);
  font-weight: 600;
  cursor: pointer;
  margin-left: 4px;
}

.auth-toggle button:hover {
  text-decoration: underline;
}

.alert-message {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: hsl(0, 85%, 70%);
}

.alert-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: hsl(150, 85%, 70%);
}

/* ==========================================================================
   CONTACT / INQUIRY VIEW
   ========================================================================== */
.contact-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 24px 100px;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 48px;
}

.contact-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
}

.contact-info-panel {
  padding: 40px;
  height: 100%;
}

.fa-location-dot {
  width: 44px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.contact-info-panel h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--text-white);
  margin-bottom: 16px;
}

.contact-info-panel p {
  color: var(--text-gray);
  margin-bottom: 32px;
}

.info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.info-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.info-item-icon {
  width: 44px;
  height: 44px;
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-light);
  font-size: 1.1rem;
}

.info-item-content h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text-white);
  margin-bottom: 4px;
}

.info-item-content p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-gray);
}

.contact-form-panel {
  padding: 40px;
}

.contact-form-panel h3 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--text-white);
  margin-bottom: 24px;
}

.contact-form-panel form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-form-panel textarea {
  min-height: 120px;
  resize: vertical;
}

/* ==========================================================================
   PORTAL DASHBOARD VIEW
   ========================================================================== */
.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 100px;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  flex-wrap: wrap;
  gap: 20px;
}

.dashboard-welcome h2 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--text-white);
}

.dashboard-welcome h2 span {
  background: linear-gradient(to right, var(--accent-cyan), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.dashboard-welcome p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 4px;
}

.dashboard-role-badge {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--accent-cyan);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.dashboard-role-badge.admin {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: hsl(0, 85%, 70%);
}

.dashboard-role-badge.teacher {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.3);
  color: var(--primary-light);
}

/* Dashboard Cards Grid */
.dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

.dash-stat-card {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.dash-stat-icon {
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--primary-light);
}

.dash-stat-card:nth-child(2) .dash-stat-icon {
  color: var(--accent-cyan);
}

.dash-stat-card:nth-child(3) .dash-stat-icon {
  color: var(--accent-purple);
}

.dash-stat-info h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.dash-stat-info p {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-white);
  line-height: 1.2;
  margin-top: 4px;
}

/* Primary Dashboard Content Grid */
.dashboard-layout {
  display: grid;
  grid-template-columns: 1.8fr 1.2fr;
  gap: 32px;
}

.dashboard-main-col {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.dashboard-side-col {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.dashboard-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.dashboard-panel-header h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text-white);
}

.dashboard-panel {
  padding: 30px;
}

/* Progress Rings Container */
.student-progress-row {
  display: flex;
  gap: 24px;
  justify-content: space-around;
  margin-bottom: 12px;
}

.progress-dial-box {
  text-align: center;
}

.progress-ring-container {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 12px;
}

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

.progress-dial-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-white);
}

.progress-dial-label {
  font-size: 0.85rem;
  color: var(--text-gray);
  font-weight: 500;
}

/* Test results list */
.results-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 14px 20px;
}

.result-meta h4 {
  font-size: 0.95rem;
  color: var(--text-white);
}

.result-meta span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.result-score {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--accent-cyan);
}

.result-score.pass {
  color: var(--accent-cyan);
}

.result-remarks {
  font-size: 0.8rem;
  color: var(--text-gray);
  margin-top: 4px;
}

/* Study Materials Downloader */
.materials-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.material-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 14px 20px;
}

.material-icon {
  font-size: 1.5rem;
  color: var(--primary-light);
}

.material-details {
  flex-grow: 1;
  margin-left: 16px;
}

.material-details h4 {
  font-size: 0.95rem;
  color: var(--text-white);
}

.material-details p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.download-link {
  color: var(--accent-cyan);
  font-size: 1.1rem;
  transition: var(--transition-fast);
}

.download-link:hover {
  color: var(--text-white);
  transform: scale(1.1);
}

/* Announcements List */
.announcements-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.announcement-row {
  border-left: 3px solid var(--primary);
  background: rgba(255, 255, 255, 0.01);
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  position: relative;
}

.announcement-row.course-bound {
  border-left-color: var(--accent-cyan);
}

.announcement-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.announcement-header h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text-white);
}

.announcement-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.announcement-row p {
  font-size: 0.85rem;
  color: var(--text-gray);
  line-height: 1.5;
}

.announcement-tag {
  display: inline-block;
  font-size: 0.7rem;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--accent-cyan);
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 8px;
  font-weight: 500;
}

.delete-action-btn {
  background: transparent;
  border: none;
  color: hsl(0, 85%, 65%);
  cursor: pointer;
  opacity: 0.5;
  transition: var(--transition-fast);
  font-size: 0.95rem;
}

.delete-action-btn:hover {
  opacity: 1;
}

/* ==========================================================================
   ADMIN / TEACHER DASHBOARD CONTROL PANELS
   ========================================================================== */
.admin-controls-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.table-container {
  overflow-x: auto;
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.dashboard-table th {
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-light);
  padding: 12px 16px;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--text-white);
}

.dashboard-table td {
  border-bottom: 1px solid var(--border-light);
  padding: 14px 16px;
  color: var(--text-gray);
}

.dashboard-table tr:last-child td {
  border-bottom: none;
}

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-badge.pending {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: hsl(35, 90%, 65%);
}

.status-badge.contacted {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: hsl(210, 85%, 65%);
}

.status-badge.resolved {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: hsl(150, 85%, 65%);
}

.action-select {
  background: var(--bg-dark);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  color: var(--text-white);
  font-size: 0.8rem;
  padding: 4px 8px;
  outline: none;
  cursor: pointer;
}

.action-select:focus {
  border-color: var(--primary);
}

/* ==========================================================================
   GLOBAL FOOTER
   ========================================================================== */
.glass-footer {
  background: var(--bg-darker);
  border-top: 1px solid var(--border-light);
  padding: 60px 24px 20px;
  margin-top: 80px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.5fr;
  gap: 48px;
  margin-bottom: 40px;
}

.footer-info .footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 1.5px;
  color: var(--text-white);
  margin-bottom: 20px;
}

.footer-info p {
  font-size: 0.9rem;
  color: var(--text-gray);
  max-width: 320px;
}

.footer-links h4,
.footer-contact h4 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-white);
  margin-bottom: 20px;
}

.footer-links ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links ul a {
  font-size: 0.9rem;
  color: var(--text-gray);
}

.footer-links ul a:hover {
  color: var(--accent-cyan);
  padding-left: 4px;
}

.footer-contact p {
  font-size: 0.9rem;
  color: var(--text-gray);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-contact p i {
  color: var(--accent-cyan);
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  border-top: 1px solid var(--border-light);
  padding-top: 20px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==========================================================================
   RESPONSIVE DESIGN (MEDIA QUERIES)
   ========================================================================== */
@media (max-width: 1024px) {
  .hero-section {
    flex-direction: column;
    padding: 60px 24px;
    text-align: center;
    gap: 32px;
  }

  .hero-content h1 {
    font-size: 3rem;
  }

  .hero-content p {
    margin: 0 auto 32px;
  }

  .hero-actions {
    justify-content: center;
  }

  .stats-section {
    grid-template-columns: repeat(2, 1fr);
  }

  .highlights-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .courses-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-container {
    grid-template-columns: 1fr;
    gap: 32px;
  }

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

  .dashboard-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-controls-grid {
    grid-template-columns: 1fr;
  }

  .footer-content {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .footer-content>*:first-child {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .hero-content h1 {
    font-size: clamp(1.7rem, 8.5vw, 2.5rem);
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .nav-actions {
    display: none !important;
  }

  .mobile-only-action {
    display: block;
    width: 100%;
  }

  .nav-links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 70px;
    left: 0;
    width: 100%;
    background: var(--bg-nav);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    padding: 24px;
    gap: 20px;
    z-index: 999;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: translateY(-20px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  }

  .nav-links.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav-links li {
    width: 100%;
    text-align: center;
  }

  .nav-links a {
    display: block;
    padding: 10px;
    font-size: 1.1rem;
    width: 100%;
  }

  .stats-section {
    grid-template-columns: 1fr;
  }

  .courses-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-stats-grid {
    grid-template-columns: 1fr;
  }

  .student-progress-row {
    flex-direction: column;
    gap: 24px;
  }

  .footer-content {
    grid-template-columns: 1fr;
  }

  .footer-content>*:first-child {
    grid-column: span 1;
  }
}

/* ==========================================================================
   ADMIN PANEL DEDICATED LAYOUTS
   ========================================================================== */
.admin-layout-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background-color: var(--bg-dark);
}

.admin-sidebar {
  width: 260px;
  height: 100%;
  background: var(--bg-darker);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition-smooth);
  z-index: 100;
  flex-shrink: 0;
}

.admin-sidebar.collapsed {
  width: 78px;
}

.admin-sidebar-header {
  height: 70px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  white-space: nowrap;
}

.admin-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 1px;
  color: var(--text-white);
  text-decoration: none;
}

.admin-sidebar-menu {
  list-style: none;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
  overflow-y: auto;
}

.admin-sidebar-menu li a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 8px;
  color: var(--text-gray);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
  border-left: 3px solid transparent;
}

.admin-sidebar-menu li a:hover,
.admin-sidebar-menu li a.active {
  background: rgba(124, 58, 237, 0.08);
  color: var(--text-white);
  border-left-color: var(--primary);
}

.admin-sidebar-footer {
  padding: 20px 12px;
  border-top: 1px solid var(--border-light);
}

.admin-sidebar.collapsed .admin-sidebar-brand span,
.admin-sidebar.collapsed .admin-sidebar-menu li a span,
.admin-sidebar.collapsed .admin-sidebar-footer button span {
  display: none;
}

.admin-sidebar.collapsed .admin-sidebar-brand {
  justify-content: center;
}

.admin-sidebar.collapsed .admin-sidebar-menu li a {
  justify-content: center;
  padding: 12px 0;
  border-left: none;
}

.admin-sidebar.collapsed .admin-sidebar-footer button {
  justify-content: center;
  width: 100%;
  padding: 10px 0;
}

.admin-content-area {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.admin-top-header {
  height: 70px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}

.admin-top-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-top-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-view-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-white);
}

.admin-sub-view-body {
  flex-grow: 1;
  padding: 32px;
  overflow-y: auto;
}

.toggle-sidebar-btn {
  background: transparent;
  border: none;
  color: var(--text-white);
  font-size: 1.25rem;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 4px;
}

.toggle-sidebar-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent-cyan);
}

@media (max-width: 768px) {
  .admin-sidebar {
    position: absolute;
    left: -260px;
    height: 100%;
  }

  .admin-sidebar.mobile-open {
    left: 0;
  }

  .admin-sidebar.collapsed {
    left: -78px;
  }
}

/* Sidebar Logo Toggle (Full / Small swap) */
.small-logo {
  display: none !important;
}

.sidebar-collapsed .full-logo {
  display: none !important;
}

.sidebar-collapsed .small-logo {
  display: block !important;
}

@media (max-width: 768px) {
  .full-logo {
    display: none !important;
  }
  .small-logo {
    display: block !important;
  }
}

/* ==========================================================================
   CUSTOM FORM SELECT STYLES FOR BOTH THEMES
   ========================================================================== */
select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-color: var(--bg-card) !important;
  border: 1px solid var(--border-light) !important;
  color: var(--text-white) !important;
  border-radius: 10px !important;
  padding: 13px 40px 13px 14px;
  font-size: 0.95rem !important;
  font-family: var(--font-body) !important;
  cursor: pointer !important;
  transition: var(--transition-smooth) !important;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 16px !important;
  width: 100% !important;
}

select:focus {
  outline: none !important;
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 0 0 2px var(--accent-cyan-glow) !important;
}

select option {
  background-color: var(--bg-dark) !important;
  color: var(--text-white) !important;
  padding: 12px !important;
  font-family: var(--font-body) !important;
}

/* Light mode overrides for the dropdown arrow and option background */
@media (prefers-color-scheme: light) {
  select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
  }
}

/* Custom Select Dropdowns */
.custom-select {
  position: relative;
  user-select: none;
  width: 100%;
}

.custom-select-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: 12px 16px;
  border-radius: 8px;
  color: var(--text-white);
  cursor: pointer;
  transition: var(--transition-fast);
  font-size: 0.95rem;
}

.custom-select-trigger:hover {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.08);
}

.custom-select-options {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  background: var(--bg-dark);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(12px);
  z-index: 9999;
  display: none;
  overflow: hidden;
}

.custom-select-options.show {
  display: block;
  animation: selectFadeDown 0.2s ease-out;
}

.custom-select-option {
  padding: 12px 16px;
  color: var(--text-gray);
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}

.custom-select-option:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-white);
}

.custom-select-option.active {
  background: rgba(139, 92, 246, 0.15);
  color: var(--primary-light);
  font-weight: 600;
}

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

@media (prefers-color-scheme: light) {
  .custom-select-trigger:hover {
    background: rgba(0, 0, 0, 0.04);
  }
  .custom-select-option:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-white);
  }
  .custom-select-option.active {
    background: rgba(139, 92, 246, 0.1);
    color: var(--primary);
  }
}

/* ─────────────────────────────────────────────────────────────
   REAL-TIME CHAT UI COMPONENTS
   ───────────────────────────────────────────────────────────── */
.chat-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 90vh;
  max-height: calc(100vh - 100px);
  background: var(--bg-nav);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.chat-layout.no-sidebar {
  grid-template-columns: 1fr;
}

@media (max-width: 900px) {
  .chat-layout {
    grid-template-columns: 1fr;
  }
  .chat-sidebar {
    display: none;
  }
  .chat-sidebar.active {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    z-index: 100;
  }
}

.chat-sidebar {
  background: rgba(10, 10, 15, 0.4);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-light);
}

.chat-rooms-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-room-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-gray);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.chat-room-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-white);
}

.chat-room-item.active {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.2);
  color: var(--primary-light);
}

.chat-room-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.chat-room-item.active .chat-room-icon {
  background: rgba(139, 92, 246, 0.2);
  color: var(--primary-light);
}

.chat-main {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: rgba(15, 12, 28, 0.25);
  position: relative;
  overflow: hidden;
}

.chat-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 10, 15, 0.2);
  z-index: 2;
  flex-shrink: 0;
}

.chat-messages-feed {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.chat-message-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  max-width: 85%;
}

.chat-message-row.self {
  margin-left: auto;
  flex-direction: row-reverse;
  max-width: 85%;
}

.chat-message-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-light);
}

.chat-message-bubble {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  padding: 12px 16px;
  border-radius: 12px;
  border-top-left-radius: 2px;
  color: var(--text-white);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-message-row.self .chat-message-bubble {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(109, 40, 217, 0.1));
  border-color: rgba(139, 92, 246, 0.25);
  border-radius: 12px;
  border-top-right-radius: 2px;
}

.chat-message-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.chat-message-sender {
  font-weight: 600;
  color: var(--text-white);
  font-size: 0.85rem;
}

.chat-message-row.self .chat-message-sender {
  color: var(--primary-light);
}

.chat-role-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.chat-role-tag.admin {
  background: rgba(249, 115, 22, 0.15);
  color: hsl(25, 95%, 60%);
  border: 1px solid rgba(249, 115, 22, 0.25);
}

.chat-role-tag.teacher {
  background: rgba(16, 185, 129, 0.15);
  color: hsl(150, 84%, 45%);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.chat-role-tag.student {
  background: rgba(6, 182, 212, 0.15);
  color: hsl(190, 90%, 55%);
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.chat-message-text {
  font-size: 0.92rem;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}

.chat-input-area {
  padding: 18px 24px;
  border-top: 1px solid var(--border-light);
  background: rgba(10, 10, 15, 0.25);
  z-index: 2;
  flex-shrink: 0;
}

.chat-input-container {
  display: flex;
  gap: 12px;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 6px 12px 6px 18px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chat-input-container:focus-within {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.chat-input-field {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-white);
  font-size: 0.95rem;
  outline: none;
  padding: 8px 0;
  resize: none;
  height: 24px;
  max-height: 120px;
  font-family: inherit;
}

.chat-send-btn {
  height: 38px;
  padding: 0 18px;
  border-radius: 10px;
  background: var(--primary);
  border: none;
  color: var(--text-white);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.chat-send-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

.chat-send-btn:active {
  transform: scale(0.95);
}

.chat-send-btn:disabled {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  cursor: not-allowed;
  transform: none;
}

/* Custom Scrollbars inside chat window */
.chat-messages-feed::-webkit-scrollbar,
.chat-rooms-list::-webkit-scrollbar {
  width: 6px;
}

.chat-messages-feed::-webkit-scrollbar-track,
.chat-rooms-list::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages-feed::-webkit-scrollbar-thumb,
.chat-rooms-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
}

.chat-messages-feed::-webkit-scrollbar-thumb:hover,
.chat-rooms-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Full page lock-scroll layout adjustments for chat view */
.student-portal-shell.chat-mode-active,
.admin-layout.chat-mode-active {
  height: 100vh !important;
  overflow: hidden !important;
}

.student-portal-shell.chat-mode-active .student-portal-main,
.admin-layout.chat-mode-active .admin-main {
  overflow: hidden !important;
  height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
}

/* Student dashboard container overrides */
.student-portal-shell.chat-mode-active .dashboard-container {
  flex: 1 !important;
  min-height: 0 !important;
  padding: 24px !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  max-width: none !important;
  margin: 0 !important;
}

.student-portal-shell.chat-mode-active .dashboard-header {
  flex-shrink: 0 !important;
  margin-bottom: 16px !important;
}

.student-portal-shell.chat-mode-active #student-tab-content-body {
  flex: 1 !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}

.student-portal-shell.chat-mode-active .chat-layout {
  flex: 1 !important;
  height: calc(100vh - 120px) !important;
  max-height: none !important;
}

/* Admin panel container overrides */
.admin-layout.chat-mode-active #admin-tab-content-body {
  flex: 1 !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  height: calc(100vh - 140px) !important;
}

.admin-layout.chat-mode-active .chat-layout {
  flex: 1 !important;
  height: calc(100vh - 140px) !important;
  max-height: none !important;
}

/* Light theme overrides for real-time chat components */
@media (prefers-color-scheme: light) {
  .chat-sidebar {
    background: rgba(255, 255, 255, 0.45);
    border-right-color: rgba(0, 0, 0, 0.08);
  }
  .chat-sidebar-header {
    border-bottom-color: rgba(0, 0, 0, 0.08);
  }
  .chat-room-item:hover {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-white);
  }
  .chat-room-item.active {
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.25);
    color: var(--primary);
  }
  .chat-room-icon {
    background: rgba(0, 0, 0, 0.03);
  }
  .chat-room-item.active .chat-room-icon {
    background: rgba(139, 92, 246, 0.18);
    color: var(--primary);
  }
  .chat-main {
    background: rgba(255, 255, 255, 0.45);
  }
  .chat-header {
    background: rgba(255, 255, 255, 0.3);
    border-bottom-color: rgba(0, 0, 0, 0.08);
  }
  .chat-message-avatar {
    border-color: rgba(0, 0, 0, 0.08);
  }
  .chat-message-bubble {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
  }
  .chat-message-row.self .chat-message-bubble {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(139, 92, 246, 0.06));
    border-color: rgba(139, 92, 246, 0.2);
  }
  .chat-input-area {
    background: rgba(255, 255, 255, 0.4);
    border-top-color: rgba(0, 0, 0, 0.08);
  }
  .chat-input-container {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
  }
  .chat-input-container:focus-within {
    border-color: var(--primary);
  }
  .chat-send-btn:disabled {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-muted);
  }
  .chat-messages-feed::-webkit-scrollbar-thumb,
  .chat-rooms-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.08);
  }
  .chat-messages-feed::-webkit-scrollbar-thumb:hover,
  .chat-rooms-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.15);
  }
}