/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #6366F1;
  --primary-dark: #4F46E5;
  --primary-light: #818CF8;
  --secondary: #10B981;
  --accent: #F59E0B;
  --text: #1F2937;
  --text-light: #6B7280;
  --text-muted: #9CA3AF;
  --bg: #F9FAFB;
  --bg-dark: #F3F4F6;
  --white: #FFFFFF;
  --border: #E5E7EB;
  --sidebar-width: 280px;
  --header-height: 64px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
}

/* Layout */
.docs-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--white);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--white);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
}

.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
}

.sidebar-logo-text {
  font-weight: 700;
  font-size: 1.25rem;
}

.sidebar-logo-text span {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-light);
}

.sidebar-nav {
  padding: 1rem 0;
}

.nav-section {
  margin-bottom: 1.5rem;
}

.nav-section-title {
  padding: 0.5rem 1.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.nav-links {
  list-style: none;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1.5rem;
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.9375rem;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

.nav-link:hover {
  background: var(--bg);
  color: var(--text);
}

.nav-link.active {
  background: #EEF2FF;
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 500;
}

.nav-link-icon {
  font-size: 1.125rem;
  width: 24px;
  text-align: center;
}

.sidebar-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.app-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: background 0.2s;
}

.app-button:hover {
  background: var(--primary-dark);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

/* Page Header */
.page-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  padding: 3rem 3rem 2rem;
}

.page-header h1 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.page-header p {
  font-size: 1.125rem;
  opacity: 0.9;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  opacity: 0.8;
  margin-bottom: 1rem;
}

.breadcrumb a {
  color: white;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* Content Area */
.content {
  padding: 2rem 3rem 4rem;
  max-width: 900px;
}

.content h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
  color: var(--text);
}

.content h2:first-child {
  margin-top: 0;
}

.content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  color: var(--primary-dark);
}

.content h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
  color: var(--text);
}

.content p {
  margin-bottom: 1rem;
  color: var(--text);
}

.content ul,
.content ol {
  margin: 0 0 1.5rem 1.5rem;
}

.content li {
  margin-bottom: 0.5rem;
}

.content a {
  color: var(--primary);
  text-decoration: none;
}

.content a:hover {
  text-decoration: underline;
}

.content strong {
  font-weight: 600;
  color: var(--text);
}

/* Cards */
.card {
  background: var(--white);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.feature-card {
  background: var(--white);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.feature-card:hover {
  border-color: var(--primary-light);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.feature-card-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.feature-card h4 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: var(--text);
}

.feature-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-light);
}

/* Info Boxes */
.info-box {
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin: 1.5rem 0;
}

.info-box.tip {
  background: #ECFDF5;
  border-left: 4px solid var(--secondary);
}

.info-box.tip strong {
  color: #059669;
}

.info-box.warning {
  background: #FFFBEB;
  border-left: 4px solid var(--accent);
}

.info-box.warning strong {
  color: #D97706;
}

.info-box.note {
  background: #EEF2FF;
  border-left: 4px solid var(--primary);
}

.info-box.note strong {
  color: var(--primary-dark);
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

th, td {
  padding: 0.875rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--bg-dark);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: var(--bg);
}

/* Steps */
.steps {
  counter-reset: step;
  list-style: none;
  margin: 1.5rem 0;
  padding: 0;
}

.steps li {
  position: relative;
  padding: 1rem 1rem 1rem 3.5rem;
  margin-bottom: 0.75rem;
  background: var(--white);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

.steps li strong {
  display: block;
  margin-bottom: 0.25rem;
}

.steps li p {
  margin: 0;
  color: var(--text-light);
  font-size: 0.9rem;
}

/* Phases */
.phases-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.phase-card {
  background: var(--white);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  border: 1px solid var(--border);
}

.phase-number {
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin: 0 auto 0.75rem;
}

.phase-card h4 {
  margin: 0 0 0.5rem;
  color: var(--primary-dark);
  font-size: 1rem;
}

.phase-card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-light);
}

/* Worlds */
.world-list {
  margin: 1.5rem 0;
}

.world-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--white);
  border-radius: 10px;
  margin-bottom: 0.75rem;
  border-left: 4px solid;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.world-item:nth-child(1) { border-left-color: #FF6B6B; }
.world-item:nth-child(2) { border-left-color: #4ECDC4; }
.world-item:nth-child(3) { border-left-color: #FFE66D; }
.world-item:nth-child(4) { border-left-color: #95E1D3; }
.world-item:nth-child(5) { border-left-color: #DDA0DD; }

.world-number {
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.world-info h4 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.world-info p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-light);
}

/* Game Cards */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.game-card {
  background: var(--white);
  border-radius: 10px;
  padding: 1.25rem;
  border: 1px solid var(--border);
}

.game-card h4 {
  margin: 0 0 0.5rem;
  color: var(--primary);
  font-size: 0.95rem;
}

.game-card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-light);
}

/* CTA Section */
.cta-section {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  padding: 2.5rem;
  border-radius: 16px;
  text-align: center;
  margin: 3rem 0 2rem;
}

.cta-section h2 {
  color: white;
  border: none;
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
}

.cta-section p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1.5rem;
}

.cta-button {
  display: inline-block;
  padding: 0.875rem 2rem;
  background: white;
  color: var(--primary);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  text-decoration: none;
}

/* FAQ */
.faq-item {
  background: var(--white);
  border-radius: 10px;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  overflow: hidden;
}

.faq-question {
  padding: 1rem 1.25rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-question::after {
  content: '+';
  font-size: 1.25rem;
  color: var(--primary);
  font-weight: 400;
}

.faq-answer {
  padding: 0 1.25rem 1rem;
  color: var(--text-light);
}

.faq-answer ul, .faq-answer ol {
  margin: 0.5rem 0 0 1.25rem;
}

/* Code blocks */
.code-block {
  background: #1F2937;
  color: #E5E7EB;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  overflow-x: auto;
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 0.875rem;
  margin: 1rem 0;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .mobile-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
  }

  .menu-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
  }

  .content {
    padding: 1.5rem;
  }

  .page-header {
    padding: 2rem 1.5rem;
  }

  .phases-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

  .card-grid {
    grid-template-columns: 1fr;
  }
}

/* Hide mobile header on desktop */
@media (min-width: 1025px) {
  .mobile-header {
    display: none;
  }
}

/* Smooth scrolling for anchor links */
html {
  scroll-padding-top: 2rem;
}

/* Selection color */
::selection {
  background: var(--primary-light);
  color: white;
}

/* Footer */
.footer {
  padding: 2rem 3rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  color: var(--text-light);
  font-size: 0.875rem;
}

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