/**
 * Syllabix - Component Library
 * Cards, Radar Timeline, Heatmaps, Gauges, Drawers, Modals, Badges, Toasts
 * Designed for GDC RIT Dubai × +TWE DesignAthon 2026
 */

/* ==========================================================================
   1. Radar & Cognitive Stress Components
   ========================================================================== */

.radar-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 2rem;
  margin-top: 2rem;
  align-items: start;
}

.radar-main-card {
  min-width: 0;
  max-width: 100%;
  background-color: var(--bg-surface);
  border: var(--card-hairline);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--card-shadow), var(--card-inner-highlight);
  transition: all var(--transition-normal);
}

.card-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.card-header-title h3 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.card-header-title p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Week Selector Carousel */
.week-selector-wrapper {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  background-color: var(--bg-surface-subtle);
  border: var(--card-hairline);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  margin-bottom: 2rem;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.04);
}

.week-selector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.week-badge-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.week-badge-status {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

.status-light {
  background-color: var(--accent-emerald-bg);
  color: var(--accent-emerald);
  border: 1px solid var(--accent-emerald-border);
}

.status-moderate {
  background-color: var(--accent-amber-bg);
  color: var(--accent-amber);
  border: 1px solid var(--accent-amber-border);
}

.status-danger {
  background-color: var(--accent-rose-bg);
  color: var(--accent-rose);
  border: 1px solid var(--accent-rose-border);
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

.week-slider-container {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.week-slider-control {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 4px;
  background: var(--border-strong);
  outline: none;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.week-slider-control::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 0 10px var(--primary-glow);
  border: 2px solid #FFFFFF;
}

.week-slider-control::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 0 10px var(--primary-glow);
  border: 2px solid #FFFFFF;
}

.week-pills-row {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding-bottom: 0.4rem;
  -webkit-overflow-scrolling: touch;
}

.week-pill {
  flex: 0 0 48px;
  min-width: 48px;
  padding: 0.45rem 0.2rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-body);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: 0.02em;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.week-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.week-pill.active {
  background-color: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  box-shadow: 0 2px 8px var(--primary-glow);
}

.week-pill.has-danger {
  border-bottom: 2px solid var(--accent-rose);
}

/* Timeline Deliverable List */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.timeline-item {
  background-color: var(--bg-surface-raised);
  border: var(--card-hairline);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.03);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.timeline-item:hover {
  transform: translateX(4px);
  border-color: var(--border-strong);
}

.timeline-item-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.course-color-strip {
  width: 4px;
  height: 48px;
  border-radius: 2px;
}

.timeline-item-info h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.timeline-item-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-body);
}

.timeline-item-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.weight-indicator {
  text-align: right;
}

.weight-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -0.02em;
}

.weight-lbl {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--text-muted);
}

