/* Base Reset & Variables */
:root {
  --bg-dark: #070913;
  --bg-panel: rgba(13, 17, 33, 0.65);
  --bg-card: rgba(255, 255, 255, 0.03);
  --border-glass: rgba(255, 255, 255, 0.06);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --primary-color: #6366f1; /* Indigo */
  --primary-glow: rgba(99, 102, 241, 0.15);
  --secondary-color: #8b5cf6; /* Violet */
  --accent-color: #3b82f6; /* Blue */
  --success-color: #10b981; /* Emerald */
  --danger-color: #f43f5e; /* Rose */
  --warning-color: #f59e0b; /* Amber */
  
  --font-sans: 'Outfit', 'Noto Sans KR', sans-serif;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

/* Glowing Background Accents */
.bg-glow {
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  opacity: 0.25;
  pointer-events: none;
}

.bg-glow-1 {
  background: radial-gradient(circle, var(--primary-color) 0%, rgba(0,0,0,0) 70%);
  top: -100px;
  right: -50px;
}

.bg-glow-2 {
  background: radial-gradient(circle, var(--secondary-color) 0%, rgba(0,0,0,0) 70%);
  bottom: -150px;
  left: -100px;
}

/* App Container Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
  width: 280px;
  background: var(--bg-panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-glass);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.logo-icon {
  font-size: 24px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.version {
  font-size: 11px;
  background: var(--primary-color);
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 4px;
  vertical-align: super;
}

/* Child Selector in Sidebar */
.child-selector-container {
  margin-top: 32px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.child-selector-container label {
  width: 100%;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 4px;
}

.glass-select {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 8px 12px;
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.glass-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 8px var(--primary-glow);
}

.glass-select option {
  background: #111422;
  color: var(--text-primary);
}

/* Navigation items */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.nav-item {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 12px 16px;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition-smooth);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--text-primary);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.1);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-email {
  font-size: 12px;
  color: var(--text-secondary);
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 6px;
  font-weight: 600;
  text-align: center;
}

.premium-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  width: fit-content;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.25);
}

/* Main Content Layout */
.main-content {
  flex: 1;
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

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

.content-header h1 {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(to right, var(--text-primary), #d1d5db);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.current-time {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Glassmorphism Generic Elements */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
  transition: var(--transition-smooth);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.25);
}

.glass-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 8px 16px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-smooth);
}

.glass-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-icon-only {
  padding: 8px 10px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border: none;
  border-radius: 8px;
  color: #fff;
  padding: 10px 20px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
  transition: var(--transition-smooth);
}

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

.btn-primary:active {
  transform: translateY(0);
}

.w-full {
  width: 100%;
}

/* Tabs Toggle Content */
.tab-pane {
  display: none;
  animation: fadeIn 0.4s ease-in-out;
}

.tab-pane.active {
  display: block;
}

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

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

