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

/* ============================================================
   DESIGN TOKENS — Premium Dark-Mode ERP / LMS
   ============================================================ */
:root {
  /* Core Dark Background */
  --bg-base:      #080c14;      /* near-black canvas */
  --bg-primary:   #0d1117;      /* main surfaces */
  --bg-secondary: #111827;      /* card / panel */
  --bg-tertiary:  #1a2235;      /* elevated elements */
  --bg-hover:     #1e2d44;      /* hover state */
  --bg-sidebar:   #0a0f1a;      /* sidebar */

  /* Brand Gradient: deep indigo → electric violet → cyan */
  --brand-1: #6366f1;           /* indigo */
  --brand-2: #818cf8;           /* light indigo */
  --brand-3: #22d3ee;           /* cyan */
  --brand-4: #a78bfa;           /* violet */

  --accent-primary:   #6366f1;
  --accent-secondary: #22d3ee;
  --accent-violet:    #a78bfa;
  --accent-emerald:   #10b981;
  --accent-amber:     #f59e0b;

  --accent-glow:        rgba(99, 102, 241, 0.12);
  --accent-glow-strong: rgba(99, 102, 241, 0.25);
  --cyan-glow:          rgba(34, 211, 238, 0.12);

  /* Text */
  --text-main:    #f0f4ff;
  --text-sub:     #94a3b8;
  --text-muted:   #64748b;
  --text-white:   #ffffff;

  /* Borders */
  --border-main:       rgba(255,255,255,0.07);
  --border-bright:     rgba(99,102,241,0.35);
  --border-glass:      rgba(255,255,255,0.08);
  --border-glass-glow: rgba(99,102,241,0.3);

  /* Shadows */
  --shadow-sm:     0 2px 8px rgba(0,0,0,0.4);
  --shadow-panel:  0 8px 32px rgba(0,0,0,0.5), 0 2px 8px rgba(0,0,0,0.3);
  --shadow-glow:   0 0 40px rgba(99,102,241,0.15), 0 8px 32px rgba(0,0,0,0.5);
  --shadow-overlay:0 24px 64px rgba(0,0,0,0.7);

  /* Status */
  --color-success: #10b981;
  --color-success-bg: rgba(16,185,129,0.1);
  --color-warning: #f59e0b;
  --color-warning-bg: rgba(245,158,11,0.1);
  --color-danger:  #ef4444;
  --color-danger-bg: rgba(239,68,68,0.1);
  --color-info:    #3b82f6;
  --color-info-bg: rgba(59,130,246,0.1);

  /* Typography */
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body:    'Inter', sans-serif;

  /* Radius */
  --radius-xs:  6px;
  --radius-sm:  10px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --radius-xl:  28px;
  --radius-pill:999px;
}

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

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg-base);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

a { text-decoration: none; color: inherit; }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-primary); }

/* Icon spacing */
i[class*="fa-"] { margin-right: 0.35rem; }
.metric-header i[class*="fa-"],
.modal-close i[class*="fa-"],
button:empty i[class*="fa-"] { margin-right: 0; }

/* ============================================================
   APP SHELL
   ============================================================ */
.app-container { min-height: 100vh; display: flex; flex-direction: column; }

.view-section { display: none; flex: 1; }
.view-section.active { display: flex; flex-direction: column; }

/* ============================================================
   GLASS PANEL (core card style)
   ============================================================ */
.glass-panel {
  background: rgba(17, 24, 39, 0.8);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}

.glass-panel-hover:hover {
  border-color: var(--border-bright);
  box-shadow: var(--shadow-glow);
  transform: translateY(-3px);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.65rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
  border: 1px solid transparent;
  outline: none;
  gap: 0;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.2s ease;
}
.btn:hover::before { background: rgba(255,255,255,0.06); }

.btn-primary {
  background: linear-gradient(135deg, var(--brand-1), var(--brand-4));
  color: #fff;
  box-shadow: 0 4px 16px rgba(99,102,241,0.35);
  border-color: rgba(99,102,241,0.4);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99,102,241,0.5);
  filter: brightness(1.08);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-sub);
  border: 1px solid var(--border-glass);
}
.btn-secondary:hover {
  border-color: var(--border-bright);
  color: var(--text-main);
  background: var(--bg-hover);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent-secondary), var(--brand-1));
  color: #fff;
  box-shadow: 0 4px 16px rgba(34,211,238,0.25);
}
.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(34,211,238,0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--text-sub);
  border: 1px solid var(--border-glass);
}
.btn-ghost:hover {
  background: var(--bg-tertiary);
  color: var(--text-main);
  border-color: var(--border-bright);
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
  filter: none !important;
}

/* ============================================================
   LANDING HEADER
   ============================================================ */
.landing-header {
  padding: 1.1rem 3.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(8,12,20,0.85);
  backdrop-filter: blur(24px) saturate(150%);
  border-bottom: 1px solid var(--border-main);
}

.logo-container { display: flex; align-items: center; gap: 0.9rem; }

.logo-img {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-4));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: #fff;
  box-shadow: 0 0 20px rgba(99,102,241,0.4);
  flex-shrink: 0;
}

.logo-text h1 { font-size: 1.2rem; line-height: 1.2; color: var(--text-main); }
.logo-text p  { font-size: 0.68rem; color: var(--accent-secondary); text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; }

