/* assets/css/style.css - PHYLAB AI 4.0 Pro Modern Design System */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

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

  /* Color Tokens - High Contrast Modern Scientific Deep Space & Neon Cyan */
  --bg-dark: #070b14;
  --bg-card: rgba(15, 23, 42, 0.85);
  --bg-card-hover: rgba(30, 41, 59, 0.95);
  --bg-sidebar: #090e1a;
  --bg-navbar: rgba(9, 14, 26, 0.92);
  --border-color: rgba(56, 189, 248, 0.22);
  --border-focus: rgba(0, 242, 254, 0.6);

  /* High Contrast Bright Text Tokens */
  --text-primary: #ffffff;
  --text-secondary: #f1f5f9;
  --text-muted: #cbd5e1;

  /* Vibrant Cyber-Neon Color Palette for High School Students */
  --primary: #00f2fe;
  --primary-gradient: linear-gradient(135deg, #00f2fe 0%, #38bdf8 100%);
  --cyber-gradient: linear-gradient(135deg, #00f2fe 0%, #a855f7 50%, #facc15 100%);
  --sunset-gradient: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  --emerald-gradient: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  --purple-gradient: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
  --rose-gradient: linear-gradient(135deg, #f43f5e 0%, #fb7185 100%);
  
  --accent-purple: #a855f7;
  --accent-purple-gradient: linear-gradient(135deg, #c084fc 0%, #818cf8 100%);
  --accent-emerald: #34d399;
  --accent-amber: #fbbf24;
  --accent-rose: #fb7185;

  --glow-primary: 0 0 25px rgba(0, 242, 254, 0.45);
  --glow-purple: 0 0 25px rgba(168, 85, 247, 0.45);
  --glow-amber: 0 0 25px rgba(250, 204, 21, 0.45);
  --glow-emerald: 0 0 25px rgba(52, 211, 153, 0.45);
  --glow-rose: 0 0 25px rgba(251, 113, 133, 0.45);
  --glass-shadow: 0 10px 40px 0 rgba(0, 0, 0, 0.55);

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light theme overrides */
[data-theme="light"] {
  --bg-dark: #f8fafc;
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-card-hover: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-navbar: rgba(255, 255, 255, 0.95);
  --border-color: rgba(203, 213, 225, 0.8);
  --border-focus: #0284c7;

  --text-primary: #0f172a;
  --text-secondary: #1e293b;
  --text-muted: #475569;
  --primary: #0284c7;
  --primary-gradient: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
}

/* High Contrast Mode */
[data-contrast="high"] {
  --bg-dark: #000000;
  --bg-card: #050505;
  --bg-sidebar: #000000;
  --border-color: #ffffff;
  --text-primary: #ffffff;
  --text-secondary: #ffff00;
  --text-muted: #ffffff;
  --primary: #00ffff;
}

/* Custom Sleek Dark Scrollbars */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.35) rgba(11, 17, 32, 0.6);
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(11, 17, 32, 0.6);
}

::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 242, 254, 0.7);
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

/* Force bright readable text across all bootstrap helpers */
.text-secondary {
  color: #e2e8f0 !important;
}

.text-muted {
  color: #cbd5e1 !important;
}

.text-dark {
  color: #0f172a !important;
}

.text-light {
  color: #ffffff !important;
}

.bg-dark {
  background-color: rgba(15, 23, 42, 0.95) !important;
  color: #ffffff !important;
}

.border-secondary {
  border-color: rgba(56, 189, 248, 0.25) !important;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition-smooth);
}

a:hover {
  color: #38bdf8;
}

/* Glassmorphism Card with Colorful Edge Glow */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--glass-shadow);
  transition: var(--transition-smooth);
  overflow: hidden;
}

.glass-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
}

.glass-card-interactive:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(0, 242, 254, 0.22);
}

/* Colorful Simulator Specialty Cards */
.card-theme-cyan {
  border: 1px solid rgba(0, 242, 254, 0.35) !important;
  background: radial-gradient(circle at 100% 0%, rgba(0, 242, 254, 0.12) 0%, rgba(15, 23, 42, 0.9) 70%) !important;
}
.card-theme-cyan:hover {
  border-color: #00f2fe !important;
  box-shadow: var(--glow-primary) !important;
  transform: translateY(-4px);
}

.card-theme-amber {
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
  background: radial-gradient(circle at 100% 0%, rgba(245, 158, 11, 0.12) 0%, rgba(15, 23, 42, 0.9) 70%) !important;
}
.card-theme-amber:hover {
  border-color: #f59e0b !important;
  box-shadow: var(--glow-amber) !important;
  transform: translateY(-4px);
}

