/* Theme Color Variables: Light Mode Default, Dark Mode Toggle */
:root {
  --bg-dark: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-sidebar: #ffffff;
  --border-color: #cbd5e1;
  
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --accent-teal: #0d9488;
  --accent-amber: #d97706;
  --accent-purple: #7c3aed;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  
  --shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
  --modal-overlay-bg: rgba(15, 23, 42, 0.7);
  --player-bg: #0f172a;
  --silhouette-fill: #cbd5e1;
  --hotspot-fill: #0ea5e9;
}

[data-theme="dark"] {
  --bg-dark: #090d16;
  --bg-card: #131b2e;
  --bg-card-hover: #1a253e;
  --bg-sidebar: #0e1626;
  --border-color: #1e2d4a;
  
  --primary: #0ea5e9;
  --primary-hover: #0284c7;
  --accent-teal: #14b8a6;
  --accent-amber: #f59e0b;
  --accent-purple: #8b5cf6;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  --modal-overlay-bg: rgba(0, 0, 0, 0.85);
  --player-bg: #000000;
  --silhouette-fill: #1e293b;
  --hotspot-fill: #38bdf8;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Header */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background-color: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  gap: 16px;
  transition: background-color 0.3s, border-color 0.3s;
}

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

.brand-icon {
  font-size: 28px;
  background: rgba(14, 165, 233, 0.15);
  padding: 8px;
  border-radius: var(--radius-md);
}

.brand-text h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

.brand-text .subtitle {
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
}

/* Search Bar */
.header-search {
  flex: 1;
  max-width: 500px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  font-size: 14px;
  color: var(--text-muted);
}

.header-search input {
  width: 100%;
  padding: 10px 40px 10px 40px;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, background 0.3s;
}

.header-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.btn-clear {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  display: none;
}

.btn-clear:hover {
  color: var(--text-main);
}

/* Global Intelligent Search Bar */
.global-search-container {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.global-search-box {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.search-lens-icon {
  position: absolute;
  left: 16px;
  font-size: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.global-search-input {
  width: 100%;
  padding: 14px 45px 14px 48px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  color: var(--text-main);
  font-size: 15px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.25s ease;
}

.global-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25);
  outline: none;
}

.btn-clear-search {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s ease;
}

.btn-clear-search:hover {
  color: #ef4444;
}

.search-badge-result {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.12);
  align-self: flex-start;
}

.stat-pill.review-pill {
  background: rgba(234, 179, 8, 0.12);
  border-color: rgba(234, 179, 8, 0.3);
  color: #eab308;
  cursor: pointer;
  transition: all 0.2s ease;
}

.stat-pill.review-pill:hover {
  background: rgba(234, 179, 8, 0.22);
  transform: translateY(-1px);
}

.daily-review-banner {
  margin-top: 16px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.12) 0%, rgba(59, 130, 246, 0.08) 100%);
  border: 1px solid rgba(234, 179, 8, 0.3);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.review-banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.review-banner-icon {
  font-size: 26px;
}

/* Student Dashboard Card & Visual Progress */
.student-dashboard-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.dashboard-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.dashboard-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: 4px 0 0 0;
}

.dashboard-overall-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 6px 14px;
  border-radius: 20px;
}

.overall-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.overall-percentage {
  font-size: 18px;
  font-weight: 800;
  color: #10b981;
}

.overall-progress-bar-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-bar-bg {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  border-radius: 6px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-meta-info {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Joint Card Progress Bar */
.joint-card-progress {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.joint-progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.joint-progress-bar-fill {
  height: 100%;
  background: #10b981;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.joint-progress-text {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  font-weight: 600;
}

/* Theme Toggle & Stats */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-theme-toggle {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-theme-toggle:hover {
  border-color: var(--primary);
  transform: scale(1.02);
}

.btn-theme-toggle.active-atlas {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.user-stats {
  display: flex;
  gap: 8px;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-dark);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  font-size: 13px;
  font-weight: 600;
}

/* Interactive Anatomical Atlas Panel */
.atlas-panel {
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 24px;
  display: none;
  animation: slideDown 0.3s ease;
}

.atlas-panel.visible {
  display: block;
}

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

.atlas-content-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 900px;
  margin: 0 auto;
}

.atlas-header {
  text-align: center;
}

.atlas-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.atlas-header p {
  font-size: 13px;
  color: var(--text-muted);
}

.atlas-body-wrapper {
  position: relative;
  width: 100%;
  max-width: 320px;
  height: 380px;
  display: flex;
  justify-content: center;
}

.body-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.1));
}