.stat-card {
  display: flex;
  align-items: center;
  gap: 20px;
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.icon-indigo {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.icon-emerald {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.icon-rose {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.25);
}

.icon-violet {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.stat-info h3 {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.stat-info p {
  font-size: 26px;
  font-weight: 700;
}

.animate-pulse {
  animation: pulse-border 2s infinite alternate;
}

@keyframes pulse-border {
  from { border-color: var(--border-glass); }
  to { border-color: rgba(244, 63, 94, 0.4); box-shadow: 0 0 15px rgba(244, 63, 94, 0.1); }
}

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

@media (max-width: 1024px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

.chart-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-container {
  position: relative;
  height: 280px;
}

/* Bottom Grid Layout */
.bottom-grid {
  display: flex;
  gap: 24px;
}

/* Mobile Navigation Button Styles */
.mobile-menu-btn {
  display: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 8px 12px;
  font-size: 18px;
  cursor: pointer;
  margin-right: 12px;
  transition: var(--transition-smooth);
}
.mobile-menu-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-close-sidebar {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 28px;
  cursor: pointer;
  transition: var(--transition-smooth);
  line-height: 1;
}
.btn-close-sidebar:hover {
  color: var(--text-primary);
}

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

.sidebar-logo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

/* Sidebar Overlay Backdrop */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 5, 12, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999;
}
.sidebar-overlay.active {
  display: block;
}

.header-left {
  display: flex;
  align-items: center;
}

@media (max-width: 768px) {
  .bottom-grid {
    flex-direction: column;
  }
  .mobile-menu-btn {
    display: inline-block;
  }
  .btn-close-sidebar {
    display: block;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    height: 100vh;
    z-index: 1000;
    transition: var(--transition-smooth);
    box-shadow: 10px 0 30px rgba(0,0,0,0.5);
    background: #0d1121;
  }
  .sidebar.active {
    left: 0;
  }
  .main-content {
    padding: 20px;
    gap: 24px;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .content-header h1 {
    font-size: 22px;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .header-actions {
    display: none;
  }
}

.flex-2 { flex: 2; }
.flex-1 { flex: 1; }

.bottom-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Vulnerable List */
.vulnerable-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.vulnerable-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
}

.vulnerable-name {
  font-weight: 500;
  font-size: 14px;
}

.vulnerable-name small {
  display: block;
  color: var(--text-secondary);
  margin-top: 2px;
}

.vuln-stat {
  text-align: right;
}

.vuln-badge {
  background: rgba(244, 63, 94, 0.15);
  color: var(--danger-color);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

/* Notifications Box */
.notification-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notif-item {
  padding: 12px;
  border-radius: 10px;
  background: rgba(244, 63, 94, 0.05);
  border-left: 4px solid var(--danger-color);
  font-size: 13px;
  line-height: 1.5;
}

.notif-item.info {
  background: rgba(59, 130, 246, 0.05);
  border-left: 4px solid var(--accent-color);
}

.notif-time {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  font-weight: 600;
}

/* Tab 2: Mistakes Manager Styles */
.mistakes-actions-bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.glass-input-group {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 0 16px;
  flex: 1;
  max-width: 400px;
}

.glass-input-group i {
  color: var(--text-secondary);
  margin-right: 12px;
}

.glass-input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  padding: 10px 0;
  width: 100%;
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
}

.glass-textarea {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 12px;
  width: 100%;
  min-height: 100px;
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  resize: vertical;
  transition: var(--transition-smooth);
}

.glass-textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 8px var(--primary-glow);
}

.table-container {
  overflow-x: auto;
  padding: 0;
}

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

.glass-table th,
.glass-table td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-glass);
}

.glass-table th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 13px;
  text-transform: uppercase;
}

.glass-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.01);
}

.badge-subject {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 6px;
}

.badge-topic {
  font-size: 13px;
  color: var(--text-secondary);
}

.badge-stage {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success-color);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.badge-accent {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-color);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

/* Modals styles */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 5, 12, 0.85);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
}

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

.modal-content {
  width: 100%;
  max-width: 550px;
  animation: modalSlide 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.modal-header h2 {
  font-size: 20px;
  font-weight: 600;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

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

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.checkbox-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  padding: 12px;
  border-radius: 8px;
}

.glass-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
}

.glass-checkbox input {
  accent-color: var(--primary-color);
}

.glass-hr {
  border: none;
  border-top: 1px solid var(--border-glass);
  margin: 16px 0;
}

/* Children Profile management */
.children-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.child-profile-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
}

.child-profile-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.child-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 14px;
}

.child-profile-info h4 {
  font-size: 14px;
  font-weight: 500;
}

.child-profile-info p {
  font-size: 11px;
  color: var(--text-secondary);
}

/* TAB 3: Review Spaced Repetition Panel */
.review-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

@media (max-width: 1024px) {
  .review-layout {
    grid-template-columns: 1fr;
  }
}

.review-main-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.problem-display {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 24px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.problem-text {
  font-size: 18px;
  line-height: 1.6;
  white-space: pre-line;
}



.security-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text-secondary);
}

.url-code {
  font-family: monospace;
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 6px;
  border-radius: 4px;
  color: #34d399;
  word-break: break-all;
}

.review-inputs-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-top: 1px solid var(--border-glass);
  padding-top: 20px;
}