.nav-links { display: flex; gap: 2rem; list-style: none; align-items: center; }
.nav-links a {
  color: var(--text-sub);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0; right: 0;
  height: 2px;
  background: var(--brand-1);
  transform: scaleX(0);
  transition: transform 0.2s ease;
  border-radius: var(--radius-pill);
}
.nav-links a:hover { color: var(--text-main); }
.nav-links a:hover::after { transform: scaleX(1); }

/* ============================================================
   LANDING HERO
   ============================================================ */
.landing-page-bg {
  background:
    radial-gradient(ellipse 80% 60% at 50% -20%, rgba(99,102,241,0.18) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 100% 80%, rgba(34,211,238,0.08) 0%, transparent 60%),
    var(--bg-base);
  min-height: 100vh;
}

.hero-section {
  padding: 7rem 3.5rem 5rem;
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 5rem;
  align-items: center;
}

.hero-content h1 {
  font-size: 3.8rem;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--text-main) 0%, var(--brand-2) 50%, var(--accent-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1.1rem;
  background: var(--accent-glow);
  color: var(--brand-2);
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.8rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(99,102,241,0.3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-content p {
  font-size: 1.1rem;
  color: var(--text-sub);
  margin-bottom: 2.5rem;
  max-width: 560px;
  line-height: 1.75;
}

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero-badge-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.hero-badge-card {
  padding: 1.75rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  background: rgba(17,24,39,0.7);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.hero-badge-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--brand-1), var(--brand-4));
}
.hero-badge-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}
.hero-badge-card h3 {
  background: linear-gradient(135deg, var(--brand-1), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
}
.hero-badge-card p { font-size: 0.82rem; color: var(--text-sub); }

/* ============================================================
   SECTIONS (Courses, Features, etc.)
   ============================================================ */
.section-wrapper {
  padding: 6rem 3.5rem;
  max-width: 1280px;
  margin: 0 auto;
}

.section-title {
  text-align: center;
  margin-bottom: 4rem;
}
.section-title h2 {
  font-size: 2.6rem;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, var(--text-main), var(--brand-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.section-title p { color: var(--text-sub); font-size: 1.05rem; max-width: 560px; margin: 0 auto; }

/* DIVIDER LINE between sections */
.section-divider {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-glass), transparent);
  margin: 0;
}

/* COURSE CARDS */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.75rem;
}

.course-card {
  display: flex;
  flex-direction: column;
  padding: 2rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.course-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-1), var(--brand-4), var(--accent-secondary));
  opacity: 0;
  transition: opacity 0.3s ease;
}
.course-card:hover { border-color: var(--border-bright); transform: translateY(-5px); box-shadow: var(--shadow-glow); }
.course-card:hover::after { opacity: 1; }

.course-category {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--brand-2);
  margin-bottom: 0.75rem;
  letter-spacing: 0.1em;
}
.course-card h3 { font-size: 1.3rem; margin-bottom: 0.75rem; color: var(--text-main); }
.course-card p  { color: var(--text-sub); font-size: 0.93rem; margin-bottom: 1.75rem; flex: 1; line-height: 1.7; }

.course-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-main);
}
.course-meta .duration { color: var(--text-muted); font-size: 0.87rem; font-weight: 500; }
.course-meta .price    { font-family: var(--font-heading); font-weight: 800; font-size: 1.2rem; color: var(--accent-secondary); }

/* FEATURE CARDS */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.feature-card {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--brand-2), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.feature-card:hover::before { opacity: 1; }
.feature-card:hover { border-color: var(--border-bright); transform: translateY(-5px); box-shadow: var(--shadow-glow); }
.feature-card .icon-box {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  background: var(--accent-glow);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  color: var(--brand-2);
  margin-bottom: 0.5rem;
  border: 1px solid rgba(99,102,241,0.2);
  transition: all 0.3s ease;
}
.feature-card:hover .icon-box {
  background: var(--brand-1);
  color: #fff;
  box-shadow: 0 0 15px var(--accent-primary);
  transform: scale(1.05);
}
.feature-card h3 { font-size: 1.15rem; color: var(--text-main); font-weight: 700; font-family: var(--font-heading); }
.feature-card p  { font-size: 0.9rem; color: var(--text-sub); line-height: 1.6; }

@keyframes woggle {
  0%   { transform: translateY(0) rotate(0deg); }
  25%  { transform: translateY(-8px) rotate(1deg); }
  50%  { transform: translateY(0) rotate(0deg); }
  75%  { transform: translateY(4px) rotate(-1deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

.feature-woggle {
  animation: woggle 6s ease-in-out infinite;
}
.feature-woggle:hover {
  animation-play-state: paused;
}
.feature-card:nth-child(1).feature-woggle { animation-delay: 0.0s; }
.feature-card:nth-child(2).feature-woggle { animation-delay: 0.8s; }
.feature-card:nth-child(3).feature-woggle { animation-delay: 1.6s; }
.feature-card:nth-child(4).feature-woggle { animation-delay: 2.4s; }
.feature-card:nth-child(5).feature-woggle { animation-delay: 3.2s; }
.feature-card:nth-child(6).feature-woggle { animation-delay: 4.0s; }




/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background:
    radial-gradient(ellipse 70% 50% at 30% 30%, rgba(99,102,241,0.15) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(167,139,250,0.1) 0%, transparent 60%),
    var(--bg-base);
}

.login-card {
  width: 100%;
  max-width: 460px;
  padding: 3rem;
  background: rgba(13,17,23,0.9);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-overlay);
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-1), var(--brand-4), var(--accent-secondary));
}