.body-silhouette {
  fill: var(--silhouette-fill);
  transition: fill 0.3s ease;
}

.nerve-path {
  stroke: var(--accent-amber);
  stroke-width: 2.5;
  stroke-dasharray: 4 2;
  fill: none;
  opacity: 0.8;
  pointer-events: none;
}

.joint-hotspot {
  cursor: pointer;
  pointer-events: all;
  transition: all 0.25s ease;
}

.joint-hotspot circle, .joint-hotspot text, .joint-hotspot path {
  cursor: pointer;
  pointer-events: all;
}

.hotspot-circle {
  fill: var(--hotspot-fill);
  opacity: 0.75;
  stroke: #ffffff;
  stroke-width: 2;
  transition: all 0.25s ease;
}

.nerve-node {
  fill: var(--accent-amber) !important;
}

.joint-hotspot:hover .hotspot-circle {
  opacity: 1;
  transform: scale(1.25);
  fill: var(--primary);
  stroke: #ffffff;
  filter: drop-shadow(0 0 8px rgba(14, 165, 233, 0.8));
}

.joint-hotspot.active-hotspot .hotspot-circle {
  opacity: 1;
  fill: var(--accent-teal);
  stroke: #ffffff;
  stroke-width: 3;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(20, 184, 166, 0.7); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 10px rgba(20, 184, 166, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(20, 184, 166, 0); }
}

.hotspot-text {
  font-size: 12px;
  pointer-events: none;
}

.hotspot-label {
  font-size: 9px;
  font-weight: 800;
  fill: var(--text-main);
  text-anchor: middle;
  opacity: 0.85;
  pointer-events: none;
}

.atlas-tooltip {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  box-shadow: var(--shadow);
  text-align: center;
  min-width: 280px;
}

/* Main Layout */
.main-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
  transition: background-color 0.3s, border-color 0.3s;
}

.nav-section h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 10px;
  font-weight: 700;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

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

.nav-item.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

.nav-item-icon {
  margin-right: 8px;
}

.nav-item-count {
  font-size: 11px;
  background: rgba(0, 0, 0, 0.08);
  padding: 2px 8px;
  border-radius: 10px;
}

[data-theme="dark"] .nav-item-count {
  background: rgba(255, 255, 255, 0.1);
}

.nav-item.active .nav-item-count {
  background: rgba(255, 255, 255, 0.25);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-btn {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

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

.filter-btn.active {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(14, 165, 233, 0.1);
}

.filter-btn.btn-clinical-nav {
  margin-top: 8px;
  background: rgba(13, 148, 136, 0.1);
  border-color: var(--accent-teal);
  color: var(--accent-teal);
  font-weight: 700;
}

.filter-btn.btn-clinical-nav.active {
  background: var(--accent-teal);
  color: #ffffff;
}

.filter-btn.btn-notebook-nav {
  background: rgba(139, 92, 246, 0.1);
  border-color: var(--accent-purple);
  color: var(--accent-purple);
  font-weight: 700;
}

.filter-btn.btn-notebook-nav.active {
  background: var(--accent-purple);
  color: #ffffff;
}

.filter-btn.btn-quiz-nav {
  background: rgba(245, 158, 11, 0.1);
  border-color: var(--accent-amber);
  color: var(--accent-amber);
  font-weight: 700;
}

.filter-btn.btn-quiz-nav.active {
  background: var(--accent-amber);
  color: #ffffff;
}

.filter-btn.btn-flashcards-nav {
  background: rgba(99, 102, 241, 0.1);
  border-color: #6366f1;
  color: #6366f1;
  font-weight: 700;
}

.filter-btn.btn-flashcards-nav.active {
  background: #6366f1;
  color: #ffffff;
}

/* Content Area */
.content-area {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Clinical Symptoms Section */
.clinical-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.clinical-section.hidden {
  display: none !important;
}

.clinical-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 14px;
}

.symptoms-explorer-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.symptoms-explorer-box h3 {
  font-size: 16px;
  font-weight: 700;
}

.symptoms-tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.symptom-tag-btn {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.symptom-tag-btn:hover {
  border-color: var(--accent-teal);
  color: var(--accent-teal);
  background: rgba(13, 148, 136, 0.1);
  transform: translateY(-2px);
}

.clinical-categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.clinical-category-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.clinical-category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent-teal);
}

.clinical-category-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.clinical-symptoms-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.clinical-symptom-item {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.clinical-symptom-item:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
  transform: translateX(4px);
}

.clinical-symptom-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.clinical-symptom-target {
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
}

/* Quiz Section */
.quiz-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.quiz-section.hidden {
  display: none !important;
}

.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 14px;
  flex-wrap: wrap;
  gap: 12px;
}

