/* ==========================================================================
   CCNA & CCNP Malayalam Interactive Learning Platform - Main Stylesheet
   Modern High-Performance Cisco Tech Dark & Light Theme
   ========================================================================== */

:root {
  --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Malayalam", "Manjari", "Gayathri", sans-serif;
  --font-mono: "Fira Code", "Cascadia Code", Consolas, "Courier New", monospace;
  
  /* Color Palette - Dark Mode (Default) */
  --bg-base: #070d18;
  --bg-surface: #0e1726;
  --bg-card: #141f36;
  --bg-card-hover: #1c2b4a;
  --bg-elevated: #1a2742;
  
  --border-subtle: #1e293b;
  --border-focus: #00bceb;
  --border-glow: rgba(0, 188, 235, 0.25);
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  /* Brand Cisco Accents */
  --cisco-blue: #00bceb;
  --cisco-blue-dark: #0284c7;
  --cisco-cyan: #38bdf8;
  --cisco-navy: #002c52;
  
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.2);
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #8b5cf6;
  
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.5);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  
  --header-height: 72px;
}

/* Light Theme Variables */
body.light-theme {
  --bg-base: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #f1f5f9;
  --bg-card-hover: #e2e8f0;
  --bg-elevated: #ffffff;
  
  --border-subtle: #cbd5e1;
  --border-focus: #0284c7;
  --border-glow: rgba(2, 132, 199, 0.2);
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  
  --cisco-blue: #0284c7;
  --cisco-blue-dark: #0369a1;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

/* Top App Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(14, 23, 38, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

body.light-theme .app-header {
  background: rgba(255, 255, 255, 0.95);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #00bceb 0%, #0369a1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 0 16px rgba(0, 188, 235, 0.4);
}

.brand-title-box h1 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-title-box h1 span.gradient-text {
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lang-pill {
  font-size: 0.72rem;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
}

.brand-title-box p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Header Navigation & Tools */
.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.nav-tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-card);
}

.nav-tab-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border-color: var(--cisco-blue);
  box-shadow: 0 0 12px rgba(0, 188, 235, 0.35);
}

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

.progress-widget {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  padding: 6px 14px;
  border-radius: 30px;
  border: 1px solid var(--border-subtle);
}

.progress-text {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--cisco-cyan);
}

.progress-track {
  width: 90px;
  height: 8px;
  background: var(--bg-surface);
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00bceb, #10b981);
  transition: width 0.4s ease;
}

.theme-toggle-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s;
}

.theme-toggle-btn:hover {
  border-color: var(--cisco-blue);
}

/* Course Switcher Banner */
.course-selector-bar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.course-toggle-group {
  display: flex;
  background: var(--bg-card);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.course-btn {
  background: transparent;
  border: none;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.course-btn.active {
  background: var(--cisco-blue-dark);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 188, 235, 0.3);
}

.course-info-pills {
  display: flex;
  align-items: center;
  gap: 12px;
}

.info-pill {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  padding: 4px 12px;
  border-radius: 20px;
}

/* Main Content Area */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.tab-pane {
  display: none;
  flex: 1;
  animation: fadeIn 0.25s ease forwards;
}

.tab-pane.active {
  display: flex;
  flex-direction: column;
}

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

/* Classroom Split Layout */
.classroom-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  flex: 1;
  min-height: calc(100vh - var(--header-height) - 58px);
}

/* Sidebar Module Navigation */
.syllabus-sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--header-height) - 58px);
  position: sticky;
  top: calc(var(--header-height) + 58px);
}

.sidebar-search-box {
  padding: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.search-input-wrapper {
  position: relative;
}

.search-input-wrapper input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px 10px 38px;
  color: var(--text-main);
  font-size: 0.88rem;
  outline: none;
}

.search-input-wrapper input:focus {
  border-color: var(--cisco-blue);
  box-shadow: 0 0 8px var(--border-glow);
}

.search-icon-pos {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 0.9rem;
}

.modules-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
}

.module-nav-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.module-nav-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(0, 188, 235, 0.4);
  transform: translateX(2px);
}