.stt-simulation-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stt-simulation-box label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.stt-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.preset-stt-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 11px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.preset-stt-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--text-primary);
  border-color: rgba(99, 102, 241, 0.3);
}

.action-buttons-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-family: var(--font-sans);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
  transition: var(--transition-smooth);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-family: var(--font-sans);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(244, 63, 94, 0.3);
  transition: var(--transition-smooth);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.4);
}

.review-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-widget h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* FSRS Compare Table */
.fsrs-compare-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

.compare-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.compare-row.header {
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-glass);
}

.compare-row div:nth-child(2),
.compare-row div:nth-child(3) {
  text-align: right;
}

.text-indigo {
  color: #a78bfa;
  font-weight: 600;
}

/* Delta Analysis Result Widget */
.delta-result-box {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 16px;
  font-size: 13px;
  line-height: 1.6;
}

.delta-success-badge {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success-color);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.delta-warning-badge {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning-color);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.placeholder-text {
  color: var(--text-muted);
  text-align: center;
  padding: 20px 0;
  font-style: italic;
}

.stt-json-block {
  font-family: monospace;
  background: rgba(0,0,0,0.3);
  padding: 8px;
  border-radius: 6px;
  margin-top: 10px;
  font-size: 11px;
  color: #c0caf5;
  white-space: pre-wrap;
  border: 1px solid var(--border-glass);
}

/* TAB 4: Vector Search Sandbox Styles */
.sandbox-intro {
  margin-bottom: 24px;
}

.sandbox-intro p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin-top: 8px;
}

.sandbox-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 24px;
}

@media (max-width: 900px) {
  .sandbox-grid {
    grid-template-columns: 1fr;
  }
}

