/* =====================================================
   Discord メッセージ抽出Bot 作成ガイド - スタイルシート
   中央配置 + 上部進捗バー版
   ===================================================== */

/* CSS Variables */
:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --bg-card: #1c2128;

  --text-primary: #f0f6fc;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;

  --accent-primary: #5865F2;
  --accent-secondary: #7289DA;
  --accent-gradient: linear-gradient(135deg, #5865F2 0%, #7289DA 100%);

  --success: #3fb950;
  --warning: #d29922;
  --danger: #f85149;
  --info: #58a6ff;

  --border-color: #30363d;
  --border-radius: 12px;
  --border-radius-sm: 8px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);

  --nav-height: 120px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 20px);
}

body {
  font-family: 'Segoe UI', 'Hiragino Sans', 'Yu Gothic UI', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 16px;
}

/* Top Navigation */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.nav-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.progress-container {
  display: flex;
  align-items: center;
  gap: 16px;
}

.progress-bar {
  width: 200px;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 4px;
  width: 0%;
  transition: width 0.5s ease;
}

.progress-text {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  min-width: 100px;
}

.section-nav {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 12px 24px;
  background: var(--bg-tertiary);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.section-nav::-webkit-scrollbar {
  display: none;
}

.section-item {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 6px;
  white-space: nowrap;
  transition: var(--transition);
  border: 1px solid transparent;
}

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

.section-item.active {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

.section-item.completed {
  background: rgba(63, 185, 80, 0.2);
  color: var(--success);
  border-color: rgba(63, 185, 80, 0.4);
}

/* Main Content - Centered */
.main-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px;
  padding-top: calc(var(--nav-height) + 40px);
}

/* Header */
.header {
  text-align: center;
  padding: 60px 40px;
  background: var(--accent-gradient);
  border-radius: var(--border-radius);
  margin-bottom: 48px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.header h1 {
  font-size: 36px;
  font-weight: 700;
  color: white;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.header .subtitle {
  font-size: 28px;
  font-weight: 400;
}

.header-desc {
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  position: relative;
  z-index: 1;
}

/* Steps */
.step {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  margin-bottom: 32px;
  overflow: hidden;
  transition: var(--transition);
}

.step:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
}

.step-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 28px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--accent-gradient);
  color: white;
  font-size: 20px;
  font-weight: 700;
  border-radius: 50%;
  flex-shrink: 0;
}

.step-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.step-content {
  padding: 28px;
}

.step-content h3 {
  color: var(--accent-secondary);
  font-size: 17px;
  font-weight: 600;
  margin: 24px 0 12px 0;
}

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

.step-content p {
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* Goal List */
.goal-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.goal-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  background: var(--bg-tertiary);
  border-radius: var(--border-radius-sm);
  border-left: 4px solid var(--accent-primary);
}

.goal-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.goal-item p {
  margin: 0;
  color: var(--text-primary);
  font-size: 15px;
}

/* Step List */
.step-list {
  padding-left: 24px;
  color: var(--text-secondary);
}

.step-list li {
  margin-bottom: 12px;
  line-height: 1.8;
}

.step-list li strong {
  color: var(--text-primary);
}

.note {
  color: var(--text-muted);
  font-size: 14px;
}

/* Code Blocks */
.code-block {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  margin: 16px 0;
  overflow: hidden;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
}

.code-lang {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.copy-btn:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

.copy-btn.copied {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.code-block pre {
  padding: 20px;
  overflow-x: auto;
  margin: 0;
}

.code-block code {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.6;
  color: #e6edf3;
  white-space: pre;
}

/* Inline Code */
code {
  background: var(--bg-tertiary);
  padding: 3px 8px;
  border-radius: 4px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 14px;
  color: var(--info);
}

kbd {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 13px;
  font-family: 'Consolas', monospace;
  box-shadow: 0 2px 0 var(--border-color);
}

/* Alerts */
.alert {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-radius: var(--border-radius-sm);
  margin: 16px 0;
  align-items: flex-start;
}

.alert-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.alert p {
  margin: 0;
  font-size: 14px;
}

.alert-important {
  background: rgba(88, 166, 255, 0.1);
  border: 1px solid rgba(88, 166, 255, 0.3);
}

.alert-important p {
  color: var(--info);
}

.alert-warning {
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid rgba(248, 81, 73, 0.3);
}

.alert-warning p {
  color: var(--danger);
}

/* Link Card */
.link-card {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  margin: 16px 0;
  align-items: center;
}

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

.link-card strong {
  display: block;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.link-card a {
  color: var(--accent-primary);
  text-decoration: none;
  font-size: 14px;
  transition: var(--transition);
}

.link-card a:hover {
  color: var(--accent-secondary);
  text-decoration: underline;
}

/* Result Box */
.result-box {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: rgba(63, 185, 80, 0.1);
  border: 1px solid rgba(63, 185, 80, 0.3);
  border-radius: var(--border-radius-sm);
  margin: 20px 0;
  align-items: flex-start;
}

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

.result-box strong {
  display: block;
  color: var(--success);
  margin-bottom: 4px;
}

.result-box p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
}

/* Adjustment Table */
.adjustment-table {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0;
}

.adjustment-row {
  display: flex;
  gap: 20px;
  padding: 20px;
  background: var(--bg-tertiary);
  border-radius: var(--border-radius-sm);
  align-items: center;
  flex-wrap: wrap;
}

.adjustment-problem {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 200px;
}

.adjustment-problem .icon {
  font-size: 24px;
}

.adjustment-solution {
  color: var(--text-secondary);
  font-size: 15px;
}

.adjustment-solution strong {
  color: var(--accent-primary);
}

/* File Tree */
.file-tree {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.file-group {
  padding: 20px;
  background: var(--bg-tertiary);
  border-radius: var(--border-radius-sm);
  border-left: 4px solid var(--border-color);
}

.file-group.highlight {
  border-left-color: var(--success);
  background: rgba(63, 185, 80, 0.05);
}

.file-group h4 {
  color: var(--text-primary);
  font-size: 15px;
  margin-bottom: 8px;
}

.file-group code {
  display: block;
  margin-top: 4px;
}

/* Footer */
.footer {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  margin-top: 60px;
}

/* Responsive */
@media (max-width: 768px) {
  :root {
    --nav-height: 100px;
  }

  .nav-container {
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
  }

  .progress-bar {
    width: 150px;
  }

  .section-nav {
    padding: 8px 16px;
  }

  .section-item {
    padding: 6px 10px;
    font-size: 12px;
  }

  .main-content {
    padding: 20px 16px;
    padding-top: calc(var(--nav-height) + 30px);
  }

  .header {
    padding: 40px 20px;
  }

  .header h1 {
    font-size: 24px;
  }

  .header .subtitle {
    font-size: 20px;
  }

  .step-header {
    padding: 20px;
  }

  .step-content {
    padding: 20px;
  }

  .code-block pre {
    padding: 16px;
  }

  .code-block code {
    font-size: 12px;
  }

  .adjustment-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-color);
}