.login-header { text-align: center; }
.login-header .logo-img { margin: 0 auto 1.25rem; width: 56px; height: 56px; font-size: 1.5rem; }
.login-header h2 { font-size: 1.9rem; margin-bottom: 0.4rem; }
.login-header p { color: var(--text-sub); font-size: 0.9rem; }

/* ============================================================
   PORTAL LAYOUT (Staff ERP + Student LMS)
   ============================================================ */
.portal-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-base);
  gap: 0;
}

/* SIDEBAR */
.portal-sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-main);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.25rem;
  justify-content: space-between;
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.5rem 0.25rem 1.5rem;
  border-bottom: 1px solid var(--border-main);
  margin-bottom: 1.5rem;
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.sidebar-nav-item button {
  width: 100%;
  text-align: left;
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 0.85rem 1rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0;
  transition: all 0.18s ease;
}
.sidebar-nav-item button:hover {
  background: var(--bg-tertiary);
  color: var(--text-main);
  border-color: var(--border-glass);
}
.sidebar-nav-item.active button {
  background: var(--accent-glow);
  color: var(--brand-2);
  border-color: rgba(99,102,241,0.3);
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(99,102,241,0.1);
}
.sidebar-nav-item.active button i {
  color: var(--brand-1);
}

.sidebar-footer {
  border-top: 1px solid var(--border-main);
  padding-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.sidebar-user {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 0.5rem 0.25rem;
}
.sidebar-user strong { color: var(--text-sub); display: block; font-weight: 600; font-size: 0.9rem; }

/* MAIN CONTENT */
.portal-content {
  overflow-y: auto;
  padding: 2.5rem;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

/* PORTAL HEADER BAR */
.portal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-main);
}
.portal-header-left h2 {
  font-size: 1.85rem;
  margin-bottom: 0.25rem;
  background: linear-gradient(120deg, var(--text-main), var(--brand-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.portal-header-left p { color: var(--text-muted); font-size: 0.88rem; }

/* ============================================================
   METRIC CARDS
   ============================================================ */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.metric-card {
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 135px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}
.metric-card::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--brand-1), var(--accent-secondary));
  opacity: 0;
  transition: opacity 0.25s ease;
}
.metric-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-bright);
  box-shadow: var(--shadow-glow);
}
.metric-card:hover::before { opacity: 1; }

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.metric-value {
  font-size: 2.5rem;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--text-main);
  line-height: 1;
  margin: 0.5rem 0;
}

.metric-footer {
  font-size: 0.78rem;
  color: var(--color-success);
  font-weight: 600;
}

/* STAT CARDS (same base as metric but used in finance/leads) */
.stat-card {
  padding: 1.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  transition: all 0.25s ease;
}
.stat-card:hover { border-color: var(--border-bright); transform: translateY(-3px); }
.stat-value { font-size: 2.2rem; font-weight: 800; font-family: var(--font-heading); }
.stat-title { font-size: 0.82rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 0.35rem; }

/* ============================================================
   TABLES
   ============================================================ */
.table-responsive, .table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-main);
  background: var(--bg-secondary);
}

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

.data-table th {
  background: rgba(26,34,53,0.6);
  padding: 1rem 1.35rem;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-main);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}

.data-table td {
  padding: 1rem 1.35rem;
  border-bottom: 1px solid var(--border-main);
  color: var(--text-sub);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(26,34,53,0.5); }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.badge-success { background: var(--color-success-bg); color: var(--color-success); border: 1px solid rgba(16,185,129,0.25); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning); border: 1px solid rgba(245,158,11,0.25); }
.badge-error   { background: var(--color-danger-bg);  color: var(--color-danger);  border: 1px solid rgba(239,68,68,0.25);  }
.badge-info    { background: var(--color-info-bg);    color: var(--color-info);    border: 1px solid rgba(59,130,246,0.25); }
.badge-primary { background: var(--accent-glow); color: var(--brand-2); border: 1px solid rgba(99,102,241,0.3); }
.badge-muted   { background: rgba(100,116,139,0.1); color: var(--text-muted); border: 1px solid rgba(100,116,139,0.2); }

/* ============================================================
   DIALOGS / MODALS
   ============================================================ */
dialog {
  margin: auto;
  border: 1px solid var(--border-glass);
  background: var(--bg-secondary);
  color: var(--text-main);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-overlay);
  max-width: 640px;
  width: calc(100% - 2rem);
  padding: 2.5rem;
  outline: none;
}
dialog::backdrop {
  background: rgba(5,8,15,0.7);
  backdrop-filter: blur(12px);
}

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

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.5rem;
  transition: color 0.2s;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { color: var(--text-main); background: var(--bg-tertiary); }

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
  margin-bottom: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.form-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.form-control {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
  width: 100%;
  box-sizing: border-box;
  min-height: 50px;
  display: block;
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:focus {
  border-color: var(--brand-1);
  background: rgba(26,34,53,0.8);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

select.form-control {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  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='%2364748b' 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");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1em;
  padding-right: 2.5rem;
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
  line-height: 1.6;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

/* ============================================================
   SUB-TABS NAV BAR
   ============================================================ */
.sub-tabs-nav {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-main) !important;
  border-radius: var(--radius-md) !important;
  padding: 0.75rem !important;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ============================================================
   SECTION CARD HEADERS
   ============================================================ */
.card-title-border {
  border-bottom: 1px solid var(--border-main);
  padding-bottom: 0.85rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.card-title-border h3 { font-size: 1.1rem; color: var(--text-main); }

/* ============================================================
   CHARTS
   ============================================================ */
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.75rem; }
.two-col-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }

.chart-card { padding: 1.75rem; }
.chart-container { height: 260px; position: relative; width: 100%; }

.dashboard-split {
  display: flex;
  gap: 1.5rem;
  width: 100%;
}

/* ============================================================
   CODE EDITOR / SANDBOX
   ============================================================ */
.playground-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  height: 580px;
}

.editor-pane, .output-pane {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.editor-header, .output-header {
  padding: 0.75rem 1.25rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-main);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-sub);
}

