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

/* --- CUSTOM PROPERTIES & THEMES --- */
:root {
  /* Dark Mode (Default) */
  --bg-primary: #080b11;
  --bg-secondary: #0d131f;
  --bg-card: rgba(20, 27, 43, 0.7);
  --bg-glass: rgba(13, 19, 31, 0.75);
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(0, 242, 254, 0.35);
  
  --accent-blue: #00f2fe;
  --accent-purple: #a855f7;
  --accent-pink: #ec4899;
  --accent-green: #10b981;
  --accent-yellow: #f59e0b;
  
  --gradient-neon: linear-gradient(135deg, #00f2fe 0%, #4f46e5 50%, #a855f7 100%);
  --gradient-card: linear-gradient(145deg, rgba(20, 27, 43, 0.9) 0%, rgba(13, 19, 31, 0.95) 100%);
  --gradient-purple: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  --gradient-blue: linear-gradient(135deg, #00f2fe 0%, #3b82f6 100%);
  
  --shadow-glow: 0 0 20px rgba(0, 242, 254, 0.15);
  --shadow-purple: 0 0 20px rgba(168, 85, 247, 0.2);
  --shadow-box: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  
  --font-sans: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-width: 280px;
}

[data-theme="light"] {
  /* Light Mode Values */
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.8);
  --bg-glass: rgba(248, 250, 252, 0.85);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --border-color: rgba(15, 23, 42, 0.08);
  --border-hover: rgba(99, 102, 241, 0.4);
  
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-pink: #d946ef;
  --accent-green: #059669;
  --accent-yellow: #d97706;
  
  --gradient-neon: linear-gradient(135deg, #3b82f6 0%, #6366f1 50%, #8b5cf6 100%);
  --gradient-card: linear-gradient(145deg, rgba(255, 255, 255, 0.95) 0%, rgba(241, 245, 249, 0.98) 100%);
  
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.1);
  --shadow-purple: 0 0 20px rgba(139, 92, 246, 0.12);
  --shadow-box: 0 8px 32px 0 rgba(15, 23, 42, 0.08);
}

/* --- GENERAL RESET & BASE --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  transition: var(--transition-smooth);
}

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

/* --- APP LAYOUT --- */
.app-container {
  display: flex;
  width: 100%;
  position: relative;
}

/* Sidebar navigation */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  transition: var(--transition-smooth);
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.logo-section img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--accent-blue);
  box-shadow: var(--shadow-glow);
}

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

.logo-title {
  font-weight: 700;
  font-size: 1.25rem;
  background: var(--gradient-neon);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

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

.nav-item {
  width: 100%;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 12px;
  transition: var(--transition-smooth);
  cursor: pointer;
  border: 1px solid transparent;
}

.nav-link i {
  font-size: 1.1rem;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background: var(--bg-card);
  border-color: var(--border-color);
}

.nav-link.active {
  border-left: 3px solid var(--accent-blue);
  border-radius: 6px 12px 12px 6px;
  background: rgba(0, 242, 254, 0.06);
}

/* User section in sidebar */
.sidebar-user {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  border: 2px solid var(--border-color);
}

.user-details {
  display: flex;
  flex-direction: column;
  max-width: 140px;
}

.user-name {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.logout-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  margin-left: auto;
  font-size: 1.1rem;
  transition: var(--transition-smooth);
}

.logout-btn:hover {
  color: var(--accent-pink);
}

/* --- MAIN CONTENT AREA --- */
.main-wrapper {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: var(--transition-smooth);
}

header {
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 90;
  transition: var(--transition-smooth);
}

.header-title-section {
  display: flex;
  flex-direction: column;
}

.header-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.header-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* --- BUTTONS & CONTROLS --- */
.theme-toggle-btn, .action-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.6rem;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: var(--transition-smooth);
}

.theme-toggle-btn:hover, .action-btn:hover {
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-glow);
}

.btn-primary {
  background: var(--gradient-neon);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 14px rgba(0, 242, 254, 0.3);
  transition: var(--transition-smooth);
  text-decoration: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 242, 254, 0.4);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
}

.btn-secondary:hover {
  border-color: var(--accent-blue);
  background: rgba(0, 242, 254, 0.05);
}