.card-theme-emerald {
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
  background: radial-gradient(circle at 100% 0%, rgba(16, 185, 129, 0.12) 0%, rgba(15, 23, 42, 0.9) 70%) !important;
}
.card-theme-emerald:hover {
  border-color: #10b981 !important;
  box-shadow: var(--glow-emerald) !important;
  transform: translateY(-4px);
}

.card-theme-purple {
  border: 1px solid rgba(168, 85, 247, 0.35) !important;
  background: radial-gradient(circle at 100% 0%, rgba(168, 85, 247, 0.12) 0%, rgba(15, 23, 42, 0.9) 70%) !important;
}
.card-theme-purple:hover {
  border-color: #a855f7 !important;
  box-shadow: var(--glow-purple) !important;
  transform: translateY(-4px);
}

.card-theme-rose {
  border: 1px solid rgba(244, 63, 94, 0.35) !important;
  background: radial-gradient(circle at 100% 0%, rgba(244, 63, 94, 0.12) 0%, rgba(15, 23, 42, 0.9) 70%) !important;
}
.card-theme-rose:hover {
  border-color: #f43f5e !important;
  box-shadow: var(--glow-rose) !important;
  transform: translateY(-4px);
}

.card-theme-sky {
  border: 1px solid rgba(14, 165, 233, 0.35) !important;
  background: radial-gradient(circle at 100% 0%, rgba(14, 165, 233, 0.12) 0%, rgba(15, 23, 42, 0.9) 70%) !important;
}
.card-theme-sky:hover {
  border-color: #0ea5e9 !important;
  box-shadow: 0 0 25px rgba(14, 165, 233, 0.45) !important;
  transform: translateY(-4px);
}

/* Callout Info Boxes */
.callout-box {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  color: #ffffff;
}

.callout-box-warning {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-left: 4px solid var(--accent-amber);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  color: #ffffff;
}