.editor-textarea {
  flex: 1;
  background: #080c14;
  border: 1px solid var(--border-main);
  color: #818cf8;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.92rem;
  padding: 1.25rem;
  outline: none;
  resize: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  line-height: 1.6;
}

.output-console {
  flex: 1;
  background: #050810;
  border: 1px solid var(--border-main);
  color: #10b981;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.88rem;
  padding: 1.25rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  overflow-y: auto;
  white-space: pre-wrap;
}

.output-iframe {
  flex: 1;
  background: white;
  border: 1px solid var(--border-main);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  width: 100%; height: 100%;
}

/* ============================================================
   CHATBOT
   ============================================================ */
.public-bot-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1rem;
}

.bot-attention-popup {
  background: var(--bg-secondary);
  border: 1px solid var(--border-main);
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-lg);
  border-bottom-right-radius: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: popupBounce 2s infinite ease-in-out;
  cursor: pointer;
  position: relative;
  max-width: 280px;
}
.bot-attention-popup::after {
  content: '';
  position: absolute;
  bottom: -10px;
  right: 15px;
  border-width: 10px 10px 0 0;
  border-style: solid;
  border-color: var(--bg-secondary) transparent transparent transparent;
  filter: drop-shadow(1px 2px 2px rgba(0,0,0,0.1));
}

.bot-attention-popup .popup-text {
  font-size: 0.9rem;
  color: var(--text-main);
  font-weight: 500;
  line-height: 1.4;
}

.bot-attention-popup .popup-close {
  background: none;
  border: none;
  color: var(--text-sub);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0;
  margin: 0;
  line-height: 1;
}

@keyframes popupBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.chatbot-bubble {
  position: fixed;
  bottom: 2rem; right: 2rem;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-4));
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(99,102,241,0.4);
  z-index: 999;
  transition: all 0.3s ease;
  border: 2px solid rgba(99,102,241,0.3);
}
.chatbot-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 40px rgba(99,102,241,0.6);
}
.chatbot-bubble i { margin: 0; padding: 0; line-height: 1; }

.chatbot-window {
  position: fixed;
  bottom: 6.5rem; right: 2rem;
  width: 380px; height: 520px;
  display: none;
  flex-direction: column;
  z-index: 1000;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-overlay);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.chatbot-header {
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-4));
  color: white;
  display: flex; justify-content: space-between; align-items: center;
}
.chatbot-header h3 {
  font-size: 1rem;
  color: white;
  display: flex; align-items: center; gap: 0.5rem;
}
.chatbot-header .close-btn {
  background: none; border: none;
  color: rgba(255,255,255,0.7);
  font-size: 1.3rem; cursor: pointer; line-height: 1;
}
.chatbot-header .close-btn:hover { color: white; }

.bot-status-light {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 0.25rem;
  background-color: var(--text-muted);
  transition: all 0.3s ease;
}
.bot-status-light.online {
  background-color: var(--color-success);
  box-shadow: 0 0 8px var(--color-success);
}

.chat-messages {
  flex: 1; overflow-y: auto; padding: 1.25rem;
  display: flex; flex-direction: column; gap: 1rem;
  background: var(--bg-primary);
}

.chat-message {
  max-width: 85%;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  line-height: 1.55;
}
.chat-message-assistant {
  background: var(--bg-secondary);
  color: var(--text-main);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
  border: 1px solid var(--border-glass);
}
.chat-message-user {
  background: linear-gradient(135deg, var(--brand-1), var(--brand-4));
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

.chat-input-area {
  display: flex; gap: 0.5rem; padding: 0.85rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-main);
}
.chat-input-area input { flex: 1; }

/* ============================================================
   SYLLABUS ACCORDION
   ============================================================ */
.syllabus-accordion { display: flex; flex-direction: column; gap: 0.85rem; }

.syllabus-module {
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-secondary);
  transition: border-color 0.2s ease;
}
.syllabus-module:hover { border-color: var(--border-bright); }

.syllabus-module-header {
  padding: 1.1rem 1.4rem;
  background: var(--bg-tertiary);
  cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  transition: all 0.2s ease;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-sub);
}
.syllabus-module-header:hover { background: var(--bg-hover); color: var(--brand-2); }

.syllabus-module-content {
  display: none; padding: 1.5rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-main);
}
.syllabus-module.active .syllabus-module-content { display: block; }

.topics-list { display: grid; grid-template-columns: repeat(2,1fr); gap: 0.65rem; list-style: none; }
.topics-list li { font-size: 0.88rem; color: var(--text-sub); display: flex; align-items: center; gap: 0.5rem; }
.topics-list li::before { content: "◆"; color: var(--brand-1); font-size: 0.6rem; }

/* ============================================================
   AI PANEL
   ============================================================ */