.quiz-header h2 {
  font-size: 22px;
  font-weight: 700;
}

.quiz-score-badge {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  box-shadow: var(--shadow);
}

.quiz-score-badge strong {
  color: var(--accent-teal);
  font-size: 16px;
}

.quiz-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
  gap: 12px;
}

.quiz-tool-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
}

.quiz-select {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
}

.quiz-case-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 24px;
}

.quiz-player-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quiz-video-box {
  position: relative;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.quiz-video-box video {
  width: 100%;
  max-height: 480px;
  outline: none;
}

.quiz-blind-tag {
  background: rgba(15, 23, 42, 0.95);
  color: var(--primary);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.quiz-answers-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quiz-answers-column h4 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
}

.quiz-instruction {
  font-size: 13px;
  color: var(--text-muted);
}

.quiz-options-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-option-btn {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quiz-option-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--bg-card-hover);
  transform: translateX(4px);
}

.quiz-option-btn.correct {
  background: rgba(34, 197, 94, 0.15) !important;
  border-color: #22c55e !important;
  color: #16a34a !important;
}

.quiz-option-btn.wrong {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: #ef4444 !important;
  color: #dc2626 !important;
}

.quiz-feedback-box {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: fadeIn 0.3s ease;
}

.quiz-feedback-box.hidden {
  display: none;
}

.quiz-feedback-text {
  font-size: 15px;
  font-weight: 700;
}

.quiz-feedback-text.correct-text {
  color: #16a34a;
}

.quiz-feedback-text.wrong-text {
  color: #dc2626;
}

.quiz-explanation-text {
  font-size: 13px;
  color: var(--text-muted);
}

/* Notebook Section */
.notebook-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.notebook-section.hidden {
  display: none !important;
}

.notebook-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 14px;
  flex-wrap: wrap;
  gap: 12px;
}

.notebook-header h2 {
  font-size: 22px;
  font-weight: 700;
}

.notebook-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.notebook-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow);
}

.notebook-card h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
}

.progress-bar-container {
  height: 12px;
  background: var(--bg-dark);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-teal), var(--primary));
  border-radius: 6px;
  transition: width 0.4s ease;
}

.notebook-stat-number {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary);
}

.notebook-stat-text {
  font-size: 12px;
  color: var(--text-dim);
}

/* Joint Progress Grid */
.joint-progress-block {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.joint-progress-block h3 {
  font-size: 16px;
  font-weight: 700;
}

.joint-progress-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.joint-progress-item {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.joint-progress-item-title {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Notes Log Table */
.notes-log-block {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.notes-log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.notes-log-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.notebook-search {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  width: 250px;
  outline: none;
}

.notes-table-wrapper {
  overflow-x: auto;
}

.notes-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.notes-table th {
  background: var(--bg-dark);
  padding: 10px 14px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border-color);
}

.notes-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
}

.notes-table tr:hover {
  background: var(--bg-card-hover);
}

.note-text-cell {
  max-width: 320px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-main);
}

.badge-done-small {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.badge-fav-small {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

/* Joint Cards Grid */
.joint-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.joint-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all 0.25s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow);
}

.joint-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.joint-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.joint-card-icon {
  font-size: 26px;
}

.joint-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.joint-card-stats {
  display: flex;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.joint-stat-tag {
  background: var(--bg-dark);
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s;
}

.joint-stat-tag:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.joint-stat-tag.normal-tag {
  border-left: 3px solid var(--accent-teal);
}

.joint-stat-tag.patologia-tag {
  border-left: 3px solid var(--accent-amber);
}

/* View Header */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.view-header h2 {
  font-size: 20px;
  font-weight: 700;
}

.view-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.results-badge {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

/* Section Blocks */
.media-section-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-title-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-color);
}

.section-title-header.section-normal {
  border-bottom-color: var(--accent-teal);
}

.section-title-header.section-patologia {
  border-bottom-color: var(--accent-amber);
}

.section-title-header.section-pdf {
  border-bottom-color: var(--accent-purple);
}

.section-title-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-count-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

/* Media Cards Grid */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.media-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  position: relative;
  box-shadow: var(--shadow);
}