/* Stress Gauge Sidebar */
.stress-gauge-card {
  background-color: var(--bg-surface);
  border: var(--card-hairline);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  box-shadow: var(--card-shadow), var(--card-inner-highlight);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.gauge-visual-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.gauge-circle-outer {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 1rem;
  background: conic-gradient(var(--primary) 0deg, var(--accent-cyan) 180deg, var(--border-subtle) 180deg);
  transition: all var(--transition-smooth);
}

.gauge-circle-inner {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background-color: var(--bg-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.gauge-score {
  font-size: 2.75rem;
  font-weight: 900;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--text-main);
  line-height: 1;
  letter-spacing: -0.04em;
}

.gauge-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.stress-actionable-card {
  background-color: var(--bg-surface-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  border: 1px solid var(--border-subtle);
}

.stress-actionable-card h5 {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.stress-actionable-card p {
  font-size: 0.8125rem;
  color: var(--text-body);
  line-height: 1.5;
}

/* Interactive Add Assignment Trigger */
.add-assignment-trigger {
  width: 100%;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 1rem;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.add-assignment-trigger:hover {
  border-color: var(--primary);
  color: var(--primary);
  background-color: var(--primary-light);
}

/* ==========================================================================
   2. Squads & Teammate Discovery Components
   ========================================================================== */

.squads-filter-bar {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.filter-row-primary {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 1rem;
}

.search-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-group svg {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input-group input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  background-color: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.9375rem;
  transition: border-color var(--transition-fast);
}

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

.select-control {
  padding: 0.75rem 1rem;
  background-color: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.9375rem;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition-fast);
}

.select-control:focus {
  border-color: var(--border-focus);
}

.filter-pills-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-pill-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 0.25rem;
}

.filter-tag-btn {
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  background-color: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  color: var(--text-body);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-tag-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-tag-btn.active {
  background-color: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
}

/* Student Cards Grid */
.squads-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

.student-card {
  background-color: var(--bg-surface);
  border: var(--card-hairline);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--card-shadow), var(--card-inner-highlight);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.student-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.student-card.creator-highlight {
  border: 2px solid var(--primary);
  box-shadow: 0 4px 20px var(--primary-glow);
}

.creator-corner-tag {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, #8B5CF6 100%);
  color: #FFFFFF;
  border-radius: 4px;
}

.student-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.student-avatar {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
  flex-shrink: 0;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.student-title-info h4 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.student-title-info p {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.match-percentage-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 800;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: 0.02em;
  margin-top: 0.35rem;
  background-color: var(--accent-emerald-bg);
  color: var(--accent-emerald);
  border: 1px solid var(--accent-emerald-border);
}

.student-bio {
  font-size: 0.875rem;
  color: var(--text-body);
  line-height: 1.55;
  margin-bottom: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.student-skills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.skill-chip {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background-color: var(--bg-surface-raised);
  color: var(--text-body);
  border: 1px solid var(--border-subtle);
}

.student-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

/* ==========================================================================
   3. Drawers, Modals & Toast System
   ========================================================================== */

/* Slide-over Profile Drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal);
}

.drawer-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.profile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 520px;
  background-color: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-xl);
  z-index: 210;
  transform: translateX(100%);
  transition: transform var(--transition-smooth);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.drawer-backdrop.active .profile-drawer {
  transform: translateX(0);
}

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

.drawer-body {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  flex: 1;
}

.drawer-close-btn {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-body);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-close-btn:hover {
  background-color: var(--bg-surface-raised);
}

/* Interactive Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 250;
  opacity: 0;
  visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  transition: opacity var(--transition-normal);
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  width: 100%;
  max-width: 540px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transform: scale(0.95);
  transition: transform var(--transition-smooth);
}

.modal-backdrop.active .modal-content {
  transform: scale(1);
}

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

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

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

.form-label {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-main);
}

.form-control {
  padding: 0.75rem 1rem;
  background-color: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.9375rem;
}

.modal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-surface-raised);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 300px;
  max-width: 420px;
  background-color: var(--text-main);
  color: var(--bg-base);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  transform: translateY(20px);
  opacity: 0;
  transition: all var(--transition-normal);
}

.toast.active {
  transform: translateY(0);
  opacity: 1;
}

.toast-icon {
  flex-shrink: 0;
}

/* ==========================================================================
   4. Problem & Solution Page Components
   ========================================================================== */

.ps-section {
  padding: 4rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.ps-section:last-of-type {
  border-bottom: none;
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.section-heading {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.section-lead {
  font-size: 1.125rem;
  color: var(--text-body);
  max-width: 760px;
  line-height: 1.65;
  margin-bottom: 2.5rem;
}

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

.metric-stat-card {
  background-color: var(--bg-surface);
  border: var(--card-hairline);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--card-shadow), var(--card-inner-highlight);
  display: flex;
  flex-direction: column;
}

.metric-number {
  font-size: 3.25rem;
  font-weight: 900;
  color: var(--primary);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 0.75rem;
}

.metric-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.metric-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Persona Cards */
.persona-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.persona-card {
  background-color: var(--bg-surface);
  border: var(--card-hairline);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--card-shadow), var(--card-inner-highlight);
}

.persona-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.persona-avatar {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface-raised);
  border: 2px solid var(--border-strong);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.25rem;
}

.persona-info h4 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.persona-info p {
  font-size: 0.8125rem;
  color: var(--primary);
  font-weight: 600;
}

.persona-quote {
  font-style: italic;
  font-size: 0.9375rem;
  color: var(--text-body);
  background-color: var(--bg-surface-raised);
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 1.5rem;
}

.persona-list-section h5 {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.persona-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.persona-list li {
  font-size: 0.875rem;
  color: var(--text-body);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.persona-list li::before {
  content: '•';
  color: var(--primary);
  font-weight: bold;
}

/* ==========================================================================
   5. Interactive Guided Tour Component
   ========================================================================== */

.tour-backdrop {
  position: fixed;
  inset: 0;
  background-color: transparent;
  z-index: 9000;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal);
  pointer-events: none;
}

.tour-backdrop.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Dynamic Spotlight Cutout Box */
.tour-spotlight-box {
  position: fixed;
  z-index: 9001;
  border: 2.5px solid var(--primary);
  border-radius: var(--radius-md);
  box-shadow: 0 0 0 9999px rgba(10, 15, 30, 0.72), 
              0 0 30px var(--primary-glow),
              inset 0 0 15px rgba(99, 102, 241, 0.2);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: top 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              left 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              width 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              height 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              border-radius 0.3s ease,
              opacity 0.25s ease;
}

[data-theme="light"] .tour-spotlight-box {
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.52), 
              0 0 30px var(--primary-glow),
              inset 0 0 15px rgba(99, 102, 241, 0.15);
}

.tour-backdrop.active .tour-spotlight-box.active {
  opacity: 1;
  visibility: visible;
}

.tour-card {
  position: fixed;
  bottom: 2.5rem;
  left: 2.5rem; /* ALWAYS safely on the left side to never overlap the right-hand Stress Gauge! */
  right: auto;
  top: auto;
  width: 100%;
  max-width: 420px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 35px -5px rgba(0, 0, 0, 0.4), 0 0 30px var(--primary-glow);
  z-index: 9010;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  visibility: hidden;
  transition: top 0.35s cubic-bezier(0.16, 1, 0.3, 1), 
              bottom 0.35s cubic-bezier(0.16, 1, 0.3, 1), 
              left 0.35s cubic-bezier(0.16, 1, 0.3, 1), 
              right 0.35s cubic-bezier(0.16, 1, 0.3, 1), 
              transform var(--transition-smooth), 
              opacity var(--transition-normal);
}

/* Step 2 moves to top-left to highlight stress gauge on the right */
.tour-card.position-left-top {
  top: 6rem;
  left: 2.5rem;
  bottom: auto;
  right: auto;
}

.tour-card.position-left-bottom {
  bottom: 2.5rem;
  left: 2.5rem;
  top: auto;
  right: auto;
}

.tour-backdrop.active .tour-card {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
}

.tour-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tour-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  background-color: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.tour-skip-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.tour-skip-btn:hover {
  color: var(--text-main);
  text-decoration: underline;
}

.tour-body h4 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.tour-body p {
  font-size: 0.875rem;
  color: var(--text-body);
  line-height: 1.55;
}

.tour-tip-box {
  background-color: var(--bg-surface-raised);
  border-left: 3px solid var(--primary);
  padding: 0.5rem 0.75rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.8125rem;
  color: var(--text-body);
  margin-top: 0.5rem;
  line-height: 1.45;
}

.tour-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

.tour-dots {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tour-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--border-strong);
  transition: all var(--transition-fast);
}

.tour-dot.active {
  width: 22px;
  border-radius: 4px;
  background-color: var(--primary);
}

.tour-nav-btns {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Focused UI element highlight */
.tour-target-highlight {
  transition: outline 0.3s ease;
}


