/* Warm & Friendly theme for docs.dtwhk.com */
:root {
  --bg: #fefcfb;
  --text: #1a1523;
  --text-muted: #6f6378;
  --border: #e8e2da;
  --card-bg: #ffffff;
  --accent: #7c5cbf;
  --accent-hover: #6a4dab;
  --warning-bg: #fff8e1;
  --warning-border: #f9a825;
  --info-bg: #e8f4fd;
  --info-border: #64b5f6;
  --code-bg: #2d2b3d;
  --code-text: #e6e1f0;
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  --radius: 16px;
  --radius-sm: 8px;

  /* Legacy aliases for compatibility */
  --muted: var(--text-muted);
  --primary: var(--accent);
}

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

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

/* ===== Header ===== */
.header {
  background: linear-gradient(135deg, #f8f0e8 0%, #fefcfb 100%);
  color: var(--text);
  padding: 2.5rem 2rem 1.5rem;
  text-align: center;
}
.header .back-link {
  display: inline-block;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  transition: color 0.2s;
}
.header .back-link:hover { color: var(--accent); }
.header h1 { font-size: 2.2rem; margin-bottom: 0.5rem; color: var(--text); }
.header p { opacity: 0.75; font-size: 1.1rem; margin-bottom: 1rem; color: var(--text); }

/* ===== Container ===== */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2.4rem 1.8rem;
}