.ai-insights-panel {
  border: 1px solid rgba(99,102,241,0.25) !important;
  background: rgba(13,17,23,0.95) !important;
}
.ai-insights-panel h3 { text-shadow: 0 0 12px rgba(99,102,241,0.4); }

#student-ai-content ul, #staff-ai-content ul { padding-left: 1.2rem; margin-top: 0.5rem; }
#student-ai-content li, #staff-ai-content li { margin-bottom: 0.8rem; }
#student-ai-content li::marker, #staff-ai-content li::marker { color: var(--brand-1); }

/* ============================================================
   VERIFY / SEARCH BOXES
   ============================================================ */
.verify-search-box { max-width: 550px; margin: 0 auto; display: flex; gap: 0.5rem; }
.verify-results { margin-top: 2rem; max-width: 620px; margin-left: auto; margin-right: auto; }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes pulse-glow {
  0%   { opacity: 0.6; transform: scale(0.98); }
  50%  { opacity: 1;   transform: scale(1);    filter: brightness(1.2); }
  100% { opacity: 0.6; transform: scale(0.98); }
}
.generating-pulse { animation: pulse-glow 2s infinite ease-in-out; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fade-up 0.4s ease forwards; }

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* ============================================================
   FOOTER (Landing)
   ============================================================ */
.landing-footer {
  background: var(--bg-sidebar);
  padding: 4rem 3.5rem;
  border-top: 1px solid var(--border-main);
}
.landing-footer-grid {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 4rem;
}
.landing-footer p { color: var(--text-sub); font-size: 0.9rem; line-height: 1.7; }
.landing-footer-contact { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1.25rem; }
.landing-footer-contact p { font-size: 0.88rem; color: var(--text-muted); display: flex; align-items: flex-start; gap: 0.65rem; }
.landing-footer-contact i { color: var(--brand-2); margin-top: 3px; flex-shrink: 0; margin-right: 0; }


/* ============================================================
   CURRICULUM TIMELINE (RESPONSIVE)
   ============================================================ */
.curriculum-timeline {
  position: relative;
  margin-left: 1.5rem;
  border-left: 2px dashed var(--border-main);
  padding-left: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}
.timeline-module {
  position: relative;
}
.module-marker {
  position: absolute;
  left: -3.25rem;
  top: 0;
  width: 1.5rem;
  height: 1.5rem;
  background: var(--accent-primary);
  border-radius: 50%;
  border: 4px solid var(--bg-secondary);
  box-shadow: 0 0 0 4px rgba(99,102,241,0.1);
}
.module-content {
  padding: 1.75rem;
  background: linear-gradient(145deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
  border-color: var(--border-main);
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  border-radius: 12px;
}
.module-title {
  color: var(--text-main);
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.module-badge {
  background: var(--accent-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
}
.module-topics {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.topic-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0,0,0,0.15);
  padding: 1rem 1.25rem;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}
.topic-row.completed {
  border-color: rgba(99,102,241,0.3);
}
.topic-info {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.topic-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 0.8rem;
  flex-shrink: 0;
}
.topic-row.completed .topic-icon {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 0 10px rgba(99,102,241,0.4);
}
.topic-name {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-lavender);
}
.topic-row.completed .topic-name {
  color: var(--text-main);
}
.topic-status {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.4rem 1rem;
  background: rgba(255,255,255,0.05);
  border-radius: 20px;
}
.topic-btn {
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(99,102,241,0.25);
}

/* ============================================================
   LIGHT THEME OVERRIDES — [data-theme="light"]
   ============================================================ */
[data-theme="light"] {
  --bg-base:      #f1f5f9;
  --bg-primary:   #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary:  #f0f4f8;
  --bg-hover:     #e2e8f0;
  --bg-sidebar:   #ffffff;

  --text-main:    #0f172a;
  --text-sub:     #475569;
  --text-muted:   #94a3b8;

  --border-main:       rgba(0,0,0,0.08);
  --border-bright:     rgba(99,102,241,0.4);
  --border-glass:      rgba(0,0,0,0.08);

  --shadow-sm:     0 2px 8px rgba(0,0,0,0.06);
  --shadow-panel:  0 4px 24px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-glow:   0 0 32px rgba(99,102,241,0.12), 0 4px 24px rgba(0,0,0,0.08);
  --shadow-overlay:0 16px 48px rgba(0,0,0,0.18);

  --accent-glow:        rgba(99,102,241,0.08);
  --accent-glow-strong: rgba(99,102,241,0.15);
  --cyan-glow:          rgba(34,211,238,0.08);
}

.mobile-bottom-nav { display: none; }

/* Light theme surface adjustments */
[data-theme="light"] body { background-color: var(--bg-base); }

[data-theme="light"] .glass-panel {
  background: rgba(255,255,255,0.9);
  border-color: rgba(0,0,0,0.08);
  box-shadow: var(--shadow-panel);
}

[data-theme="light"] .landing-header {
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--border-glass);
}
[data-theme="light"] .logo-text p {
  color: #312e81; /* darker blue for better visibility */
  font-weight: 800;
}

[data-theme="light"] .landing-page-bg {
  background:
    radial-gradient(ellipse 80% 60% at 50% -20%, rgba(99,102,241,0.10) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 100% 80%, rgba(34,211,238,0.06) 0%, transparent 60%),
    #f1f5f9;
}

