/* ==========================================================================
   NTU AI ASSISTANT - CLEAN MINIMALIST DESIGN SYSTEM (style.css)
   Trường Đại học Nguyễn Trãi - Giao diện Đơn Giản, Trắng - Đen Hiện Đại
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* ==========================================
     DARK THEME (Mặc định) - Tối Giản, Dịu Mắt
     ========================================== */
  --bg-main: #121214;
  --bg-surface: #18181b;
  --bg-card: #1e1e22;
  --bg-input: #141416;
  --bg-glass: rgba(255, 255, 255, 0.04);

  --border-color: #2e2e34;
  --border-subtle: #232327;
  --border-hover: #52525b;

  --text-main: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;

  --primary: #ffffff;
  --primary-text: #121214;
  --primary-hover: #e4e4e7;
  --primary-light: rgba(255, 255, 255, 0.08);

  --secondary: #27272a;
  --secondary-hover: #3f3f46;

  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;

  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --sidebar-width: 280px;
  --header-height: 64px;
}

/* ==========================================
   LIGHT THEME - Trắng Sạch Sẽ, Tinh Tế
   ========================================== */
[data-theme="light"] {
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-input: #f1f5f9;
  --bg-glass: rgba(0, 0, 0, 0.02);

  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;
  --border-hover: #94a3b8;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  --primary: #0f172a;
  --primary-text: #ffffff;
  --primary-hover: #1e293b;
  --primary-light: rgba(15, 23, 42, 0.06);

  --secondary: #f1f5f9;
  --secondary-hover: #e2e8f0;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--text-muted);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* ==========================================================================
   HEADER & NAVBAR
   ========================================================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  animation: navbarSlideDown 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease, -webkit-backdrop-filter 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.navbar.scrolled {
  background: rgba(24, 24, 27, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .navbar.scrolled {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  transition: opacity 0.2s ease;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: var(--primary-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-brand:hover .brand-icon {
  transform: scale(1.1) rotate(4deg);
}

.brand-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  background: var(--bg-input);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.nav-brand:hover .brand-badge {
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

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

.nav-link {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  transition: color 0.25s ease, background-color 0.25s ease, transform 0.2s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 0.85rem;
  right: 0.85rem;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 2px;
}

.nav-link:hover {
  color: var(--text-main);
  background: var(--bg-input);
  transform: translateY(-1px);
}

.nav-link:hover::after {
  transform: scaleX(1);
}

.nav-link.active {
  color: var(--primary-text);
  background: var(--primary);
  font-weight: 600;
}

.nav-link.active::after {
  display: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

#navbar-auth-actions .btn {
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

#navbar-auth-actions .btn:hover {
  transform: translateY(-2px) scale(1.04);
}

/* ==========================================================================
   BUTTONS & RIPPLE EFFECT
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  outline: none;
  position: relative;
  overflow: hidden;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              background-color 0.2s ease,
              border-color 0.2s ease,
              color 0.2s ease;
  will-change: transform;
  user-select: none;
}

.btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.btn:active {
  transform: translateY(1px) scale(0.97);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: var(--bg-surface);
  border-color: var(--border-hover);
}

.btn-accent {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.btn-accent:hover {
  background: var(--bg-input);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              background-color 0.2s ease,
              border-color 0.2s ease,
              box-shadow 0.2s ease;
}
.btn-icon:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px) scale(1.06);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.btn-icon:active {
  transform: translateY(1px) scale(0.94);
}

/* Ripple effect element */
.ripple-wave {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transform: scale(0);
  animation: rippleAnim 0.55s ease-out forwards;
  pointer-events: none;
}

[data-theme="light"] .btn-secondary .ripple-wave,
[data-theme="light"] .btn-accent .ripple-wave,
[data-theme="light"] .btn-icon .ripple-wave {
  background: rgba(0, 0, 0, 0.12);
}

@keyframes rippleAnim {
  to {
    transform: scale(3.5);
    opacity: 0;
  }
}

.btn-sm {
  padding: 0.38rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.8rem 1.75rem;
  font-size: 1rem;
  border-radius: var(--radius-lg);
  font-weight: 600;
}

/* ==========================================================================
   CARDS & CONTAINERS (3D LIFT & SMOOTH HOVER)
   ========================================================================== */
.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.25s ease,
              background-color 0.25s ease;
  will-change: transform;
}

.card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px) scale(1.01);
  box-shadow: var(--shadow-lg);
}

/* ==========================================================================
   FORM CONTROLS
   ========================================================================== */
.form-group {
  margin-bottom: 1.15rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-main);
  font-size: 0.9rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.form-control:focus {
  outline: none;
  border-color: var(--text-main);
  box-shadow: 0 0 0 3px var(--primary-light);
}

textarea.form-control {
  resize: vertical;
  min-height: 90px;
}

/* ==========================================================================
   BADGES & CHIPS
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-muted);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.badge:hover {
  transform: translateY(-1px);
}
.badge-primary {
  background: var(--primary-light);
  color: var(--text-main);
  border-color: var(--border-color);
}
.badge-success {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.25);
}
.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.25);
}
.badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.25);
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  z-index: 9999;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 280px;
  max-width: 400px;
  padding: 0.85rem 1.1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  color: var(--text-main);
  font-size: 0.88rem;
  animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.toast-success { border-left: 3px solid #22c55e; }
.toast-error { border-left: 3px solid #ef4444; }
.toast-info { border-left: 3px solid #a1a1aa; }
.toast-warning { border-left: 3px solid #f59e0b; }

/* ==========================================================================
   LANDING PAGE HERO & SHOWCASE
   ========================================================================== */
.hero-section {
  padding: calc(var(--header-height) + 3rem) 0 4rem;
  text-align: center;
}

.hero-title {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
  letter-spacing: -0.5px;
  color: var(--text-main);
}

.text-gradient {
  color: var(--text-main);
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 720px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

.hero-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Quick Stats Items */
.stat-card {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}
.stat-card:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: var(--shadow-md);
}

.stat-number {
  font-size: 1.8rem;
  font-weight: 800;
  display: inline-block;
  font-variant-numeric: tabular-nums;
  transition: color 0.3s ease;
}

/* 10-Majors Grid Showcase */
.majors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-top: 2.5rem;
  text-align: left;
}

.major-card {
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.25s ease,
              background-color 0.25s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  will-change: transform;
}

.major-card:hover {
  border-color: var(--text-main);
  background: var(--bg-surface);
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 14px 30px -8px rgba(0, 0, 0, 0.4);
}

.major-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.major-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 600;
  transition: color 0.2s ease;
}
.major-card:hover .major-num {
  color: var(--text-muted);
}

.major-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  color: var(--text-main);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              background-color 0.25s ease,
              color 0.25s ease,
              border-color 0.25s ease;
}