/* ===== Language switcher ===== */
.lang-switcher {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.lang-btn {
  background: #f3eeea;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.3rem 0.9rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}
.lang-btn:hover { background: #ede6e0; border-color: #d5ccc4; }
.lang-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  font-weight: 600;
}

/* ===== Step cards ===== */
.step {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.8rem;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}
.step-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.75rem 1.75rem 0;
  margin-bottom: 1rem;
}
.step-number {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
}
.step-body {
  padding: 0 1.75rem 1.75rem;
}
.step-body p { margin-bottom: 0.75rem; }
.step-body p:last-child { margin-bottom: 0; }

/* ===== Warning box ===== */
.warning {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.warning strong { color: #a06000; }
.warning .icon {
  flex-shrink: 0;
  font-size: 1.1rem;
  margin-top: 1px;
}

/* ===== Info box ===== */
.info {
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
}
.info strong { color: #1565c0; }

/* ===== Illustration ===== */
.illustration {
  margin: 1rem 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #faf8f6;
}
.illustration svg {
  width: 100%;
  height: auto;
  display: block;
}
.illustration-caption {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 0.5rem 0 0;
  font-style: italic;
}

/* ===== URL block ===== */
.url-block {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #f5f0eb;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
  word-break: break-all;
  margin: 0.5rem 0;
}
.url-block a { color: inherit; text-decoration: none; }
.url-block a:hover { text-decoration: underline; }

/* ===== Code blocks ===== */
pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 1.2rem 1.4rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
  position: relative;
}
pre .prompt { color: #a78bfa; user-select: none; }
pre .comment { color: #8b8094; }
pre .output { color: #9ca3af; }
code {
  background: #f0ebf8;
  color: #5a3e8a;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.88em;
}
pre code { background: none; color: inherit; padding: 0; font-size: inherit; }

/* ===== Done section ===== */
.done {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
}
.done .check {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #ede7f6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.done .check svg { width: 28px; height: 28px; color: var(--accent); }
.done h2 { font-size: 1.3rem; margin-bottom: 0.5rem; }
.done p { color: var(--text-muted); font-size: 0.95rem; }
.done a { color: var(--accent); }

/* ===== Tab navigation ===== */
.tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.tab-nav::-webkit-scrollbar { display: none; }
.tab-btn {
  background: none;
  border: none;
  padding: 0.7rem 0.6rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex: 1;
}
.tab-btn:hover { color: var(--text); background: rgba(124, 92, 191, 0.04); }
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.tab-num {
  background: #d5cce4;
  color: white;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.tab-btn.active .tab-num { background: var(--accent); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Step inside tab (attached to tab bar) */
.tab-content .step {
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  margin-bottom: 0;
}

/* ===== Nav buttons (prev/next inside tabs) ===== */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
  padding: 0 1.75rem 1.75rem;
}
.nav-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.65rem 1.6rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.2s;
}
.nav-btn:hover { background: var(--accent-hover); }
.nav-btn:disabled { background: #d5cce4; color: #a09ab0; cursor: not-allowed; }
.nav-btn.prev { background: #b5adc4; }
.nav-btn.prev:hover { background: #9e95b2; }

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 2.5rem 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ===== Homepage: Section title ===== */
.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ===== Homepage: Guide list & cards ===== */
.guide-list {
  display: grid;
  gap: 1rem;
  margin-bottom: 3rem;
}
.guide-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.75rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  box-shadow: var(--card-shadow);
}
.guide-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(124, 92, 191, 0.12);
  transform: translateY(-1px);
}
.guide-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

/* Legacy color variants (for existing HTML using .green / .blue) */
.guide-icon.green { background: linear-gradient(135deg, #e8f5e9, #f1f8e9); color: #2e7d32; }
.guide-icon.blue  { background: linear-gradient(135deg, #e3f2fd, #e8eaf6); color: #1565c0; }

/* Category-specific card icon gradients */
.guide-card.gitea   .guide-icon { background: linear-gradient(135deg, #e8f5e9, #f1f8e9); color: #2e7d32; }
.guide-card.slack   .guide-icon { background: linear-gradient(135deg, #e3f2fd, #e8eaf6); color: #1565c0; }
.guide-card.google  .guide-icon { background: linear-gradient(135deg, #fff3e0, #fce4ec); color: #e65100; }
.guide-card.outlook .guide-icon { background: linear-gradient(135deg, #ede7f6, #e8eaf6); color: #4527a0; }

.guide-info { flex: 1; min-width: 0; }
.guide-info h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}
.guide-info p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
}
.guide-arrow {
  flex-shrink: 0;
  color: #d5cce4;
  transition: color 0.2s;
}
.guide-card:hover .guide-arrow { color: var(--accent); }

/* ===== Homepage: Hero greeting ===== */
.hero-greeting {
  text-align: center;
  padding: 2rem 0 2.5rem;
}
.hero-greeting h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.hero-greeting p {
  color: var(--text-muted);
  font-size: 1rem;
}

/* ===== Category emoji ===== */
.category-emoji {
  font-size: 1.15rem;
  line-height: 1;
}

/* ===== Screenshot (guide pages) ===== */
.screenshot {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 1rem 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
}
.screenshot img { width: 100%; display: block; }
.screenshot .caption {
  background: #f5f0eb;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* ===== Copy button ===== */
.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: #3d3850;
  color: #c9bfe6;
  border: 1px solid #5a5270;
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.2s;
}
.copy-btn:hover { background: #524d6a; }

/* ===== Troubleshooting table ===== */
table.trouble { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
table.trouble th,
table.trouble td {
  padding: 0.7rem 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
table.trouble thead th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
table.trouble thead tr { border-bottom: 2px solid var(--border); }
table.trouble tbody tr:hover { background: #faf7f5; }

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .header { padding: 2rem 1.25rem 1.5rem; }
  .header h1 { font-size: 1.5rem; }
  .container { padding: 1.75rem 1.25rem; }
  .step-body { padding: 0 1.25rem 1.25rem; }
  .step-header { padding: 1.25rem 1.25rem 0; }
  .nav-buttons { padding: 0 1.25rem 1.25rem; }
  .tab-btn { padding: 0.6rem 0.5rem; font-size: 0.8rem; }
  .guide-card { padding: 1.1rem 1.25rem; }
  .guide-icon { width: 42px; height: 42px; }
}