/* --- PAGES CONTENT CONTAINER --- */
.content-body {
  padding: 2rem;
  flex-grow: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.page-view {
  display: none;
  animation: fadeIn 0.4s ease-out forwards;
}

.page-view.active {
  display: block;
}

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

/* --- GLASS CARD DESIGN --- */
.card-glass {
  background: var(--gradient-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: var(--shadow-box);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

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

/* --- 1. DASHBOARD PAGE --- */
.welcome-banner {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
  border: 1px solid var(--border-hover);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  box-shadow: var(--shadow-glow);
}

.welcome-logo {
  width: 100px;
  height: 100px;
  border-radius: 20px;
  object-fit: cover;
  border: 2px solid var(--accent-blue);
  box-shadow: var(--shadow-glow);
}

.welcome-info h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.welcome-info p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.designer-badge {
  font-family: 'Outfit', sans-serif;
  font-style: italic;
  font-weight: 600;
  background: var(--gradient-neon);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 1.25rem;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
}

.stat-icon.blue { background: var(--gradient-blue); box-shadow: var(--shadow-glow); }
.stat-icon.purple { background: var(--gradient-purple); box-shadow: var(--shadow-purple); }
.stat-icon.pink { background: linear-gradient(135deg, #ec4899, #f43f5e); }

.stat-details {
  display: flex;
  flex-direction: column;
}

.stat-val {
  font-size: 1.75rem;
  font-weight: 700;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Dashboard Two-Column Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.chapter-progress-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.prog-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
}

.prog-num {
  font-weight: 700;
  color: var(--accent-blue);
  font-size: 1.1rem;
}

.prog-details {
  flex-grow: 1;
}

.prog-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.prog-bar-container {
  width: 100px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.35rem;
}

.prog-bar {
  height: 100%;
  background: var(--accent-blue);
  width: 0%;
}

.prog-bar.completed {
  background: var(--accent-green);
  width: 100%;
}

.prog-status-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-weight: 600;
}

.prog-status-badge.complete {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
}

.prog-status-badge.todo {
  background: rgba(107, 114, 128, 0.15);
  color: var(--text-secondary);
}

/* Quick Terminal Widget */
.terminal-widget {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.widget-code-area {
  background: #05070c;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  min-height: 150px;
  margin: 1rem 0;
  color: #10b981;
  resize: none;
  outline: none;
}

/* --- 2. LEARNING CENTER PAGE --- */
.learn-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
}

.learn-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chapter-btn {
  width: 100%;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chapter-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent-blue);
}

.chapter-btn.active {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.08) 0%, rgba(79, 70, 229, 0.08) 100%);
  border-color: var(--accent-blue);
  color: var(--text-primary);
}

.chapter-btn i {
  font-size: 1.1rem;
}

.chapter-btn.completed i.fa-circle-check {
  color: var(--accent-green);
}

/* Chapter Main Content */
.learn-content {
  min-height: 600px;
  display: flex;
  flex-direction: column;
}

.learn-body-html {
  line-height: 1.7;
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-top: 1.5rem;
  flex-grow: 1;
}

.learn-body-html h3 {
  color: var(--text-primary);
  font-size: 1.5rem;
  margin: 1.5rem 0 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.learn-body-html h4 {
  color: var(--text-primary);
  font-size: 1.2rem;
  margin: 1.25rem 0 0.5rem 0;
}

.learn-body-html p {
  margin-bottom: 1rem;
}

.learn-body-html ul, .learn-body-html ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.learn-body-html li {
  margin-bottom: 0.5rem;
}

.learn-body-html pre {
  background: #05070c;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  overflow-x: auto;
  margin: 1.25rem 0;
  position: relative;
}

.learn-body-html code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--accent-blue);
}

.learn-body-html pre code {
  background: transparent;
  padding: 0;
  color: #a855f7; /* Default neon */
}

/* Chapter Terminology Corner */
.term-corner-box {
  background: rgba(168, 85, 247, 0.04);
  border: 1px dashed var(--accent-purple);
  border-radius: 14px;
  padding: 1.25rem;
  margin-top: 2rem;
}

.term-corner-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--accent-purple);
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

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

.term-card-small {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  border-radius: 10px;
}

.term-word-small {
  font-weight: 700;
  color: var(--accent-blue);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.term-def-small {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Chapter Complete Action Area */
.chapter-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

/* --- 3. CODE PLAYGROUND PAGE --- */
.playground-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
  height: 620px;
}

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

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

.editor-wrapper {
  flex-grow: 1;
  position: relative;
  margin-top: 1rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.editor-textarea {
  width: 100%;
  height: 100%;
  background: #05070c;
  color: #f3f4f6;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  padding: 1rem;
  resize: none;
  outline: none;
  border: none;
  line-height: 1.5;
}

.console-pane {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.console-output {
  flex-grow: 1;
  background: #020306;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-top: 1rem;
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #10b981; /* neon-green */
  overflow-y: auto;
  white-space: pre-wrap;
}

.console-output.error {
  color: #ef4444; /* red */
}

/* --- 4. 50+ PROGRAMS CATALOG PAGE --- */
.catalog-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.search-input {
  flex-grow: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-family: var(--font-sans);
  outline: none;
  font-size: 0.95rem;
}

.search-input:focus {
  border-color: var(--accent-blue);
}

.filter-select {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-family: var(--font-sans);
  outline: none;
  cursor: pointer;
}

.programs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.program-card {
  cursor: pointer;
}

.prog-cat-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-blue);
  margin-bottom: 0.5rem;
  display: inline-block;
  letter-spacing: 0.05em;
}

.program-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.program-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.program-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--accent-purple);
  font-weight: 600;
}

