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

body {
  font-family:
    'Inter',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    sans-serif;
  font-size: 16px;
  line-height: 1.5;
  background: #fafafa;
  color: #1d1d1f;
}

.tutorial-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid #d1d1d6;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.logo {
  font-weight: 600;
  font-size: 20px;
  color: #4a7c59;
  text-decoration: none;
  margin-bottom: 2px;
}

.step-progress {
  font-size: 12px;
  color: #86868b;
  font-weight: 500;
}

.nav-btn {
  background: rgba(74, 124, 89, 0.1);
  border: 1px solid rgba(74, 124, 89, 0.2);
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #4a7c59;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  min-width: 90px;
  justify-content: center;
}

.nav-btn:hover {
  background: rgba(74, 124, 89, 0.15);
  border-color: rgba(74, 124, 89, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(74, 124, 89, 0.15);
}

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

.nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: #f5f5f7;
  border-color: #e5e5e7;
  color: #86868b;
}

.nav-btn:disabled:hover {
  background: #f5f5f7;
  transform: none;
  box-shadow: none;
}

.nav-icon {
  font-size: 14px;
  font-weight: 600;
}

.nav-text {
  font-size: 14px;
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  min-height: 0;
}

/* Left Panel - Content */
.content-panel {
  width: 50%;
  background: white;
  border-right: 1px solid #e5e5e7;
  overflow-y: auto;
  padding: 48px;
}

.content-panel h1 {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 24px;
  color: #1d1d1f;
  line-height: 1.25;
}

.content-panel h2 {
  font-size: 24px;
  font-weight: 600;
  margin: 40px 0 20px 0;
  color: #1d1d1f;
  line-height: 1.3;
}

.content-panel h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 32px 0 16px 0;
  color: #1d1d1f;
  line-height: 1.4;
}

.content-panel p {
  margin-bottom: 20px;
  color: #424245;
  line-height: 1.7;
  font-size: 16px;
}

.content-panel ul {
  margin: 20px 0;
  padding-left: 24px;
}

.content-panel ul li {
  margin-bottom: 12px;
  color: #424245;
  line-height: 1.7;
  font-size: 16px;
}

.content-panel ul li::marker {
  color: #4a7c59;
}

.content-panel ol {
  margin: 20px 0;
  padding-left: 24px;
}

.content-panel ol li {
  margin-bottom: 12px;
  color: #424245;
  line-height: 1.7;
  font-size: 16px;
}

.content-panel ol li::marker {
  color: #4a7c59;
  font-weight: 600;
}

.content-panel code {
  background: rgba(74, 124, 89, 0.1);
  padding: 3px 8px;
  border-radius: 6px;
  font-family:
    'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  font-size: 14px;
  color: #4a7c59;
  border: 1px solid rgba(74, 124, 89, 0.15);
}

.content-panel pre {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  padding: 20px;
  border-radius: 12px;
  margin: 24px 0;
  overflow-x: auto;
  font-family:
    'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.content-panel pre code {
  background: none;
  padding: 0;
  border: none;
  color: #495057;
}

.content-panel table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.content-panel th,
.content-panel td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #e5e5e7;
}

.content-panel th {
  font-weight: 600;
  background: #f8f9fa;
  color: #495057;
}

/* Right Panel - Code */
.code-panel {
  width: 50%;
  background: #1e1e1e;
  display: flex;
  flex-direction: column;
}

.code-header {
  background: #2d2d30;
  padding: 16px 24px;
  border-bottom: 1px solid #3e3e42;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-shrink: 0;
}

.render-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.format-select {
  background: #3c3c3c;
  border: 1px solid #4a4a4a;
  border-radius: 6px;
  padding: 6px 12px;
  color: #cccccc;
  font-size: 14px;
  cursor: pointer;
}

.format-select:focus {
  outline: none;
  border-color: #4a7c59;
}

.render-btn {
  background: #4a7c59;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  color: white;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.render-btn:hover {
  background: #3a6247;
}

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

.editor-container {
  flex: 2;
  min-height: 0;
  border-bottom: 1px solid #3e3e42;
}

.cm-editor {
  height: 100%;
  font-family:
    'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

.cm-focused {
  outline: none;
}

.output-panel {
  background: #252526;
  flex: 1;
  min-height: 120px;
  display: flex;
  flex-direction: column;
}

.output-header {
  background: #2d2d30;
  padding: 12px 24px;
  border-bottom: 1px solid #3e3e42;
  font-weight: 500;
  color: #cccccc;
  font-size: 14px;
  flex-shrink: 0;
}

.output-content {
  padding: 16px 24px;
  font-family:
    'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  font-size: 14px;
  color: #cccccc !important;
  white-space: pre-wrap;
  overflow-y: auto;
  flex: 1;
  line-height: 1.4;
}

/* Error and success states for output */
.output-content.output-error {
  color: #f48771 !important;
  background: rgba(244, 135, 113, 0.1);
}

.output-content.output-success {
  color: #cccccc !important;
  background: rgba(169, 220, 118, 0.05);
}

.step-list {
  position: fixed;
  top: 60px;
  left: 0;
  width: 300px;
  height: calc(100vh - 60px);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid #e5e5e7;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 90;
  overflow-y: auto;
  padding: 24px 0;
}

.step-list.show {
  transform: translateX(0);
}

.step-list-item {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  text-decoration: none;
  color: #424245;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 15px;
  border-left: 4px solid transparent;
  position: relative;
}

.step-list-item:hover {
  background: rgba(74, 124, 89, 0.05);
  border-left-color: rgba(74, 124, 89, 0.3);
}

.step-list-item.active {
  background: rgba(74, 124, 89, 0.1);
  color: #4a7c59;
  font-weight: 500;
  border-left-color: #4a7c59;
}

.step-list-item.completed:before {
  content: '✓';
  position: absolute;
  right: 24px;
  color: #4a7c59;
  font-weight: 600;
  font-size: 14px;
}

.step-list-item.active.completed:before {
  color: #4a7c59;
}

.step-list-toggle {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 8px;
  color: #424245;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 80;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.overlay.show {
  opacity: 1;
  visibility: visible;
}

/* Ensure code panel is visible by default */
.code-panel {
  display: flex !important;
}

@media (max-width: 768px) {
  .main-content {
    flex-direction: column;
  }

  .content-panel,
  .code-panel {
    width: 100%;
    display: flex !important;
  }

  .content-panel {
    min-height: 400px;
  }

  .code-panel {
    min-height: 500px;
  }
}

.footer-attribution {
  background: #fff;
  padding: 8px 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-top: 1px solid #e5e5e7;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.04);
}

.footer-content {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #4a7c59;
  font-size: 14px;
}

.footer-logo {
  height: 24px;
  width: auto;
  /* Match green color like header logo */
  filter: brightness(0) saturate(100%) invert(38%) sepia(16%) saturate(1097%) hue-rotate(74deg)
    brightness(92%) contrast(92%);
}