.search-controller {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.embedding-sim {
  background: rgba(0, 0, 0, 0.25);
  height: 80px;
  border-radius: 8px;
  border: 1px solid var(--border-glass);
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  padding: 10px;
}

.emb-bar {
  width: 8%;
  background: linear-gradient(to top, var(--primary-color), var(--secondary-color));
  border-radius: 4px 4px 0 0;
  animation: heightPulse 1.5s infinite ease-in-out alternate;
}

.emb-bar:nth-child(even) {
  animation-delay: 0.3s;
}

.emb-bar:nth-child(3n) {
  animation-delay: 0.6s;
}

@keyframes heightPulse {
  from { opacity: 0.7; }
  to { opacity: 1; filter: brightness(1.2); }
}

.search-visualizer {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  padding-left: 20px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 31px;
  top: 15px;
  bottom: 15px;
  width: 2px;
  background: rgba(255, 255, 255, 0.05);
  z-index: 1;
}

.timeline-item {
  display: flex;
  gap: 20px;
  position: relative;
  z-index: 2;
  opacity: 0.5;
  transition: var(--transition-smooth);
}

.timeline-item.active {
  opacity: 1;
}

.timeline-marker {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #111422;
  border: 2px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
}

.timeline-item.active .timeline-marker {
  border-color: var(--primary-color);
  color: var(--primary-color);
  box-shadow: 0 0 10px var(--primary-glow);
}

.timeline-item.success .timeline-marker {
  border-color: var(--success-color);
  color: var(--success-color);
  background: rgba(16, 185, 129, 0.1);
}

.timeline-item.failed .timeline-marker {
  border-color: var(--danger-color);
  color: var(--danger-color);
  background: rgba(244, 63, 94, 0.1);
}

.timeline-content {
  flex: 1;
}

.timeline-content h4 {
  font-size: 14px;
  font-weight: 600;
}

.step-desc {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.status-badge {
  display: inline-block;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  margin-top: 6px;
  font-weight: 500;
}

.timeline-item.active .status-badge {
  background: rgba(99, 102, 241, 0.15);
  color: #a78bfa;
}

.timeline-item.success .status-badge {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success-color);
}

.timeline-item.failed .status-badge {
  background: rgba(244, 63, 94, 0.15);
  color: var(--danger-color);
}

.search-result-container {
  margin-top: 16px;
  border-color: rgba(99, 102, 241, 0.2);
  background: rgba(99, 102, 241, 0.02);
  animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.hidden {
  display: none !important;
}

.result-header {
  display: flex;
  gap: 8px;
}

.result-problem-text {
  font-size: 14px;
  line-height: 1.6;
  margin-top: 10px;
}

.result-explanation {
  background: rgba(0, 0, 0, 0.15);
  padding: 12px;
  border-radius: 8px;
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.result-explanation strong {
  color: #a78bfa;
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.mt-2 { margin-top: 8px; }
.w-full { width: 100%; }

/* Scrollbars styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* User-friendly UX Refactoring Styles */
.review-welcome-container {
  max-width: 600px;
  margin: 40px auto;
  padding: 48px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: fadeIn 0.5s ease-out;
}

.welcome-icon {
  font-size: 64px;
  line-height: 1;
  animation: floatMotion 2.5s infinite ease-in-out alternate;
}

.review-welcome-container h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 8px;
}

.welcome-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.seed-counter-badge {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
  padding: 8px 20px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 600;
}

.seed-counter-badge strong {
  color: #818cf8;
  font-size: 18px;
  margin: 0 4px;
}

/* Float Animation */
@keyframes floatMotion {
  from { transform: translateY(0); }
  to { transform: translateY(-10px); }
}

/* Confidence Emojis */
.confidence-container {
  margin-top: 16px;
  margin-bottom: 24px;
}

.confidence-container .block-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.confidence-buttons {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

@media (max-width: 600px) {
  .confidence-buttons {
    grid-template-columns: repeat(2, 1fr);
  }
}

.btn-conf {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  border-radius: 12px;
  padding: 12px 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-align: center;
  font-family: var(--font-sans);
}

.btn-conf:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.3);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.btn-conf.active {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
  border-color: var(--primary-color) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
  transform: translateY(-2px);
}

.stt-tooltip-info {
  font-size: 11px;
  color: #818cf8;
  margin-top: -4px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

/* AI Scan Uploader & Presets Styles */
.ai-scan-uploader {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(99, 102, 241, 0.3);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 20px;
  transition: var(--transition-smooth);
}

.ai-scan-uploader:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--primary-color);
}

.uploader-option:hover {
  background: rgba(99, 102, 241, 0.08) !important;
  border-color: var(--primary-color) !important;
  transform: translateY(-2px);
}

.uploader-option:hover i {
  color: var(--secondary-color) !important;
  transform: scale(1.1);
}

.uploader-option i {
  transition: transform 0.2s ease, color 0.2s ease;
}

.block-uploader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 12px;
  text-align: center;
}

.block-uploader i {
  font-size: 28px;
  color: var(--primary-color);
  transition: var(--transition-smooth);
}

.block-uploader:hover i {
  transform: translateY(-3px);
  color: var(--secondary-color);
}

.block-uploader span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.upload-status {
  font-size: 12px;
  color: #a5b4fc;
  text-align: center;
  margin-top: 8px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.preset-buttons-group {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  justify-content: center;
}

.btn-preset-img {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  font-family: var(--font-sans);
}

.btn-preset-img:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.4);
  color: var(--text-primary);
  transform: translateY(-1px);
}

/* Mistake Explorer Dashboard & Tabs */
.mistake-explorer-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
  background: var(--bg-panel);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 20px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

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

.explorer-title {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.explorer-title i {
  color: var(--primary-color);
}

.btn-reset-filters {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-reset-filters:hover {
  background: rgba(244, 63, 94, 0.1);
  border-color: rgba(244, 63, 94, 0.3);
  color: var(--danger-color);
}

.explorer-subject-tabs {
  display: flex;
  gap: 10px;
}

.explorer-sub-tab {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.explorer-sub-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.explorer-sub-tab.active {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: #fff;
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.explorer-topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.explorer-topic-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 14px;
  transition: var(--transition-smooth);
  cursor: pointer;
}

.explorer-topic-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(99, 102, 241, 0.25);
  transform: translateY(-2px);
}

.explorer-topic-card.active {
  background: rgba(99, 102, 241, 0.06);
  border-color: var(--primary-color);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.15);
}

.topic-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.topic-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80%;
}

.topic-card-count {
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 8px;
  color: var(--text-secondary);
}