/* Modal styling for Program Detail View */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

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

.modal-body {
  overflow-y: auto;
  padding: 1.5rem 0;
  flex-grow: 1;
}

.modal-desc {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.modal-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.modal-code-wrapper {
  background: #05070c;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  font-family: var(--font-mono);
  overflow-x: auto;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.modal-exp {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
}

.modal-exp-title {
  font-weight: 700;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

/* --- 5. MCQ PRACTICE PAGE --- */
.practice-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
}

.quiz-setup-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.setup-title {
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.difficulty-btn {
  width: 100%;
  padding: 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition-smooth);
}

.difficulty-btn:hover {
  border-color: var(--accent-blue);
  color: var(--text-primary);
}

.difficulty-btn.active {
  background: var(--gradient-neon);
  color: white;
  border: none;
  box-shadow: var(--shadow-glow);
}

.quiz-box {
  min-height: 400px;
  display: flex;
  flex-direction: column;
}

.quiz-progress-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.quiz-progress-bar-container {
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.quiz-progress-bar {
  height: 100%;
  background: var(--accent-purple);
  width: 0%;
  transition: var(--transition-smooth);
}

.quiz-question-text {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

.quiz-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.option-btn {
  width: 100%;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  text-align: left;
  cursor: pointer;
  font-size: 0.98rem;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.option-btn:hover {
  border-color: var(--accent-blue);
  background: rgba(0, 242, 254, 0.03);
}

.option-btn.selected {
  border-color: var(--accent-blue);
  background: rgba(0, 242, 254, 0.08);
}

.option-btn.correct {
  border-color: var(--accent-green);
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-green);
  font-weight: 600;
}

.option-btn.incorrect {
  border-color: var(--accent-pink);
  background: rgba(236, 72, 153, 0.1);
  color: var(--accent-pink);
  text-decoration: line-through;
}

.quiz-feedback-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  animation: slideDown 0.3s ease-out forwards;
}

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

.feedback-status {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

.feedback-status.correct { color: var(--accent-green); }
.feedback-status.incorrect { color: var(--accent-pink); }

.feedback-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.quiz-actions {
  display: flex;
  justify-content: flex-end;
}

/* --- 6. DICTIONARY / GLOSSARY PAGE --- */
.glossary-controls {
  margin-bottom: 2rem;
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.glossary-card {
  background: var(--gradient-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.25rem;
  transition: var(--transition-smooth);
}

.glossary-word {
  font-weight: 700;
  font-size: 1.15rem;
  background: var(--gradient-neon);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.glossary-chap-badge {
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(168, 85, 247, 0.15);
  color: var(--accent-purple);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 0.75rem;
}

.glossary-def {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* --- 7. AUTHENTICATION & LOGIN PAGE --- */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
}

.auth-card {
  width: 100%;
  max-width: 440px;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-header img {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--accent-blue);
  box-shadow: var(--shadow-glow);
  margin-bottom: 1rem;
}

.auth-header h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-family: var(--font-sans);
  outline: none;
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.form-input:focus {
  border-color: var(--accent-blue);
}

.auth-submit-btn {
  width: 100%;
  margin-top: 0.75rem;
  justify-content: center;
}

.auth-footer-text {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.auth-footer-text a {
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 600;
}

/* --- 8. OWNER DASHBOARD & NOTIFICATIONS --- */
.owner-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.feedback-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 500px;
  overflow-y: auto;
  margin-top: 1rem;
}

.feedback-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
}

.feedback-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.feedback-sender {
  font-weight: 700;
  color: var(--accent-blue);
}

.feedback-text-content {
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Global Real-time Toasts */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 9999;
}

.toast {
  background: rgba(13, 19, 31, 0.95);
  border: 1px solid var(--accent-blue);
  box-shadow: var(--shadow-glow);
  backdrop-filter: blur(12px);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  animation: slideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

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

/* --- FOOTER SECTION --- */
footer {
  margin-top: auto;
  padding: 2.5rem 2rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  transition: var(--transition-smooth);
}

.social-links {
  display: flex;
  gap: 1.5rem;
}

.social-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-decoration: none;
}

.social-btn:hover {
  transform: translateY(-3px);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  box-shadow: var(--shadow-glow);
}

.social-btn.email:hover { border-color: #ea4335; color: #ea4335; box-shadow: 0 0 15px rgba(234, 67, 53, 0.2); }
.social-btn.snapchat:hover { border-color: #fffc00; color: #fffc00; box-shadow: 0 0 15px rgba(255, 252, 0, 0.2); }
.social-btn.telegram:hover { border-color: #0088cc; color: #0088cc; box-shadow: 0 0 15px rgba(0, 136, 204, 0.2); }
.social-btn.insta:hover { border-color: #e1306c; color: #e1306c; box-shadow: 0 0 15px rgba(225, 48, 108, 0.2); }

.footer-copyright {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
}

/* --- MOBILE & RESPONSIVENESS (ANDROID / DESKTOP AUTO-ADJUST) --- */

/* Small screen navigation (Drawer or Bottom Nav) */
@media (max-width: 992px) {
  :root {
    --sidebar-width: 0px;
  }
  
  body {
    flex-direction: column;
  }
  
  .sidebar {
    width: 280px;
    left: -280px;
    height: 100vh;
  }
  
  .sidebar.mobile-open {
    left: 0;
  }
  
  .main-wrapper {
    margin-left: 0;
    width: 100%;
  }
  
  header {
    padding: 1rem 1.5rem;
  }
  
  /* Show responsive menu button */
  .menu-toggle-btn {
    display: flex !important;
  }
  
  .content-body {
    padding: 1.25rem;
  }
  
  .learn-grid {
    grid-template-columns: 1fr;
  }
  
  .playground-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  
  .editor-pane, .console-pane {
    height: 380px;
  }
  
  .practice-layout {
    grid-template-columns: 1fr;
  }
  
  .owner-layout {
    grid-template-columns: 1fr;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

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

/* Sidebar Backdrop overlay for mobile menu drawer */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99;
  display: none;
}

.sidebar-overlay.active {
  display: block;
}

@media (max-width: 576px) {
  .welcome-banner {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
  }
  
  .welcome-logo {
    width: 80px;
    height: 80px;
  }
  
  .welcome-info h1 {
    font-size: 1.75rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* --- EDITABLE PROFILE PICTURE --- */
.user-avatar-container {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.user-avatar-container:hover {
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-glow);
}

.avatar-edit-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.8rem;
  opacity: 0;
  transition: var(--transition-smooth);
}

.user-avatar-container:hover .avatar-edit-overlay {
  opacity: 1;
}

.user-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* --- COLLAPSIBLE SIDEBAR RULES --- */
.sidebar.collapsed {
  width: 75px;
}

.sidebar.collapsed .logo-section .logo-text,
.sidebar.collapsed .nav-links span,
.sidebar.collapsed .sidebar-user .user-details,
.sidebar.collapsed .sidebar-user .logout-btn {
  display: none !important;
}

.sidebar.collapsed .logo-section {
  justify-content: center;
  margin-bottom: 2rem;
}

.sidebar.collapsed .nav-link {
  justify-content: center;
  padding: 0.85rem;
  gap: 0;
}

.sidebar.collapsed .nav-link i {
  font-size: 1.25rem;
}

.sidebar.collapsed .sidebar-user {
  justify-content: center;
  padding-top: 1rem;
}

.main-wrapper.collapsed {
  margin-left: 75px;
  width: calc(100% - 75px);
}

/* --- SUPPORT CHAT INTERFACE --- */
.chat-layout {
  display: flex;
  height: 650px;
  padding: 0 !important;
  overflow: hidden;
}

.chat-sidebar {
  width: 280px;
  border-right: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
}

.chat-user-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
  overflow-y: auto;
  flex-grow: 1;
}

.chat-user-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition-smooth);
}

.chat-user-item:hover, .chat-user-item.active {
  background: var(--bg-card);
  border-color: var(--border-color);
}

.chat-user-item.active {
  border-left: 3px solid var(--accent-blue);
  background: rgba(0, 242, 254, 0.04);
}

.chat-user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-user-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-user-preview {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-box {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  background: rgba(0, 0, 0, 0.15);
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-glass);
}

.chat-header-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chat-header-name {
  font-weight: 700;
  font-size: 1rem;
}

.chat-header-status {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: block;
}

.chat-messages {
  flex-grow: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-bubble {
  max-width: 65%;
  padding: 0.8rem 1.1rem;
  border-radius: 16px;
  font-size: 0.92rem;
  line-height: 1.45;
  position: relative;
}

.chat-bubble.incoming {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-top-left-radius: 4px;
  color: var(--text-primary);
}

.chat-bubble.outgoing {
  align-self: flex-end;
  background: var(--gradient-blue);
  color: white;
  border-top-right-radius: 4px;
}

.chat-bubble.selected {
  outline: 2px solid var(--accent-pink);
  background-color: rgba(255,107,107,0.15);
  transform: scale(0.98);
  transition: all 0.2s ease;
}
.chat-bubble.selected.outgoing {
  background: linear-gradient(135deg, rgba(74,144,226,0.6) 0%, rgba(132,94,247,0.6) 100%);
}

.chat-bubble-meta {
  font-size: 0.7rem;
  margin-top: 0.35rem;
  display: block;
  text-align: right;
  opacity: 0.65;
}

.chat-bubble.outgoing .chat-bubble-meta {
  color: #e0f2fe;
}

.chat-bubble.incoming .chat-bubble-meta {
  color: var(--text-muted);
}

.chat-bubble img.attached-media {
  max-width: 100%;
  max-height: 250px;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  display: block;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-bubble .shared-code-block {
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.4);
  color: #10b981;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.82rem;
  white-space: pre-wrap;
  margin-top: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  max-height: 200px;
  overflow-y: auto;
}

.chat-bubble .private-label-indicator {
  font-size: 0.65rem;
  color: var(--accent-pink);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 0.35rem;
}

.chat-input-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-glass);
}

.chat-text-input {
  flex-grow: 1;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  font-family: var(--font-sans);
  outline: none;
  font-size: 0.92rem;
  transition: var(--transition-smooth);
}

.chat-text-input:focus {
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-glow);
}

.attachment-preview-bar {
  position: absolute;
  bottom: 70px;
  left: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--accent-blue);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  box-shadow: var(--shadow-glow);
  z-index: 5;
}

.private-toggle-container {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text-secondary);
  font-weight: 600;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
}

.private-toggle-container input {
  cursor: pointer;
}

/* --- PASSWORD VISIBILITY TOGGLE --- */
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-toggle {
  position: absolute;
  right: 15px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color var(--transition-smooth);
}

.password-toggle:hover {
  color: var(--text-primary);
}

/* --- NOTIFICATION BELL DROPDOWN --- */
.notif-bell-wrapper {
  position: relative;
}

.notif-bell-btn {
  position: relative;
  font-size: 1.1rem;
  padding: 0.5rem;
}

.notif-badge {
  position: absolute;
  top: -2px;
  right: -4px;
  background: var(--accent-pink);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  animation: bellPulse 2s infinite;
  box-shadow: 0 0 8px rgba(236, 72, 153, 0.5);
}

@keyframes bellPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  max-height: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-box), 0 0 30px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  overflow: hidden;
  backdrop-filter: blur(20px);
  animation: fadeSlideDown 0.2s ease-out;
}

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

.notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.notif-dropdown-header i {
  color: var(--accent-purple);
  margin-right: 0.4rem;
}

.notif-dropdown-list {
  max-height: 340px;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.notif-dropdown-list::-webkit-scrollbar {
  width: 4px;
}

.notif-dropdown-list::-webkit-scrollbar-thumb {
  background: var(--accent-blue);
  border-radius: 2px;
}

.notif-item {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: var(--transition-smooth);
  cursor: default;
}

.notif-item:hover {
  background: rgba(0, 242, 254, 0.04);
}

.notif-item-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.notif-item-msg {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.notif-item-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.notif-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.notif-empty i {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.75rem;
  opacity: 0.3;
}

/* --- MOBILE CHAT & ADMIN LAYOUT FIXES --- */
@media (max-width: 768px) {
  .chat-layout {
    flex-direction: row !important;
    height: 70vh !important;
    min-height: 500px;
  }
  .chat-sidebar {
    width: 100% !important;
    height: 100%;
    border-right: none !important;
    display: flex;
  }
  .chat-box {
    display: none !important;
    width: 100% !important;
    height: 100%;
  }
  
  /* When chat is active on mobile */
  .chat-box.active-mobile {
    display: flex !important;
  }
  .chat-sidebar.hidden-mobile {
    display: none !important;
  }
  
  .back-to-list-btn {
    display: inline-block !important;
  }
  
  /* Ensure Admin forms inputs don't overflow */
  .form-input {
    max-width: 100%;
  }
}