.major-card:hover .major-icon {
  transform: scale(1.15) rotate(5deg);
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
}

.major-card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--text-main);
  transition: color 0.2s ease;
}

.major-card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 3rem;
}

.feature-card {
  padding: 1.5rem;
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.25s ease,
              background-color 0.25s ease;
  will-change: transform;
}

.feature-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 14px 30px -8px rgba(0, 0, 0, 0.4);
}

.feature-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: var(--text-main);
  margin-bottom: 1rem;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              background-color 0.25s ease,
              color 0.25s ease;
}

.feature-card:hover .feature-icon {
  transform: scale(1.15) rotate(-5deg);
  background: var(--primary);
  color: var(--primary-text);
}

/* User Avatar & Images */
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 1px solid var(--border-color);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s ease,
              border-color 0.3s ease;
}

.user-avatar:hover {
  transform: scale(1.08);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.25);
  border-color: var(--text-main);
}

img {
  max-width: 100%;
  height: auto;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), filter 0.35s ease;
}

.img-hover-zoom {
  overflow: hidden;
  border-radius: var(--radius-md);
  display: inline-block;
}
.img-hover-zoom img:hover {
  transform: scale(1.06);
}

/* ==========================================================================
   MODAL DIALOGS
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-backdrop.active,
.modal-backdrop[style*="display: flex"] {
  display: flex;
  opacity: 1;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 540px;
  width: 100%;
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  transform: scale(0.94) translateY(12px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.active .modal-card,
.modal-backdrop[style*="display: flex"] .modal-card {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.2s ease, color 0.2s ease;
}
.modal-close:hover {
  color: var(--text-main);
  transform: rotate(90deg) scale(1.1);
}

/* ==========================================================================
   SCROLL REVEAL & STAGGER ANIMATIONS (Intersection Observer)
   ========================================================================== */
@keyframes navbarSlideDown {
  from {
    opacity: 0;
    transform: translateY(-24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger item reveal for grids and lists */
.stagger-group > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.stagger-group.is-revealed > * {
  opacity: 1;
  transform: translateY(0);
}

.stagger-group.is-revealed > *:nth-child(1) { transition-delay: 0.04s; }
.stagger-group.is-revealed > *:nth-child(2) { transition-delay: 0.08s; }
.stagger-group.is-revealed > *:nth-child(3) { transition-delay: 0.12s; }
.stagger-group.is-revealed > *:nth-child(4) { transition-delay: 0.16s; }
.stagger-group.is-revealed > *:nth-child(5) { transition-delay: 0.20s; }
.stagger-group.is-revealed > *:nth-child(6) { transition-delay: 0.24s; }
.stagger-group.is-revealed > *:nth-child(7) { transition-delay: 0.28s; }
.stagger-group.is-revealed > *:nth-child(8) { transition-delay: 0.32s; }
.stagger-group.is-revealed > *:nth-child(9) { transition-delay: 0.36s; }
.stagger-group.is-revealed > *:nth-child(10) { transition-delay: 0.40s; }

/* ==========================================================================
   MODERN LOADING & SKELETON ANIMATIONS
   ========================================================================== */
.modern-spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: modernSpin 0.7s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  display: inline-block;
  vertical-align: middle;
}

[data-theme="light"] .modern-spinner {
  border-color: rgba(0, 0, 0, 0.1);
  border-top-color: var(--primary);
}

@keyframes modernSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  vertical-align: middle;
}
.loading-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.4;
  animation: dotPulse 1.4s infinite ease-in-out both;
}
.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0; }