[data-theme="light"] .login-bg {
  background:
    radial-gradient(ellipse 70% 50% at 30% 30%, rgba(99,102,241,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(167,139,250,0.07) 0%, transparent 60%),
    #f1f5f9;
}

[data-theme="light"] .login-card {
  background: rgba(255,255,255,0.97);
}

[data-theme="light"] .portal-sidebar {
  background: #ffffff;
  border-right-color: rgba(0,0,0,0.08);
}

[data-theme="light"] .portal-content {
  background: var(--bg-primary);
}

[data-theme="light"] .sidebar-nav-item button {
  color: #64748b;
}
[data-theme="light"] .sidebar-nav-item button:hover {
  background: var(--bg-tertiary);
  color: #0f172a;
}
[data-theme="light"] .sidebar-nav-item.active button {
  background: rgba(99,102,241,0.08);
  color: #4f46e5;
  border-color: rgba(99,102,241,0.25);
}

[data-theme="light"] .metric-card {
  background: #ffffff;
  border-color: rgba(0,0,0,0.08);
  box-shadow: var(--shadow-sm);
}

[data-theme="light"] .data-table th {
  background: #f8fafc;
  color: #64748b;
}
[data-theme="light"] .data-table td {
  color: #475569;
  border-bottom-color: rgba(0,0,0,0.06);
}
[data-theme="light"] .data-table tr:hover td {
  background: #f1f5f9;
}
[data-theme="light"] .table-responsive,
[data-theme="light"] .table-container {
  background: #ffffff;
  border-color: rgba(0,0,0,0.08);
}

[data-theme="light"] .form-control {
  background: #f8fafc;
  border-color: rgba(0,0,0,0.12);
  color: #0f172a;
}
[data-theme="light"] .form-control:focus {
  background: #ffffff;
  border-color: var(--brand-1);
}

[data-theme="light"] .hero-badge-card {
  background: rgba(255,255,255,0.9);
}

[data-theme="light"] .course-card,
[data-theme="light"] .feature-card {
  background: #ffffff;
  border-color: rgba(0,0,0,0.08);
}

[data-theme="light"] dialog {
  background: #ffffff;
  border-color: rgba(0,0,0,0.1);
}

[data-theme="light"] .btn-secondary {
  background: #f1f5f9;
  color: #475569;
  border-color: rgba(0,0,0,0.1);
}
[data-theme="light"] .btn-secondary:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: var(--brand-1);
}

[data-theme="light"] .btn-ghost {
  background: transparent;
  color: #64748b;
  border-color: rgba(0,0,0,0.1);
}
[data-theme="light"] .btn-ghost:hover {
  background: #f1f5f9;
  color: #0f172a;
}

[data-theme="light"] .sub-tabs-nav {
  background: #ffffff !important;
  border-color: rgba(0,0,0,0.08) !important;
}

[data-theme="light"] .landing-footer {
  background: #f1f5f9;
  border-top-color: rgba(0,0,0,0.08);
}

[data-theme="light"] .editor-textarea {
  background: #1e293b;
  color: #818cf8;
}
[data-theme="light"] .output-console {
  background: #0f172a;
  color: #10b981;
}

[data-theme="light"] .ai-insights-panel {
  background: rgba(248,250,252,0.98) !important;
}

[data-theme="light"] .syllabus-module {
  background: #ffffff;
}
[data-theme="light"] .syllabus-module-header {
  background: #f8fafc;
  color: #475569;
}
[data-theme="light"] .syllabus-module-header:hover {
  background: #f1f5f9;
  color: var(--brand-1);
}
[data-theme="light"] .syllabus-module-content {
  background: #ffffff;
}

[data-theme="light"] .chatbot-window {
  background: #ffffff;
}
[data-theme="light"] .chat-messages {
  background: #f8fafc;
}
[data-theme="light"] .chat-message-assistant {
  background: #ffffff;
  color: #0f172a;
}

/* Smooth theme transition on all elements */
*, *::before, *::after {
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.2s ease, box-shadow 0.25s ease;
}
/* But NOT on transitions that need to be instant */
.btn, .sidebar-nav-item button, .glass-panel-hover {
  transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
}

/* ============================================================
   CHATBOT
   ============================================================ */
.cipher-thinking {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 30px;
  padding: 5px 15px;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 20px;
  border: 1px solid rgba(99, 102, 241, 0.3);
  width: fit-content;
}
.cipher-thinking .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand-2);
  box-shadow: 0 0 10px var(--brand-2), 0 0 20px var(--brand-3);
  animation: cipherPulse 1.5s infinite ease-in-out;
}
.cipher-thinking .dot:nth-child(1) { animation-delay: -0.4s; }
.cipher-thinking .dot:nth-child(2) { animation-delay: -0.2s; }
.cipher-thinking .dot:nth-child(3) { animation-delay: 0s; }

@keyframes cipherPulse {
  0%, 100% { transform: scale(0.5); opacity: 0.5; box-shadow: 0 0 5px var(--brand-2); }
  50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 15px var(--brand-2), 0 0 30px var(--brand-3); }
}

.typewriter-text {
  overflow: hidden;
  border-right: 2px solid var(--brand-2);
  white-space: nowrap;
  animation: typing 2s steps(40, end), blink-caret .75s step-end infinite;
  display: inline-block;
}

@keyframes typing {
  from { width: 0 }
  to { width: 100% }
}
@keyframes blink-caret {
  from, to { border-color: transparent }
  50% { border-color: var(--brand-2); }
}

