/* service.css - doc (index/faq/services) 공통 스타일 + 테마 토글 버튼 */

/* =========================
   Theme tokens
   ========================= */
:root {
  --bg-main: #f4f5f9;
  --bg-elevated: #ffffff;
  --bg-elevated-soft: #f3f5fb;
  --border-subtle: #d3d7e5;
  --accent: #3e6bff;
  --text-main: #222222;
  --text-sub: #5c6272;
}

[data-theme='dark'] {
  --bg-main: #0b0c10;
  --bg-elevated: #151821;
  --bg-elevated-soft: #181b25;
  --border-subtle: #282c39;
  --accent: #3e6bff;
  --text-main: #f5f5f7;
  --text-sub: #a2a6b7;
}

/* =========================
   Base
   ========================= */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
}

a {
  color: var(--accent);
}

/* =========================
   Theme toggle button (메인과 동일한 느낌)
   - HTML이 <div class="support-topbar"> 안에 있든
   - body 바로 아래에 있든 둘 다 커버
   ========================= */
.support-topbar {
  position: fixed;
  top: 14px;
  right: 24px;
  z-index: 100;
}

/* doc 페이지에서 버튼을 body 바로 아래에 둔 경우 */
#themeToggle.nav-icon-btn {
  position: fixed;
  top: 14px;
  right: 24px;
  z-index: 100;
}

/* 공용 버튼 스타일 */
.nav-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 0;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease,
    transform 0.15s ease;
}

.nav-icon-btn:hover {
  background: rgba(62, 107, 255, 0.12);
  border-color: rgba(62, 107, 255, 0.35);
  transform: translateY(-1px);
}

.nav-icon-btn svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-sub);
  transition: stroke 0.15s ease;
}

.nav-icon-btn:hover svg {
  stroke: var(--accent);
}

/* =========================
   Layout
   ========================= */
.doc-layout {
  min-height: 100vh;
  display: flex;
  gap: 24px;
  padding: 24px 28px;
  box-sizing: border-box;
}

/* =========================
   Sidebar / Nav
   ========================= */
.sidebar {
  width: 220px;
  flex-shrink: 0;
}

.sidebar-title-link {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  background: #152338;
  color: #f5f7ff;
  font-weight: 600;
  margin-bottom: 18px;
  font-size: 0.95rem;
  text-decoration: none;
}

.sidebar-title-link:hover {
  background: #203450;
}

.nav-group {
  margin-bottom: 20px;
}

.nav-label {
  font-size: 0.78rem;
  color: var(--text-sub);
  margin-bottom: 6px;
  letter-spacing: 0.03em;
}

.nav-link {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-sub);
  text-decoration: none;
}

/* 다크모드 hover */
[data-theme='dark'] .nav-link:hover,
[data-theme='dark'] .nav-section-header:hover {
  background: var(--bg-elevated-soft);
  color: var(--text-main);
}

/* 라이트모드 hover – active는 제외 */
[data-theme='light'] .nav-link:not(.active):hover,
[data-theme='light'] .nav-section-header:hover {
  background: #e7eaf3;
  color: #222;
}

/* active */
.nav-link.active {
  background: #d2d5de;
  color: #1a1a1a;
}

[data-theme='dark'] .nav-link.active {
  background: #1f2531;
  color: #ffffff;
}

.nav-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  font-size: 0.9rem;
  color: var(--text-sub);
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
}

.nav-section-header span.chevron {
  font-size: 0.8rem;
  opacity: 0.7;
}

.nav-section-children {
  margin-left: 10px;
  border-left: 1px solid var(--border-subtle);
  padding-left: 8px;
  margin-top: 5px;
}

/* =========================
   Main - index.html (doc 홈)
   ========================= */
.main {
  flex: 1;
  min-width: 0;
}

.main-title {
  font-size: 2.3rem;
  font-weight: 700;
  margin: 4px 0 26px;
}

.card-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.link-card {
  flex: 1 1 220px;
  min-height: 120px;
  background: var(--bg-elevated);
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  text-decoration: none;
  color: var(--text-main);
  padding: 18px 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out,
    border-color 0.08s ease-out, background 0.08s ease-out;
}

.link-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  border-color: var(--accent);
  background: var(--bg-elevated-soft);
}

.link-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.link-card-desc {
  font-size: 0.9rem;
  color: var(--text-sub);
}

/* =========================
   FAQ page
   ========================= */
.main.faq-main {
  max-width: 780px;
}

.page-desc {
  font-size: 0.95rem;
  color: var(--text-sub);
  margin-bottom: 24px;
}

h2 {
  margin-top: 28px;
  margin-bottom: 14px;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--bg-elevated-soft);
  border-left: 4px solid var(--accent);
}

.faq-item {
  margin-top: 14px;
  background: var(--bg-elevated);
  border-radius: 12px;
  padding: 16px 18px;
  border: 1px solid var(--border-subtle);
}

.faq-item b {
  display: block;
  font-size: 1rem;
  margin-bottom: 8px;
  color: var(--text-main);
}

.faq-item p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-sub);
  word-break: keep-all;
}

/* =========================
   Services page (약관/개인정보)
   ========================= */
.main.services-main {
  max-width: 880px;
}

.chapter-title {
  margin-top: 32px;
  margin-bottom: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--bg-elevated-soft);
  border: 1px solid var(--border-subtle);
}

.section {
  margin-top: 18px;
  background: var(--bg-elevated);
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  padding: 18px 20px 20px;
}

.section-title {
  font-size: 1.02rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-main);
}

.section p,
.section ol {
  font-size: 0.94rem;
  color: var(--text-sub);
  word-break: keep-all;
}

.section ol {
  padding-left: 20px;
}

.section ol li {
  margin-bottom: 6px;
}

/* TOC (서비스 페이지 우측 목차) */
.toc {
  width: 230px;
  flex-shrink: 0;
  font-size: 0.9rem;
  color: var(--text-sub);
}

.toc-title {
  font-weight: 700;
  margin-bottom: 10px;
}

.toc-group {
  margin-bottom: 14px;
}

.toc-group-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0 0 0 4px;
  border-left: 1px solid var(--border-subtle);
}

.toc-list li {
  margin: 3px 0;
}

.toc-list a {
  text-decoration: none;
  color: var(--text-sub);
}

.toc-list a:hover {
  color: var(--accent);
}

/* =========================
   Responsive
   ========================= */
@media (max-width: 1100px) {
  .toc {
    display: none;
  }
}

@media (max-width: 900px) {
  .doc-layout {
    flex-direction: column;
    padding: 18px 14px 26px;
  }
  .sidebar {
    width: 100%;
  }
  .main-title {
    font-size: 1.9rem;
    margin-top: 10px;
  }
}