.media-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.media-thumbnail {
  height: 140px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
}

.play-icon {
  width: 50px;
  height: 50px;
  background: rgba(14, 165, 233, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  transition: transform 0.2s;
  box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
}

.media-card:hover .play-icon {
  transform: scale(1.15);
}

.badge-cat {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-anatomia {
  background: rgba(13, 148, 136, 0.95);
  color: #fff;
}

.badge-patologia {
  background: rgba(217, 119, 6, 0.95);
  color: #fff;
}

.badge-pdf {
  background: rgba(124, 58, 237, 0.95);
  color: #fff;
}

.media-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
}

.btn-icon-action {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s;
}

.btn-icon-action:hover {
  background: #0f172a;
  color: #fff;
}

.btn-icon-action.active-fav {
  color: #facc15;
}

.btn-icon-action.active-done {
  color: #22c55e;
}

.media-content {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.media-joint-tag {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
}

.media-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: pointer;
}

.media-title:hover {
  color: var(--primary);
}

.media-folder {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: auto;
}

/* Modals & Split Workbench */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--modal-overlay-bg);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.hidden {
  display: none;
}

.modal-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 1100px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transition: max-width 0.3s ease;
}

.modal-container.has-side-pdf {
  max-width: 1550px;
}

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

.modal-title-box h3 {
  font-size: 18px;
  font-weight: 700;
  margin-top: 4px;
}

.modal-joint-tag {
  font-size: 12px;
  color: var(--primary);
  margin-left: 10px;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 28px;
  cursor: pointer;
}

.btn-close:hover {
  color: var(--text-main);
}

.modal-body {
  display: grid;
  grid-template-columns: 1fr;
  flex: 1;
  overflow: hidden;
}

.notes-column {
  display: none !important;
}

.player-column {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--player-bg);
}

.video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.video-wrapper video,
.video-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  object-fit: contain;
}

#mainVideoPlayer.hidden,
#gdrivePlayerIframe.hidden {
  display: none !important;
}

.player-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-sidebar);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 10px;
}

.tool-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-tool {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-tool:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
}

.btn-tool.btn-highlight {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--accent-purple);
  color: var(--accent-purple);
}

.btn-tool.btn-highlight.active-side-pdf {
  background: var(--accent-purple);
  color: #ffffff;
}

.speed-label {
  font-size: 12px;
  color: var(--text-muted);
}

.speed-select {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  outline: none;
}

/* Side-by-Side PDF Column */
.side-pdf-column {
  border-left: 1px solid var(--border-color);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.side-pdf-column.hidden {
  display: none !important;
}

.side-pdf-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.side-pdf-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.side-pdf-header h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.side-pdf-select {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  outline: none;
}

.side-pdf-body {
  flex: 1;
  background: #ffffff;
}

.notes-column {
  padding: 20px;
  border-left: 1px solid var(--border-color);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notes-column h4 {
  font-size: 15px;
  font-weight: 700;
}

.notes-help {
  font-size: 12px;
  color: var(--text-dim);
}

#videoNotesInput {
  flex: 1;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 13px;
  resize: none;
  outline: none;
}

#videoNotesInput:focus {
  border-color: var(--primary);
}

.video-meta-box {
  background: var(--bg-dark);
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.video-meta-box h4 {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.meta-path {
  font-size: 11px;
  color: var(--text-dim);
  word-break: break-all;
}

/* PDF Modal */
.pdf-modal-container {
  height: 90vh;
  max-width: 1000px;
}

.pdf-modal-body {
  display: block;
  height: 100%;
  padding: 0;
}

/* Print Styles */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .top-header, .sidebar, .atlas-panel, .joint-cards-grid, .view-header, .media-grid, .modal-overlay, #btnPrintNotebook, .notebook-search, .quiz-section, .clinical-section {
    display: none !important;
  }
  .app-container, .main-layout, .content-area, .notebook-section {
    height: auto !important;
    overflow: visible !important;
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .notebook-card, .joint-progress-block, .notes-log-block {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    background: #ffffff !important;
    color: #000000 !important;
    page-break-inside: avoid;
  }
  .notes-table th, .notes-table td {
    border-bottom: 1px solid #ccc !important;
    color: #000000 !important;
  }
}

/* Flashcards & Spaced Repetition Styles */
.flashcards-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.flashcards-section.hidden {
  display: none !important;
}

.flashcards-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.flashcards-stats-box {
  display: flex;
  gap: 12px;
}

.flashcards-stat-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.flashcards-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 16px 20px;
  border-radius: 14px;
  gap: 16px;
  flex-wrap: wrap;
}