/* ============================================================
   THEME TOGGLE BUTTON
   ============================================================ */
.theme-toggle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border-glass);
  background: var(--bg-tertiary);
  color: var(--text-sub);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.theme-toggle:hover {
  border-color: var(--border-bright);
  color: var(--brand-2);
  background: var(--bg-hover);
  transform: rotate(15deg);
}
.theme-toggle .icon-dark,
.theme-toggle .icon-light { position: absolute; top: 50%; left: 50%; transition: all 0.3s ease; margin: 0; padding: 0; line-height: 1; }
.theme-toggle .icon-light { opacity: 0; transform: translate(-50%, -50%) scale(0.5) rotate(-30deg); }
.theme-toggle .icon-dark  { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0deg); }

[data-theme="light"] .theme-toggle .icon-dark  { opacity: 0; transform: translate(-50%, -50%) scale(0.5) rotate(30deg); }
[data-theme="light"] .theme-toggle .icon-light { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0deg); }



/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes sand-drop {
  0% { content: "\f251"; } /* fa-hourglass-start */
  33% { content: "\f252"; } /* fa-hourglass-half */
  66% { content: "\f253"; } /* fa-hourglass-end */
  100% { content: "\f251"; }
}

.fa-sand-drop::before {
  animation: sand-drop 1.5s infinite steps(1);
}

/* ============================================================
   RESPONSIVE & PWA LAYOUTS
   ============================================================ */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
}

.mobile-sidebar-btn {
  display: none;
}

.job-listing-card {
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.resume-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
}
.resume-actions .btn {
  padding: 0.6rem 0.8rem;
  font-size: 0.8rem;
  white-space: nowrap;
}

.resume-preview-container {
  height: 460px;
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid var(--border-main);
  background: var(--bg-tertiary);
  padding: 1rem;
}

@media (min-width: 969px) {
  .resume-preview-container {
    height: auto;
    aspect-ratio: 1 / 1.414;
    min-height: 500px;
  }
}

@media (max-width: 968px) {
  .mobile-menu-btn { display: block; }
  
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15,23,42,0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-main);
    z-index: 1000;
    justify-content: space-around;
    padding: 0.5rem 0 0.8rem 0; /* Extra padding for iOS home indicator */
    box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
  }
  
  .bottom-nav-item {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    padding: 0.6rem;
    cursor: pointer;
    border-radius: var(--radius-btn);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
  }
  
  .bottom-nav-item.active {
    color: var(--accent-primary);
    background: rgba(34,211,238,0.1);
  }
  
  /* Add padding to dashboard so content is not obscured by bottom nav */
  .dashboard {
    padding-bottom: 80px;
  }
  
  .nav-links {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    flex-direction: column;
    padding: 2rem;
    border-bottom: 1px solid var(--border-glass);
    z-index: 1000;
  }
  
  .nav-links.active {
    display: flex;
  }
  
  .nav-links li { width: 100%; text-align: center; margin-bottom: 1rem; }
  .nav-links li .btn { width: 100%; justify-content: center; }

  .hero-section { grid-template-columns: 1fr; text-align: center; gap: 3rem; padding: 4rem 1.5rem; margin-top: 4rem; }
  .hero-content h1 { font-size: 2.8rem; }
  .hero-actions { justify-content: center; }
  .section-wrapper { padding: 4rem 1.5rem; }
  .features-grid { grid-template-columns: 1fr; }
  .landing-header { padding: 1rem 1.5rem; }
  
  /* Portal & Sidebar Layouts */
  .portal-layout { grid-template-columns: 1fr; position: relative; }
  
  .mobile-sidebar-btn {
    display: inline-flex;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
    margin-right: 1rem;
  }
  
  .portal-header-left { display: flex; align-items: center; }
  
  .portal-sidebar { 
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    height: 100vh;
    z-index: 2000;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-glass);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }
  
  .portal-sidebar.active {
    transform: translateX(0);
  }
  
  .sidebar-header { display: flex; } /* Show header in sidebar again */
  .sidebar-nav { flex-direction: column; gap: 0.5rem; margin: 1.5rem 0; }
  .nav-item { padding: 0.75rem 1rem; text-align: left; justify-content: flex-start; }
  .nav-item span { display: inline; } /* Show text */
  .nav-item i { margin-right: 1rem; font-size: 1.1rem; }
  
  .portal-content { padding-bottom: 2rem; padding-top: 1.5rem; }
  
  .charts-grid { grid-template-columns: 1fr; height: auto; }
  .two-col-grid { grid-template-columns: 1fr; }
  .playground-container { grid-template-columns: 1fr; height: 900px; }
  .dashboard-split { flex-direction: column; }
  .form-row { grid-template-columns: 1fr; }
  .landing-footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  
  /* Tables - Responsive Cards */
  .table-container {
    background: transparent;
    border: none;
    padding: 0;
    overflow: visible;
  }
  .data-table, 
  .data-table thead, 
  .data-table tbody, 
  .data-table th, 
  .data-table td, 
  .data-table tr { 
    display: block; 
  }
  .data-table thead tr { 
    position: absolute;
    top: -9999px;
    left: -9999px;
  }
  .data-table tr {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    margin-bottom: 1rem;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  }
  .data-table tr:hover {
    background: var(--bg-tertiary); /* disable row hover */
  }
  .data-table td { 
    border: none;
    border-bottom: 1px solid var(--border-glass); 
    position: relative;
    padding: 0.5rem 0 0.5rem 40%; 
    min-height: 2.5rem;
    text-align: right;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
  }
  .data-table td:last-child {
    border-bottom: 0;
  }
  .data-table td::before { 
    content: attr(data-label);
    position: absolute;
    left: 0;
    width: 35%; 
    padding-right: 10px; 
    white-space: normal;
    word-wrap: break-word;
    text-align: left;
    font-weight: 600;
    color: var(--text-lavender);
    font-size: 0.75rem;
  }
}