/* Colorful Gradient Texts & Accents */
.text-gradient {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-cyber {
  background: var(--cyber-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-purple {
  background: var(--accent-purple-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-sunset {
  background: var(--sunset-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-emerald {
  background: var(--emerald-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Buttons with Vibrant Neon Variations */
.btn-neon {
  background: var(--primary-gradient);
  color: #040812 !important;
  font-weight: 800;
  border: none;
  border-radius: var(--radius-full);
  padding: 9px 22px;
  font-family: var(--font-heading);
  box-shadow: var(--glow-primary);
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-neon:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 30px rgba(0, 242, 254, 0.7);
  color: #000 !important;
}

.btn-neon-amber {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #040812 !important;
  font-weight: 800;
  border: none;
  border-radius: var(--radius-full);
  padding: 9px 22px;
  font-family: var(--font-heading);
  box-shadow: var(--glow-amber);
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-neon-amber:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 30px rgba(250, 204, 21, 0.75);
  color: #000 !important;
}

.btn-neon-emerald {
  background: var(--emerald-gradient);
  color: #040812 !important;
  font-weight: 800;
  border: none;
  border-radius: var(--radius-full);
  padding: 9px 22px;
  font-family: var(--font-heading);
  box-shadow: var(--glow-emerald);
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-neon-emerald:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 30px rgba(52, 211, 153, 0.75);
  color: #000 !important;
}

.btn-neon-rose {
  background: var(--rose-gradient);
  color: #ffffff !important;
  font-weight: 800;
  border: none;
  border-radius: var(--radius-full);
  padding: 9px 22px;
  font-family: var(--font-heading);
  box-shadow: var(--glow-rose);
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-neon-rose:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 30px rgba(251, 113, 133, 0.75);
  color: #ffffff !important;
}

.btn-outline-neon {
  background: transparent;
  color: var(--primary) !important;
  font-weight: 600;
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-full);
  padding: 8px 20px;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-outline-neon:hover {
  background: rgba(0, 242, 254, 0.15);
  box-shadow: var(--glow-primary);
  transform: translateY(-2px);
}

.btn-purple {
  background: var(--accent-purple-gradient);
  color: #070b14 !important;
  font-weight: 800;
  border: none;
  border-radius: var(--radius-full);
  padding: 9px 22px;
  box-shadow: var(--glow-purple);
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-purple:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 35px rgba(168, 85, 247, 0.6);
}

/* Badges & Pills */
.badge-neon {
  background: rgba(0, 242, 254, 0.15);
  color: #00f2fe;
  border: 1px solid rgba(0, 242, 254, 0.4);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.badge-amber {
  background: rgba(250, 204, 21, 0.15);
  color: #facc15;
  border: 1px solid rgba(250, 204, 21, 0.4);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-formula {
  background: rgba(15, 23, 42, 0.95);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 600;
  max-width: 100%;
  word-break: break-word;
  white-space: normal;
  display: inline-block;
}

.badge-purple {
  background: rgba(168, 85, 247, 0.18);
  color: #e9d5ff;
  border: 1px solid rgba(168, 85, 247, 0.4);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-emerald {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-rose {
  background: rgba(244, 63, 94, 0.18);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.4);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
}

/* Layout Framework: Frozen Fixed Sidebar + Independent Main Content Scrolling */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
}

.app-sidebar {
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  height: 100vh;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow-y: auto;
  overflow-x: hidden;
  transition: var(--transition-smooth);
}

.sidebar-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.sidebar-menu {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-heading {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #38bdf8;
  padding: 10px 12px 4px;
}

.nav-item-custom {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: #f1f5f9;
  border-radius: var(--radius-md);
  margin-bottom: 4px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition-smooth);
  border-left: 3px solid transparent;
}

.nav-item-custom i {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
  color: #cbd5e1;
  transition: var(--transition-smooth);
}

.nav-item-custom:hover {
  background: rgba(250, 204, 21, 0.12);
  color: #facc15;
  border-left: 3px solid #facc15;
}

.nav-item-custom:hover i {
  color: #facc15;
}

/* Active State: Vivid Glowing Gold (#facc15 / #fbbf24) */
.nav-item-custom.active {
  background: linear-gradient(90deg, rgba(250, 204, 21, 0.2) 0%, rgba(250, 204, 21, 0.05) 100%);
  color: #facc15 !important;
  font-weight: 800;
  border-left: 4px solid #facc15;
  box-shadow: 0 4px 20px rgba(250, 204, 21, 0.15);
}

.nav-item-custom.active i {
  color: #facc15 !important;
  text-shadow: 0 0 12px rgba(250, 204, 21, 0.8);
}

/* Landing Page Nav Links with Gold Active/Hover */
.landing-nav-link {
  color: #f1f5f9 !important;
  font-weight: 600;
  padding: 8px 16px !important;
  border-radius: var(--radius-full);
  transition: var(--transition-smooth);
}

.landing-nav-link:hover,
.landing-nav-link.active {
  color: #facc15 !important;
  background: rgba(250, 204, 21, 0.15);
  text-shadow: 0 0 10px rgba(250, 204, 21, 0.7);
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

/* App Main Container (Frozen Sidebar Layout) */
.app-main {
  flex: 1 1 auto;
  min-width: 0;
  width: calc(100% - 260px);
  max-width: calc(100% - 260px);
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
  transition: var(--transition-smooth);
}

.app-navbar {
  height: 66px;
  background: var(--bg-navbar);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 999;
  width: 100%;
  max-width: 100%;
}

.app-content {
  flex: 1 1 auto;
  padding: 24px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

/* Mobile Sidebar Toggle */
@media (max-width: 992px) {
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
  }
  .app-sidebar.show {
    transform: translateX(0);
  }
  .app-main {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .app-content {
    padding: 16px;
  }
}

/* Custom Progress Bar */
.progress-neon {
  height: 8px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-neon-bar {
  height: 100%;
  background: var(--primary-gradient);
  border-radius: var(--radius-full);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.5);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom Metric Card */
.stat-box {
  padding: 18px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.stat-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary-gradient);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  background: rgba(0, 242, 254, 0.15);
  color: var(--primary);
}

/* AI Tutor Chatbox */
.chat-container {
  height: 520px;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  background: rgba(11, 17, 32, 0.95);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

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

.chat-bubble {
  max-width: 80%;
  padding: 14px 18px;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.5;
  animation: fadeIn 0.3s ease;
}

.chat-bubble.ai {
  align-self: flex-start;
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #f8fafc;
  border-bottom-left-radius: 4px;
}

.chat-bubble.user {
  align-self: flex-end;
  background: var(--primary-gradient);
  color: #040812;
  font-weight: 600;
  border-bottom-right-radius: 4px;
}

.chat-input-area {
  padding: 16px;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid var(--border-color);
}

/* Code Editor Window */
.code-editor-box {
  background: #0d1117;
  border-radius: var(--radius-md);
  border: 1px solid #30363d;
  overflow: hidden;
  font-family: var(--font-mono);
}

.editor-header {
  background: #161b22;
  padding: 10px 16px;
  border-bottom: 1px solid #30363d;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.editor-dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.editor-textarea {
  width: 100%;
  height: 240px;
  background: transparent;
  color: #e6edf3;
  border: none;
  outline: none;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.6;
  resize: vertical;
}

.output-console {
  background: #090d13;
  border-top: 1px solid #30363d;
  padding: 16px;
  color: #34d399;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  min-height: 100px;
  max-height: 180px;
  overflow-y: auto;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 15px rgba(0, 242, 254, 0.3); }
  50% { box-shadow: 0 0 30px rgba(0, 242, 254, 0.7); }
}

.glow-animation {
  animation: pulseGlow 3s infinite;
}