/* 3D Flip Card Animation */
.flashcard-container {
  perspective: 1200px;
  max-width: 760px;
  width: 100%;
  margin: 10px auto;
  min-height: 420px;
}

.flashcard-3d {
  position: relative;
  width: 100%;
  min-height: 420px;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border-radius: 20px;
}

.flashcard-3d.flipped {
  transform: rotateY(180deg);
}

.flashcard-face {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  overflow: hidden;
}

.flashcard-front {
  background: linear-gradient(145deg, var(--bg-card) 0%, rgba(99, 102, 241, 0.04) 100%);
}

.flashcard-back {
  transform: rotateY(180deg);
  background: linear-gradient(145deg, var(--bg-card) 0%, rgba(139, 92, 246, 0.06) 100%);
}

.fc-badge-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fc-front-content, .fc-back-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px 10px;
  gap: 16px;
}

.fc-question-icon {
  font-size: 38px;
}

.fc-front-content h3 {
  font-size: 20px;
  line-height: 1.5;
  color: var(--text-main);
  max-width: 600px;
}

.fc-hint {
  font-size: 13px;
  color: var(--text-dim);
  background: rgba(99, 102, 241, 0.08);
  padding: 6px 14px;
  border-radius: 20px;
}

.fc-flip-indicator {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.fc-back-content h3 {
  font-size: 18px;
  color: var(--primary);
  margin-bottom: 4px;
}

.fc-answer-box {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-main);
  background: var(--bg-main);
  padding: 16px 20px;
  border-radius: 12px;
  border-left: 4px solid #6366f1;
  text-align: left;
  width: 100%;
  max-height: 160px;
  overflow-y: auto;
}

.fc-actions-row {
  display: flex;
  gap: 10px;
}

/* Spaced Repetition Rating Buttons Bar */
.spaced-repetition-bar {
  margin-top: 12px;
  background: rgba(0, 0, 0, 0.04);
  padding: 14px 18px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

[data-theme="dark"] .spaced-repetition-bar {
  background: rgba(255, 255, 255, 0.05);
}

.sr-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sr-buttons-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
}

.sr-btn {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.sr-btn small {
  font-size: 10px;
  font-weight: 400;
  opacity: 0.85;
}

.sr-hard {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.sr-hard:hover {
  background: #ef4444;
  color: #ffffff;
}

.sr-good {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.3);
}

.sr-good:hover {
  background: #f59e0b;
  color: #ffffff;
}

.sr-easy {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.3);
}

.sr-easy:hover {
  background: #22c55e;
  color: #ffffff;
}

.sr-mastered {
  background: rgba(99, 102, 241, 0.12);
  color: #6366f1;
  border-color: rgba(99, 102, 241, 0.3);
}

.sr-mastered:hover {
  background: #6366f1;
  color: #ffffff;
}

/* Authentication Login Overlay Modal */
.auth-overlay-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.auth-overlay-modal.hidden {
  display: none !important;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  width: 100%;
  max-width: 440px;
  padding: 36px 32px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 24px;
  text-align: center;
  animation: authPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes authPop {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.auth-icon {

/* Achievements & Anatomical Mastery Section */
.achievements-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.unlocked-badge-counter {
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.3);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  color: #eab308;
}

.unlocked-badge-counter strong {
  font-size: 16px;
  font-weight: 800;
}

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

.achievement-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.achievement-card.locked {
  opacity: 0.65;
  filter: grayscale(40%);
}

.achievement-card.unlocked {
  border-color: rgba(234, 179, 8, 0.5);
  box-shadow: 0 8px 24px rgba(234, 179, 8, 0.15);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(234, 179, 8, 0.05) 100%);
}

.achievement-card.mastered {
  border-color: rgba(16, 185, 129, 0.6);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.2);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(16, 185, 129, 0.08) 100%);
}

.achievement-medal-icon {
  font-size: 36px;
  line-height: 1;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.achievement-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.achievement-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.achievement-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

.achievement-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}