@media (max-width: 640px) {
  .hero-badge-grid { grid-template-columns: 1fr 1fr; gap: 0.85rem; }
  .metrics-grid { grid-template-columns: 1fr; }
  .portal-content { padding: 1.25rem; padding-bottom: 80px; }
  .chat-bot-fab { bottom: 85px; right: 15px; } /* Lift FAB above bottom nav */
  .chat-bot-window { bottom: 150px; right: 15px; width: calc(100% - 30px); height: 500px; }
  
  .portal-header-left h2 { font-size: 1.25rem; }
  .portal-header-left p { font-size: 0.8rem; }
  
  /* Global Modal/Dialog Responsive Overrides (Floating Centered) */
  dialog {
    min-width: 0 !important;
    max-width: 100% !important;
    width: calc(100% - 2.5rem) !important;
    margin: auto !important;
    padding: 1.5rem !important;
    border-radius: 24px !important;
    border: 1px solid var(--border-glass) !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
    animation: fade-up 0.3s ease forwards;
  }

  /* Compact 2x2 Metrics for Android App Feel */
  .metrics-grid, .stat-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 0.75rem; 
  }
  .metric-card { 
    display: flex; 
    flex-direction: column;
    align-items: flex-start; 
    justify-content: flex-start; 
    padding: 1rem; 
    border-radius: 12px;
    height: auto;
    position: relative;
  }
  .metric-card .metric-header { 
    display: flex;
    flex-direction: column; 
    gap: 0.5rem; 
    margin-bottom: 0.5rem; 
    font-size: 0.8rem;
    align-items: flex-start;
  }
  .metric-card .metric-header span { display: block; line-height: 1.2; color: var(--text-muted); }
  .metric-card .metric-header i { font-size: 1.25rem; }
  .metric-card .metric-value { 
    font-size: 1.5rem; 
    margin-bottom: 0; 
    text-align: left;
    width: 100%;
  }
  .metric-card .metric-footer { 
    display: none; /* Hide footer for compact look */
  }
  
  /* Remove the manually injected data-title logic since span is visible again */
  .metric-card::after { content: none; }
  
  /* Curriculum Timeline Mobile Overrides */
  .curriculum-timeline {
    margin-left: 0.5rem;
    padding-left: 1rem;
    gap: 1.5rem;
  }
  .module-marker {
    left: -1.45rem;
    width: 1rem;
    height: 1rem;
    border-width: 2px;
  }
  .module-content {
    padding: 1rem;
  }
  .module-title {
    font-size: 1.15rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
  }
  .topic-row {
    padding: 0.75rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
  }
  .topic-info {
    width: 100%;
    align-items: flex-start;
  }
  .topic-icon {
    width: 24px;
    height: 24px;
    font-size: 0.7rem;
    flex-shrink: 0;
  }
  .topic-name {
    font-size: 0.95rem;
  }
  .topic-btn {
    width: 100%;
    text-align: center;
  }
  .topic-status {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }
  .stat-card { padding: 1rem !important; }
  .stat-card .stat-title { font-size: 0.8rem; }
  .stat-card .stat-value { font-size: 1.5rem !important; }

  /* Table paradigm moved to 968px */
  
  /* Sub-tab nav compact (Buttons on top, tabs below) */
  .sub-tabs-nav {
    flex-direction: row !important;
    flex-wrap: wrap-reverse !important;
    justify-content: center !important;
    gap: 1rem;
    padding: 1rem;
  }
  .sub-tabs-nav > div:first-child {
    /* Tab wrapper (first div) */
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    padding-bottom: 0.25rem;
    flex-wrap: nowrap;
    justify-content: flex-start; /* tabs align left */
  }
  /* Hide scrollbar for a cleaner mobile look */
  .sub-tabs-nav > div:first-child::-webkit-scrollbar {
    display: none;
  }
  
  .sub-tabs-nav > div:not(:first-child) {
    /* Action buttons wrapper (if any) */
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    width: 100%;
  }
  .sub-tabs-nav .btn {
    font-size: 0.85rem;
    white-space: nowrap;
    flex-shrink: 0;
  }
  
  /* Global center-alignment for action buttons on mobile */
  .card-title-border {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 1rem;
  }
  .card-title-border h3 {
    text-align: center !important;
    width: 100% !important; /* Forces buttons to wrap to next line */
  }
  
  .no-wrap-header {
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
  }
  .no-wrap-header h3 {
    width: auto !important;
    text-align: left !important;
  }

  .portal-header-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    gap: 0.75rem;
  }
  
  .job-listing-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .job-listing-card .btn {
    width: 100%;
    margin-top: 0.5rem;
  }
  
  .resume-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    width: 100%;
  }
  .resume-actions .btn {
    width: 100%;
    padding: 0.75rem;
    font-size: 0.85rem;
  }
  .resume-actions .btn-history {
    grid-column: 1 / -1;
  }
  
  .glass-panel { padding: 1rem; }
}