.module-nav-card.active {
  border-color: var(--cisco-blue);
  background: var(--bg-elevated);
  box-shadow: 0 0 14px rgba(0, 188, 235, 0.2);
}

.module-nav-card.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--cisco-blue);
  border-radius: 4px 0 0 4px;
}

.card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.domain-tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--cisco-cyan);
  letter-spacing: 0.04em;
}

.status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

.status-badge.completed {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.status-badge.in-progress {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.module-title-txt {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 4px;
}

.module-sub-txt {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.card-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Classroom Stage */
.classroom-stage {
  padding: 24px 32px;
  overflow-y: auto;
  max-height: calc(100vh - var(--header-height) - 58px);
  scroll-behavior: smooth;
}

/* Classroom View Mode Toolbar */
.class-mode-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-bottom: 20px;
}

.class-mode-toggles {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mode-toggle-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.mode-toggle-btn:hover {
  color: var(--text-main);
  background: var(--bg-card-hover);
  border-color: rgba(0, 188, 235, 0.4);
}

.mode-toggle-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border-color: var(--cisco-blue);
  box-shadow: 0 0 10px rgba(0, 188, 235, 0.35);
}

.mode-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-tool-sm {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-tool-sm:hover {
  color: var(--text-main);
  background: var(--bg-card-hover);
  border-color: var(--cisco-blue);
}

/* View Modes Behavior */
.classroom-stage.view-mode-video #lessonNotesArea {
  display: none;
}

.classroom-stage.view-mode-normal #videoPlayerBox {
  display: none;
}

.classroom-stage.view-mode-normal #lessonNotesArea {
  border-top: 2px solid var(--cisco-blue);
}

.normal-class-badge-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 188, 235, 0.08);
  border: 1px solid rgba(0, 188, 235, 0.2);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.badge-normal-class {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--cisco-cyan);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Video Stage Area */
.video-player-container {
  background: #000000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  margin-bottom: 24px;
  position: relative;
  transition: all 0.3s ease;
}
}

.video-aspect-box {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 ratio */
  height: 0;
}

.video-aspect-box iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.player-action-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  padding: 12px 20px;
  border-top: 1px solid var(--border-subtle);
}

.player-info-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-mark-completed {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-mark-completed:hover {
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.4);
}

/* Lesson Notes Content */
.lesson-content-area {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
}

.lesson-header-banner {
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 16px;
}

.lesson-main-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}

.lesson-meta-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.content-section {
  margin-bottom: 28px;
}

.content-section h3 {
  font-size: 1.2rem;
  color: var(--cisco-cyan);
  margin-bottom: 12px;
  font-weight: 700;
}

.content-section p, 
.content-section ul {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-main);
  margin-bottom: 12px;
}

.content-section ul {
  padding-left: 20px;
}

.content-section li {
  margin-bottom: 6px;
}

.malayalam-highlight-box {
  background: rgba(0, 188, 235, 0.08);
  border-left: 4px solid var(--cisco-blue);
  padding: 16px 20px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 20px 0;
}

.malayalam-highlight-box h4 {
  color: var(--cisco-cyan);
  font-size: 0.95rem;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.malayalam-highlight-box p {
  font-size: 0.9rem;
  color: var(--text-main);
  margin: 0;
}

/* CLI Code Blocks */
.cli-code-block {
  background: #090e17;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin: 18px 0;
  overflow: hidden;
}

.cli-code-header {
  background: #111a2e;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.cli-code-body {
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: #38bdf8;
  overflow-x: auto;
  white-space: pre;
}

.copy-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.copy-btn:hover {
  color: #ffffff;
  border-color: var(--cisco-blue);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 0.9rem;
}

table th, table td {
  padding: 10px 14px;
  border: 1px solid var(--border-subtle);
  text-align: left;
}

table th {
  background: var(--bg-surface);
  color: var(--cisco-cyan);
  font-weight: 700;
}

table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .classroom-layout {
    grid-template-columns: 1fr;
  }
  .syllabus-sidebar {
    position: static;
    max-height: 400px;
  }
  .classroom-stage {
    padding: 18px;
    max-height: none;
  }
}