.explorer-topic-card.active .topic-card-count {
  background: var(--primary-color);
  color: #fff;
}

.topic-card-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.breakdown-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition-smooth);
}

.breakdown-badge.category-concept {
  background: rgba(16, 185, 129, 0.08);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.15);
}
.breakdown-badge.category-calculation {
  background: rgba(244, 63, 94, 0.08);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.15);
}
.breakdown-badge.category-condition {
  background: rgba(245, 158, 11, 0.08);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.15);
}
.breakdown-badge.category-approach {
  background: rgba(99, 102, 241, 0.08);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.15);
}
.breakdown-badge.category-time {
  background: rgba(139, 92, 246, 0.08);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.15);
}

.breakdown-badge.active {
  background: currentColor !important;
  color: #0c0e1a !important;
  font-weight: 700;
}

.breakdown-badge.dimmed {
  opacity: 0.25;
}

/* Theme Toggle Switch */
.theme-switch-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  padding: 6px 12px;
  border-radius: 12px;
}

.theme-switch {
  display: inline-block;
  height: 20px;
  position: relative;
  width: 38px;
}

.theme-switch input {
  display: none;
}

.slider {
  background-color: #cbd5e1;
  bottom: 0;
  cursor: pointer;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  transition: .4s;
}

.slider:before {
  background-color: #fff;
  bottom: 3px;
  content: "";
  height: 14px;
  left: 4px;
  position: absolute;
  transition: .4s;
  width: 14px;
}

input:checked + .slider {
  background-color: var(--primary-color);
}

input:checked + .slider:before {
  transform: translateX(16px);
}

.slider.round {
  border-radius: 20px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Light Mode Theme Variables & Class Overrides */
html.light-mode {
  --bg-dark: #f0f2f5;
  --bg-panel: rgba(255, 255, 255, 0.75);
  --bg-card: rgba(0, 0, 0, 0.02);
  --border-glass: rgba(0, 0, 0, 0.08);
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --primary-color: #4f46e5;
  --primary-glow: rgba(79, 70, 229, 0.1);
  --secondary-color: #7c3aed;
  --accent-color: #2563eb;
  --success-color: #059669;
  --danger-color: #e11d48;
  --warning-color: #d97706;
}

html.light-mode .glass-select option,
html.light-mode .timeline-marker {
  background: var(--bg-dark);
}

html.light-mode ::placeholder {
  color: #94a3b8;
}

html.light-mode .glass-card,
html.light-mode .glass-table,
html.light-mode .modal-content {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.05);
}

html.light-mode .sidebar {
  background: rgba(255, 255, 255, 0.8);
  border-right-color: rgba(0, 0, 0, 0.08);
}

html.light-mode .glass-input,
html.light-mode .glass-textarea,
html.light-mode .glass-select {
  background: rgba(0, 0, 0, 0.03);
  color: #1e293b;
  border-color: rgba(0, 0, 0, 0.1);
}

html.light-mode .glass-table th {
  background: rgba(0, 0, 0, 0.03);
  color: #475569;
}

html.light-mode .glass-table tr:hover {
  background: rgba(0, 0, 0, 0.015);
}

html.light-mode .explorer-topic-card {
  background: rgba(0, 0, 0, 0.01);
}

html.light-mode .explorer-topic-card:hover {
  background: rgba(0, 0, 0, 0.02);
}

html.light-mode .explorer-topic-card.active {
  background: rgba(79, 70, 229, 0.08);
}

html.light-mode .chart-card {
  background: rgba(255, 255, 255, 0.6) !important;
}

html.light-mode .btn-conf {
  background: rgba(0, 0, 0, 0.02);
}

html.light-mode .bg-glow-1 {
  background: radial-gradient(circle, rgba(79, 70, 229, 0.15) 0%, rgba(0,0,0,0) 70%);
}

html.light-mode .bg-glow-2 {
  background: radial-gradient(circle, rgba(124, 58, 237, 0.15) 0%, rgba(0,0,0,0) 70%);
}

html.light-mode .theme-switch-wrapper {
  background: rgba(0, 0, 0, 0.02);
}