@keyframes dotPulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.3; }
  40% { transform: scale(1.15); opacity: 1; }
}

.skeleton-shimmer {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-input) 37%, var(--bg-card) 63%);
  background-size: 400% 100%;
  animation: skeletonShimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeletonShimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ==========================================================================
   REDUCED MOTION SUPPORT (Accessibility)
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal-on-scroll, .stagger-group > * {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ==========================================================================
   MOBILE & RESPONSIVE DESIGN SYSTEM
   ========================================================================== */

/* Touch optimization */
* {
  -webkit-tap-highlight-color: transparent;
}

/* Mobile Menu Toggle Button */
.mobile-menu-btn {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}
.mobile-menu-btn:active {
  transform: scale(0.92);
}

/* Mobile Drawer Backdrop */
.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.mobile-nav-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* Mobile Navigation Drawer */
.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 290px;
  max-width: 82vw;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-color);
  z-index: 1999;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.25rem;
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.4);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}
.mobile-nav-drawer.active {
  transform: translateX(0);
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.mobile-drawer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  list-style: none;
  flex: 1;
}

.mobile-drawer-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}
.mobile-drawer-link:hover,
.mobile-drawer-link.active {
  color: var(--primary-text);
  background: var(--primary);
}
[data-theme="dark"] .mobile-drawer-link:hover:not(.active) {
  background: var(--bg-card);
  color: var(--text-main);
}

.mobile-drawer-footer {
  margin-top: auto;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 58px;
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  z-index: 1000;
  justify-content: space-around;
  align-items: center;
  padding: 0 0.5rem;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.25);
}

.bottom-bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  text-decoration: none;
  flex: 1;
  height: 100%;
  transition: color 0.2s ease, transform 0.15s ease;
}
.bottom-bar-item i {
  font-size: 1.15rem;
  transition: transform 0.2s ease;
}
.bottom-bar-item.active,
.bottom-bar-item:hover {
  color: var(--text-main);
}
.bottom-bar-item.active i {
  transform: translateY(-2px);
}
.bottom-bar-item:active {
  transform: scale(0.92);
}

/* Tablet & Mobile Breakpoints (< 768px) */
@media (max-width: 768px) {
  body {
    padding-bottom: 58px; /* Chừa không gian cho bottom bar */
  }

  .navbar {
    padding: 0 1rem;
    height: 58px;
  }

  :root {
    --header-height: 58px;
  }

  .nav-links {
    display: none;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .mobile-bottom-bar {
    display: flex;
  }

  .hero-section {
    padding: calc(var(--header-height) + 1.75rem) 0 2.5rem;
  }

  .hero-title {
    font-size: 1.95rem;
    line-height: 1.25;
    letter-spacing: -0.3px;
    margin-bottom: 0.85rem;
  }

  .hero-subtitle {
    font-size: 0.92rem;
    line-height: 1.55;
    margin-bottom: 1.5rem;
    padding: 0 0.25rem;
  }

  .hero-buttons {
    flex-direction: column;
    width: 100%;
    gap: 0.75rem;
  }

  .hero-buttons .btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  /* Quick stats 2 columns on mobile */
  .hero-section .stagger-group {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.85rem !important;
    margin-top: 2rem !important;
  }

  .stat-card {
    min-width: unset !important;
    padding: 0.85rem 1rem !important;
  }

  .stat-number {
    font-size: 1.5rem !important;
  }

  .majors-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
    margin-top: 1.5rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 2rem;
  }

  .card {
    padding: 1.25rem;
  }

  .modal-card {
    width: 94%;
    max-width: 94%;
    padding: 1.25rem;
    max-height: 88vh;
    overflow-y: auto;
  }

  .toast-container {
    left: 1rem;
    right: 1rem;
    bottom: calc(58px + 1rem);
  }

  .toast {
    min-width: unset;
    max-width: 100%;
  }
}

/* Small Smartphone Breakpoints (< 480px) */
@media (max-width: 480px) {
  .hero-title {
    font-size: 1.7rem;
  }

  .brand-badge {
    display: none;
  }

  .nav-brand span:not(.brand-icon) {
    font-size: 1rem;
  }

  .btn {
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
  }

  .btn-lg {
    padding: 0.75rem 1.25rem;
    font-size: 0.92rem;
  }
}

/* ==========================================================================
   AVATAR UPLOAD WRAPPER (Dùng trên trang Profile người dùng)
   ========================================================================== */
.avatar-upload-wrapper {
  position: relative;
  cursor: pointer;
  border-radius: 50%;
  overflow: hidden;
  display: inline-block;
  transition: transform 0.2s ease;
}

.avatar-upload-wrapper:hover {
  transform: scale(1.05);
}

.avatar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.22s ease;
  border-radius: 50%;
}

.avatar-upload-wrapper:hover .avatar-overlay {
  opacity: 1;
}

.avatar-overlay i {
  color: #ffffff;
  font-size: 1.1rem;
}

.avatar-overlay span {
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

