/* === Variables === */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #0ea5e9;
  --accent: #f59e0b;
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #283548;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --border: #334155;
  --radius: 16px;
  --radius-sm: 8px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* === Layout === */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.main-content { min-height: calc(100vh - 200px); padding: 2rem 0; }

/* === Header === */
.site-header {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}
.logo span { color: var(--text); }
.nav-links { list-style: none; display: flex; gap: 2rem; }
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
  font-weight: 500;
}
.nav-links a:hover { color: var(--primary); }

/* === Footer === */
.site-footer {
  text-align: center;
  padding: 3rem 0;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

/* === Hero === */
.hero {
  text-align: center;
  padding: 5rem 1rem 4rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 50px;
  font-size: 0.875rem;
  color: var(--primary);
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2rem;
}

.hero-actions {
  margin-bottom: 3rem;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  max-width: 500px;
  margin: 0 auto;
}

.stat {
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* === Buttons === */
.btn {
  display: inline-block;
  padding: 0.875rem 1.75rem;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: all 0.2s;
}
.btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}
.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}
.btn-large {
  font-size: 1.1rem;
  padding: 1rem 2rem;
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover {
  background: var(--bg-card);
  border-color: var(--primary);
}

/* === Cases Preview === */
.cases-preview {
  padding: 3rem 0;
}

.preview-section {
  margin-bottom: 4rem;
}

.preview-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.preview-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
}

.preview-header h2 {
  font-size: 1.5rem;
  margin: 0 0 0.25rem;
  color: var(--text);
}

.preview-header p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

.preview-header .btn {
  margin-left: auto;
  flex-shrink: 0;
}

.preview-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.preview-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: all 0.25s ease;
}

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

.preview-card-content h3 {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.preview-card-content p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.preview-card-arrow {
  font-size: 1.25rem;
  color: var(--primary);
  transition: transform 0.2s;
}

.preview-card:hover .preview-card-arrow {
  transform: translateX(4px);
}

/* === Groups Grid (old) === */
.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.group-card {
  display: block;
  padding: 2rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all 0.2s;
}

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

.group-icon { font-size: 3rem; }
.group-card h3 { color: var(--text); margin: 1rem 0 0.5rem; }
.group-card p { font-size: 0.9rem; color: var(--text-muted); margin: 0; }

/* === Case Detail === */
.case-detail { 
  max-width: 800px; 
  margin: 2rem auto;
  padding: 0 1rem;
}

.case-header { 
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.case-header h1 {
  font-size: 2.5rem;
  margin: 1.5rem 0 0.75rem;
}

.case-description { 
  font-size: 1.25rem; 
  color: var(--text-muted); 
  margin: 0;
}

.case-section {
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.case-content p { color: var(--text); margin-bottom: 1rem; }
.case-content ul, .case-content ol { margin: 1rem 0 1rem 1.5rem; }
.case-content li { margin-bottom: 0.5rem; color: var(--text); }
.case-content strong { color: var(--text); font-weight: 600; }

.case-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.case-actions a {
  flex: 1;
  min-width: 180px;
  text-align: center;
}

/* === Breadcrumb === */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb .separator {
  color: var(--border);
}

.breadcrumb span:last-child {
  color: var(--text);
}

/* === Group Page === */
.group-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 0;
}

.group-header {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin: 2rem 0 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.group-header .group-icon {
  font-size: 4rem;
  flex-shrink: 0;
}

.group-header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.group-header p {
  font-size: 1.1rem;
  color: var(--text-muted);
}

.cases-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.case-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.25s ease;
}

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

.case-item-content h2 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.case-item-content h2 a {
  color: var(--text);
  text-decoration: none;
}

.case-item-content h2 a:hover {
  color: var(--primary);
}

.case-item-content p {
  color: var(--text-muted);
  margin: 0;
}

.case-item-actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.case-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.case-actions .btn {
  flex: 1;
  min-width: 200px;
  text-align: center;
}
.instruction-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 0;
}
.instruction-page h1 { margin-bottom: 0.5rem; }
.instruction-case-name {
  font-size: 1.25rem;
  color: var(--secondary);
  margin-bottom: 2rem;
}
.instruction-page pre {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.8;
  white-space: pre-wrap;
  border: 1px solid var(--border);
}

.btn-copy {
  margin-top: 1.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--secondary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  transition: opacity 0.2s;
}
.btn-copy:hover { opacity: 0.9; }

/* === Groups Showcase === */
.groups-showcase {
  display: grid;
  gap: 2rem;
  padding: 2rem 0;
}

.group-card-large {
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.25s ease;
}

.group-card-large:hover {
  border-color: var(--primary);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.group-card-header {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.group-card-header .group-icon {
  font-size: 3rem;
  flex-shrink: 0;
}

.group-card-info h2 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.group-card-info p {
  color: var(--text-muted);
  margin: 0;
}

.group-card-cases {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.case-mini-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.2s ease;
}

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

.case-mini-title {
  color: var(--text);
  font-weight: 500;
}

.case-mini-arrow {
  color: var(--primary);
  font-weight: bold;
}

.group-card-footer {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* === Responsive === */
@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  .hero h1 { font-size: 2.5rem; }
  .hero-stats { gap: 2rem; }
  .stat-value { font-size: 1.5rem; }
  
  .group-card-header {
    flex-wrap: wrap;
  }
  
  .group-card-cases {
    grid-template-columns: 1fr;
  }
  
  .case-item {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .case-item-actions {
    width: 100%;
    flex-direction: column;
  }
  
  .case-item-actions .btn {
    width: 100%;
    text-align: center;
  }
}