/* SetViz — style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
:root{
  --ink:#1a202c; --muted:#6b7280; --card:#ffffff; --line:#e5e7eb; --blue:#5F27CD;
  --blue2:#a78bfa; --orange:#fb923c; --bg:#faf5ff; --shadow:0 2px 8px rgba(0,0,0,.05);
  --green:#10b981; --red:#ef4444; --purple:#8b5cf6; --pink:#ec4899;
  --teal:#FF6B6B; --cyan:#a855f7; --indigo:#5F27CD;
  --gradient: linear-gradient(135deg, #FF6B6B, #5F27CD);
  --gradient-alt: linear-gradient(135deg, #FECA57, #FF6B6B);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
*{ box-sizing:border-box }
body{ 
  margin:0; 
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial; 
  color:var(--ink); 
  background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #f5576c 75%, #ffd93d 100%);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  min-height: 100vh;
}
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.topbar{ 
  display:flex; 
  gap:20px; 
  align-items:center; 
  justify-content:space-between; 
  padding:20px 24px; 
  border-bottom:1px solid rgba(255, 255, 255, 0.2); 
  background:linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 100%);
  position:sticky; 
  top:0; 
  z-index:10;
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border-radius: 0 0 20px 20px;
}
.brand{ 
  display:flex; 
  align-items:center; 
  gap:12px; 
  font-weight:700;
  transition: transform 0.2s ease;
}
.brand:hover {
  transform: translateY(-1px);
}
.logo{ 
  width:40px; 
  height:40px; 
  border-radius:12px; 
  background:linear-gradient(135deg,var(--teal),var(--green)); 
  box-shadow: 0 4px 12px rgba(49, 151, 149, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 18px;
}
.logo::before {
  content: "S";
}
.brand-main {
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}
.muted{ 
  color:var(--muted); 
  font-weight:500; 
  font-size:14px; 
  margin-left:8px;
  background: linear-gradient(135deg, #718096, #a0aec0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.tagline {
  font-size: 12px;
  color: #718096;
  font-weight: 400;
  margin-top: 2px;
  line-height: 1.3;
  opacity: 0.8;
}
.toolbar{ 
  display:flex; 
  align-items:center; 
  gap:12px;
}
.btn, select, .seg{ padding:8px 12px; border:1px solid var(--line); background:#fff; border-radius:10px; cursor:pointer; transition: var(--transition) }
.btn:hover{ transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.1) }
.btn.primary{ background:var(--gradient); color:#fff; border-color:transparent; box-shadow: 0 2px 8px rgba(49, 151, 149, 0.3) }
.btn.primary:hover{ box-shadow: 0 4px 16px rgba(49, 151, 149, 0.4) }
.btn.ghost{ 
  background:#fff; 
  border: 1px solid var(--line);
  font-weight: 500;
  padding: 10px 16px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.btn.ghost:hover {
  background: #f0fdfa;
  border-color: var(--teal);
  box-shadow: 0 4px 12px rgba(49, 151, 149, 0.15);
}
.grid{ max-width:1100px; margin:20px auto; padding:0 16px; display:grid; grid-template-columns:1.1fr .9fr; gap:16px }
@media (max-width: 900px){ 
  .grid{ grid-template-columns:1fr; gap: 12px; }
  .topbar{ padding: 12px 16px; }
  .card{ padding: 12px; }
  .venn-wrap{ min-height: 280px; }
  .chips{ gap: 6px; }
  .chip{ padding: 4px 8px; font-size: 14px; }
  .btn{ padding: 6px 10px; font-size: 14px; }
  .h2{ font-size: 18px; }
}

@media (max-width: 600px){
  .grid{ padding: 0 12px; }
  .topbar{ flex-direction: column; gap: 8px; align-items: stretch; }
  .toolbar{ justify-content: center; }
  .brand{ justify-content: center; }
  .venn-wrap{ min-height: 250px; }
  .controls{ gap: 8px; }
  .row{ flex-direction: column; align-items: stretch; }
  .row .btn{ width: 100%; margin: 2px 0; }
  
  /* Mobile-friendly stage controls */
  .stage-controls{ 
    flex-direction: column; 
    gap: 12px; 
    align-items: stretch;
    margin: 16px 0;
  }
  .stage-nav{ 
    justify-content: center; 
    gap: 8px;
    flex-wrap: wrap;
  }
  .nav-btn{ 
    flex: 1; 
    min-width: 120px; 
    padding: 12px 16px; 
    font-size: 14px;
    text-align: center;
  }
  .stage-controls > div:last-child {
    display: flex;
    gap: 8px;
    justify-content: center;
  }
  .stage-controls > div:last-child .nav-btn {
    flex: 1;
    min-width: 100px;
  }
}
.card{ 
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 100%); 
  border: 1px solid rgba(255, 255, 255, 0.3); 
  border-radius:20px; 
  padding:20px; 
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
}
.card.soft{ background:#f7fafc }
.h2{ margin:0 0 10px; font-size:20px; font-weight:700 }
.row{ display:flex; gap:8px; flex-wrap:wrap; align-items:center }
.chips{ display:flex; flex-wrap:wrap; gap:8px; margin-top:8px }
.chip{ padding:6px 10px; border:1px solid var(--line); border-radius:999px; background:#fff; cursor:pointer; user-select:none; transition: var(--transition) }
.chip:hover{ transform: scale(1.05); box-shadow: 0 2px 8px rgba(0,0,0,.1) }
.chip.active{ background:var(--gradient); color:#fff; border-color:transparent; box-shadow: 0 2px 8px rgba(49, 151, 149, 0.3) }
.tiny{ font-size:12px; color:var(--muted) }
.venn-wrap{ display:flex; justify-content:center; align-items:center; min-height:320px }
.controls{ display:grid; gap:12px }
.seg{ display:inline-flex; gap:4px; align-items:center }
.seg button{ border:none; background:transparent; padding:6px 10px; border-radius:8px; cursor:pointer; transition: var(--transition) }
.seg button:hover{ background:#f1f5f9; transform: scale(1.05) }
.seg button[aria-pressed="true"]{ background:var(--gradient); color:#fff; box-shadow: 0 2px 8px rgba(49, 151, 149, 0.3) }
.feedback{ margin-top:8px; padding:8px 12px; border-radius:8px; font-weight:500; transition: var(--transition) }
.feedback.good{ color:#166534; background:#dcfce7; border:1px solid #bbf7d0 }
.feedback.bad{ color:#991b1b; background:#fef2f2; border:1px solid #fecaca }
.kbd{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;background:#f1f5f9;border:1px solid #e2e8f0;border-bottom-width:2px;padding:2px 6px;border-radius:6px}
.foot{ 
  max-width:1100px; 
  margin:24px auto 60px; 
  padding:0 16px; 
  color:var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.user-count {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--teal);
  background: rgba(49, 151, 149, 0.1);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid rgba(49, 151, 149, 0.2);
}

.user-icon {
  font-size: 16px;
}

#userCount {
  font-weight: 600;
  color: var(--teal);
}

/* Mobile user count */
@media (max-width: 600px) {
  .foot {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }
  
  .user-count {
    font-size: 13px;
    padding: 5px 10px;
  }
}

/* Statistics Modal */
.stats-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.stats-modal-content {
  background: white;
  border-radius: 12px;
  padding: 24px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.stats-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
}

.stats-icon {
  font-size: 24px;
}

.stats-header h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
}

.stats-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.stat-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.stat-label {
  flex: 1;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.stat-value {
  color: var(--teal);
  font-size: 16px;
  font-weight: 600;
  min-width: 60px;
  text-align: right;
}

.stats-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}

.stats-close-btn {
  background: var(--teal);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.stats-close-btn:hover {
  background: #2c7a7b;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(49, 151, 149, 0.3);
}

/* Mobile modal */
@media (max-width: 480px) {
  .stats-modal-content {
    padding: 20px;
    margin: 20px;
  }
  
  .stat-item {
    gap: 8px;
  }
  
  .stat-label {
    font-size: 13px;
  }
  
  .stat-value {
    font-size: 14px;
  }
}
.dialog-body{ max-width:520px }
.uBox{ fill:none; stroke:#cbd5e1; stroke-dasharray:4 4 }

.placeholder-label {
  fill: #9ca3af;
  font-style: italic;
  opacity: 0.7;
}

.empty-set-indicator {
  fill: #ef4444;
  font-weight: bold;
  opacity: 0.8;
}

/* Stage 2 overlapping emphasis */
.stage-2-overlapping .baseA {
  stroke-width: 3;
  stroke: #FF6B6B;
}

.stage-2-overlapping .baseB {
  stroke-width: 3;
  stroke: #5F27CD;
}

/* Stage 3 mutually exclusive emphasis */
.stage-3-mutually-exclusive .baseA {
  stroke-width: 3;
  stroke: #FF6B6B;
  stroke-dasharray: 5 5;
}

.stage-3-mutually-exclusive .baseB {
  stroke-width: 3;
  stroke: #5F27CD;
  stroke-dasharray: 5 5;
}

/* Venn base and highlight colors */
.baseA{ fill:#fff1f2; stroke:#FF6B6B; stroke-width:2; transition: var(--transition) }
.baseB{ fill:#f5f3ff; stroke:#5F27CD; stroke-width:2; transition: var(--transition) }

/* Enhanced intersection visibility */
.hlAB{ 
  fill:#FECA57; 
  opacity:.9; 
  transition: opacity 0.3s ease;
  stroke: #f59e0b;
  stroke-width: 3;
  stroke-dasharray: 4 2;
}

/* Special styling for when sets are identical */
.venn-identical .hlAB{
  fill: #e9d5ff;
  opacity: 1;
  stroke: #a855f7;
  stroke-width: 3;
  stroke-dasharray: 4 2;
  animation: pulse 2s ease-in-out infinite;
}

/* Golden intersection highlighting for better visibility */
.hlIntersection{
  fill: #FECA57;
  opacity: 0.85;
  stroke: #f59e0b;
  stroke-width: 2;
  stroke-dasharray: 3 3;
  pointer-events: none;
}

/* Set difference highlighting - Vibrant colors for better distinction */
.hlA{
  fill: #FF6B6B;
  opacity: 0.75;
  stroke: #e74c3c;
  stroke-width: 3;
  stroke-dasharray: 4 2;
  pointer-events: none;
}

.hlB{
  fill: #5F27CD;
  opacity: 0.75;
  stroke: #341f97;
  stroke-width: 3;
  stroke-dasharray: 4 2;
  pointer-events: none;
}

/* Position toggle buttons for Stage 5 */
.position-btn {
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
  border: 2px solid #d1d5db;
  color: #374151;
  font-weight: 600;
  transition: all 0.3s ease;
}

.position-btn:hover {
  background: linear-gradient(135deg, #e5e7eb, #d1d5db);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.position-btn.active {
  background: linear-gradient(135deg, #FF6B6B, #5F27CD);
  border-color: #FF6B6B;
  color: white;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

/* De Morgan spotlight button for Stage 6 */
.demorgan-btn {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  border: 2px solid #7c3aed;
  color: white;
  font-weight: 600;
  transition: all 0.3s ease;
  animation: pulse 2s infinite;
}

.demorgan-btn:hover {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.demorgan-btn.active {
  background: linear-gradient(135deg, #6d28d9, #5b21b6);
  border-color: #5b21b6;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.5);
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(139, 92, 246, 0);
  }
}

/* Enhanced symmetric difference styling */
#hl-A-symmetric-difference-B circle:first-child {
  fill: #FF6B6B;
  opacity: 0.8;
  stroke: #e74c3c;
  stroke-width: 3;
  stroke-dasharray: 4 2;
}

#hl-A-symmetric-difference-B circle:last-child {
  fill: #5F27CD;
  opacity: 0.8;
  stroke: #341f97;
  stroke-width: 3;
  stroke-dasharray: 4 2;
}

.hlAonly{ fill:#fecaca; opacity:.7; transition: opacity 0.3s ease }
.hlBonly{ fill:#ddd6fe; opacity:.7; transition: opacity 0.3s ease }
.hlComp{ fill:#c8d6e5; opacity:.7; transition: opacity 0.3s ease }

/* Element animations */
.element-chip{ 
  transition: var(--transition); 
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

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

.pulse{ animation: pulse 0.6s ease-in-out; }

.sr-only{ 
  position: absolute; 
  width: 1px; 
  height: 1px; 
  padding: 0; 
  margin: -1px; 
  overflow: hidden; 
  clip: rect(0, 0, 0, 0); 
  white-space: nowrap; 
  border: 0; 
}

.task{ margin:4px 0 8px; font-weight:600 }

/* Tutorial Styles */
.tutorial-content{ 
  margin: 12px 0; 
  padding: 12px; 
  background: #f8fafc; 
  border-radius: 8px; 
  border-left: 4px solid var(--blue);
  min-height: 60px;
}

.tutorial-progress{ 
  margin-top: 12px; 
  text-align: center; 
}

.progress-bar{ 
  width: 100%; 
  height: 8px; 
  background: #e2e8f0; 
  border-radius: 4px; 
  overflow: hidden; 
  margin-bottom: 8px;
}

.progress-fill{ 
  height: 100%; 
  background: var(--gradient); 
  width: 12.5%; 
  transition: width 0.3s ease;
}

.tutorial-step{ 
  display: none; 
  animation: fadeIn 0.5s ease-in-out;
}

.tutorial-step.active{ 
  display: block; 
}

.tutorial-highlight{ 
  animation: pulse 1s ease-in-out infinite;
}

/* 3-set Venn diagram styles */
.venn-3-set .baseC{ fill:#f0f9ff; stroke:#0ea5e9; stroke-width:2; transition: var(--transition) }
.venn-3-set .hlC{ fill:#0ea5e9; opacity:.5; transition: opacity 0.3s ease }

/* Mutually exclusive sets styling */
.venn-mutually-exclusive .baseA{ 
  fill:#fff1f2; 
  stroke:#FF6B6B; 
  stroke-width:3; 
  stroke-dasharray: 5 5;
}
.venn-mutually-exclusive .baseB{ 
  fill:#f5f3ff; 
  stroke:#5F27CD;
  stroke-width:3; 
  stroke-dasharray: 5 5;
}

/* Basic concepts page styles */
.concept-page {
  max-width: 100%;
  margin: 0 auto;
  padding: 10px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  display: flex;
  flex: 1;
  gap: 20px;
  margin-top: 20px;
}

/* Sidebar Navigation */
.sidebar {
  width: 280px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 100%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(20px);
  height: fit-content;
  position: sticky;
  top: 20px;
  position: relative;
  overflow: hidden;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
}

.sidebar-title {
  color: var(--teal);
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 16px 0;
  text-align: center;
}

.stage-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stage-item {
  margin: 0;
}

.stage-btn {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid transparent;
  background: #f8fafc;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stage-btn:hover {
  background: #f1f5f9;
  border-color: #e2e8f0;
  transform: translateY(-1px);
}

.stage-btn[aria-selected="true"] {
  background: var(--gradient);
  color: white;
  border-color: var(--blue);
  box-shadow: 0 4px 12px rgba(49, 151, 149, 0.3);
}

.stage-name {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
}

.stage-desc {
  font-size: 13px;
  opacity: 0.8;
  line-height: 1.3;
}

/* Content Area */
.content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.stage-header {
  background: var(--gradient);
  color: white;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  text-align: center;
}

.stage-title {
  font-size: 24px;
  font-weight: bold;
  margin: 0 0 8px 0;
}

.stage-description {
  font-size: 16px;
  opacity: 0.9;
  margin: 0;
}

.symbol-display {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
}

.operation-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px;
  margin: 15px 0;
  width: 100%;
}

/* Mobile operation buttons */
@media (max-width: 600px) {
  .operation-buttons {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
    margin: 12px 0;
  }
  
  .op-btn {
    padding: 10px 8px;
    font-size: 14px;
    min-height: 44px;
  }
}

@media (max-width: 480px) {
  .operation-buttons {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  
  .op-btn {
    padding: 12px 8px;
    font-size: 16px;
    min-height: 48px;
  }
}

.op-btn {
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: var(--transition);
}

.op-btn:hover {
  border-color: var(--blue);
  background: #eff6ff;
}

.op-btn.active {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
}

.teaching-point {
  background: #f0f9ff;
  border-left: 4px solid #0ea5e9;
  padding: 12px 16px;
  margin: 12px 0;
  border-radius: 0 8px 8px 0;
}

.venn-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
  background: #f8fafc;
  border-radius: 12px;
  margin: 10px 0;
  flex: 1;
  width: 100%;
}

.stage-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0;
}

.stage-nav {
  display: flex;
  gap: 12px;
}

.nav-btn {
  padding: 10px 20px;
  border: 2px solid #e2e8f0;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
}

.nav-btn:hover:not(:disabled) {
  border-color: var(--teal);
  background: #f0fdfa;
}

.nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.nav-btn.primary {
  background: var(--teal);
  color: white;
  border-color: var(--teal);
}

/* Welcome page styles */
.welcome-message {
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border-radius: 12px;
  margin: 20px 0;
}

.welcome-message h2 {
  color: var(--blue);
  margin: 0 0 12px 0;
  font-size: 24px;
}

.welcome-message p {
  color: var(--muted);
  font-size: 16px;
  margin: 0;
}

.feature-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.feature-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
}

.feature-card h3 {
  color: var(--blue);
  margin: 0 0 12px 0;
  font-size: 18px;
}

.feature-card p {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
  line-height: 1.5;
}

.getting-started-content h3 {
  color: var(--blue);
  margin: 16px 0 8px 0;
  font-size: 16px;
}

.getting-started-content p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 12px 0;
}

.getting-started-content ol,
.getting-started-content ul {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 12px 0;
  padding-left: 20px;
}

.getting-started-content li {
  margin-bottom: 4px;
}

/* Row and segment styles for relationship toggle */
.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.seg {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.seg button {
  border: none;
  background: transparent;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.seg button:hover {
  background: #f1f5f9;
  transform: scale(1.05);
}

.seg button[aria-pressed="true"] {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Responsive design */
@media (max-width: 768px) {
  .concept-page {
    padding: 5px;
  }
  
  .main-content {
    flex-direction: column;
    gap: 15px;
  }
  
  .sidebar {
    width: 100%;
    position: static;
    order: 2;
  }
  
  .content-area {
    order: 1;
  }
  
  .stage-list {
    flex-direction: row;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 8px;
  }
  
  .stage-item {
    flex-shrink: 0;
    min-width: 200px;
  }
  
  .stage-btn {
    padding: 12px 14px;
  }
  
  .stage-name {
    font-size: 14px;
  }
  
  .stage-desc {
    font-size: 12px;
  }
  
  /* Mobile stage controls for tablets */
  .stage-controls {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  
  .stage-nav {
    justify-content: center;
    gap: 8px;
  }
  
  .nav-btn {
    padding: 10px 16px;
    font-size: 14px;
  }
}

/* Extra small mobile screens */
@media (max-width: 480px) {
  .stage-controls {
    margin: 12px 0;
  }
  
  .stage-nav {
    flex-direction: column;
    gap: 6px;
  }
  
  .nav-btn {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
  
  .stage-controls > div:last-child {
    flex-direction: column;
    gap: 6px;
  }
  
  .stage-controls > div:last-child .nav-btn {
    width: 100%;
    min-width: unset;
  }
  
  /* Improve touch targets */
  .op-btn {
    padding: 14px 12px;
    font-size: 16px;
    min-height: 48px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
  
  .stage-btn {
    padding: 16px 12px;
    min-height: 60px;
    border-radius: 12px;
  }
  
  /* Ensure proper spacing for mobile */
  .concept-page {
    padding: 8px;
  }
  
  .stage-header {
    padding: 16px;
    margin-bottom: 16px;
  }
  
  .stage-title {
    font-size: 20px;
  }
  
  .stage-description {
    font-size: 14px;
  }
}