.achievement-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #eab308, #10b981);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.achievement-footer {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 4px;
}

.achievement-status {
  font-weight: 700;
}

.achievement-status.gold { color: #eab308; }
.achievement-status.green { color: #10b981; }
.achievement-status.silver { color: #94a3b8; }
.achievement-status.bronze { color: #cd7f32; }
  font-size: 44px;
  margin-bottom: 8px;
}

.auth-header h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}

.auth-header p {
  font-size: 14px;
  color: var(--text-dim);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: left;
}

.auth-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-input-group label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.auth-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-main);
  color: var(--text-main);
  font-size: 15px;
  outline: none;
  transition: all 0.2s ease;
}

.auth-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.25);
}

.auth-error-msg {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.auth-submit-btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.4);
  transition: all 0.2s ease;
  margin-top: 6px;
}

.auth-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.5);
}

.auth-footer {
  font-size: 12px;
  color: var(--text-muted);
}

/* PDF Visual Page-by-Page Book Viewer Modal */
.modal-container.pdf-book-container {
  width: 96vw;
  max-width: 1400px;
  height: 92vh;
  max-height: 950px;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  background: var(--bg-main);
  border-radius: var(--radius-lg);
}

.pdf-reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  gap: 16px;
  flex-wrap: wrap;
}

.toolbar-nav, .toolbar-zoom {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-num-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.pdf-book-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
  background: #0b0f19;
}

.pdf-thumbnails-sidebar {
  width: 240px;
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  padding: 12px;
  flex-shrink: 0;
}

.thumbnails-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.thumb-item {
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-dark);
  transition: all 0.2s ease;
  position: relative;
}

.thumb-item:hover {
  border-color: var(--primary);
  transform: scale(1.03);
}

.thumb-item.active {
  border-color: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.thumb-item img {
  width: 100%;
  height: auto;
  display: block;
}

.thumb-page-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
}

.pdf-page-viewport {
  flex: 1;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
}

.pdf-page-img-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.2s ease;
}

.pdf-book-page-img {
  max-width: 100%;
  height: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  background: #ffffff;
}





/* SINALGIA CUSTOM BRANDING & STYLES */
:root {
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: rgba(2, 132, 199, 0.12);
  --accent-sinalgia: #06b6d4;
}

.logo-icon-badge {
  font-size: 26px;
  background: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.btn-mode {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-mode.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
}

.player-mode-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 12px;
  border: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 10px;
}

.program-view-container {
  margin-top: 16px;
}

.program-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.program-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-panel);
}

.program-img-wrapper {
  padding: 20px;
  text-align: center;
  background: #0f172a;
}

.program-img-wrapper img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.video-notes-panel {
  margin-top: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px;
}

.notes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.notes-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-main);
}

.notes-hint {
  font-size: 11px;
  color: var(--text-muted);
}

#videoNotesInput {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
}

#videoNotesInput:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
}

.badge-type {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
  background: rgba(6, 182, 212, 0.15);
  color: #0891b2;
  border: 1px solid rgba(6, 182, 212, 0.3);
}


/* ENHANCED THUMBNAIL & CLINICAL CARD PRESENTATION */
.media-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  position: relative;
}

.media-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(2, 132, 199, 0.15);
  border-color: rgba(2, 132, 199, 0.4);
}

.media-thumbnail {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0f172a;
  overflow: hidden;
  cursor: pointer;
}

.media-thumbnail img.thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.media-card:hover .media-thumbnail img.thumb-img {
  transform: scale(1.05);
}

.media-thumbnail .play-overlay-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.35);
  opacity: 0;
  transition: all 0.25s ease;
}

.media-thumbnail:hover .play-overlay-btn {
  opacity: 1;
  background: rgba(15, 23, 42, 0.45);
}

.play-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(2, 132, 199, 0.9);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 0 20px rgba(2, 132, 199, 0.6);
  transform: scale(0.9);
  transition: transform 0.2s ease;
}

.media-thumbnail:hover .play-circle {
  transform: scale(1.08);
}

.card-tag-pill {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f8fafc;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
  z-index: 2;
}

.card-duration-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.8);
  color: #38bdf8;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  z-index: 2;
}

.media-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.media-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-main);
  margin-bottom: 10px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.media-title:hover {
  color: var(--primary);
}

.media-footer-row {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

.btn-play-class {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

.btn-play-class:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}
