/* ============================================================
   PAGES.CSS — Shared styles for Cloud Guard subpages
   (docs, faq, changelog, privacy, terms)
   ============================================================ */

/* ---------- PAGE HERO ---------- */
.page-hero {
  padding: calc(var(--nav-height) + 80px) 0 48px;
  text-align: center;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
  pointer-events: none;
  opacity: 0.5;
}

.page-title {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.page-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
}

/* ---------- PAGE CONTENT ---------- */
.page-content {
  padding: 64px 0 96px;
  background: var(--bg-primary);
  min-height: 60vh;
}

.content-container {
  max-width: 820px;
  margin: 0 auto;
}

/* ---------- DOC SECTIONS ---------- */
.doc-section {
  margin-bottom: 48px;
}

.doc-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.doc-section h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 28px;
  margin-bottom: 10px;
}

.doc-section p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.doc-section ul,
.doc-section ol {
  padding-left: 24px;
  margin-bottom: 16px;
}

.doc-section li {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.doc-section li strong {
  color: var(--text-primary);
}

.doc-section a {
  color: var(--accent-light);
  text-decoration: none;
  transition: color 0.2s;
}

.doc-section a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.doc-section code {
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 0.9em;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--accent-light);
  border: 1px solid var(--border-color);
}

/* ---------- DOC TABLE ---------- */
.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.doc-table th,
.doc-table td {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.95rem;
}

.doc-table th {
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.doc-table td {
  color: var(--text-secondary);
  border-top: 1px solid var(--border-color);
}

.doc-table tr:hover td {
  background: var(--bg-card);
}

/* ---------- FAQ ---------- */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md, 12px);
  overflow: hidden;
  transition: border-color 0.3s;
}

.faq-item[open] {
  border-color: var(--accent);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 20px 24px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-card);
  transition: background 0.2s;
  list-style: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::after {
  content: "+";
  flex-shrink: 0;
  margin-left: 16px;
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--accent-light);
  transition: transform 0.3s;
}

.faq-item[open] .faq-question::after {
  content: "−";
  transform: rotate(180deg);
}

.faq-question:hover {
  background: var(--bg-card-hover);
}

.faq-answer {
  padding: 0 24px 20px;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-secondary);
  background: var(--bg-card);
}

/* ---------- CHANGELOG ---------- */
.changelog-timeline {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.changelog-entry {
  position: relative;
  padding-left: 32px;
  border-left: 2px solid var(--border-color);
}

.changelog-entry::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-primary);
}

.changelog-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.changelog-version {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.changelog-date {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.changelog-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-latest {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.badge-upcoming {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-light);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

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

.change-type {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 6px;
  margin-bottom: 10px;
}

.type-new {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.type-security {
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-light);
}

.type-planned {
  background: rgba(168, 85, 247, 0.1);
  color: #a855f7;
}

.type-fix {
  background: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
}

.change-group ul {
  padding-left: 20px;
}

.change-group li {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.changelog-upcoming {
  opacity: 0.7;
}

.changelog-upcoming .changelog-entry::before {
  background: var(--accent-light);
  opacity: 0.5;
}

/* ---------- LEGAL (Privacy & Terms) ---------- */
.legal-content .doc-section h2 {
  font-size: 1.3rem;
}

.legal-content .doc-section ul {
  list-style: disc;
}

/* ---------- BACK TO TOP / NAV ---------- */
.page-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent-light);
  text-decoration: none;
  margin-bottom: 32px;
  transition: color 0.2s, gap 0.2s;
}

.page-back-link:hover {
  color: var(--accent);
  gap: 10px;
}

.page-back-link::before {
  content: "←";
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
  .page-hero {
    padding: calc(var(--nav-height) + 48px) 0 32px;
  }

  .page-content {
    padding: 40px 0 64px;
  }

  .content-container {
    padding: 0 8px;
  }

  .doc-section h2 {
    font-size: 1.25rem;
  }

  .faq-question {
    padding: 16px 18px;
    font-size: 0.95rem;
  }

  .faq-answer {
    padding: 0 18px 16px;
  }

  .changelog-entry {
    padding-left: 24px;
  }

  .changelog-version {
    font-size: 1.25rem;
  }

  .doc-table th,
  .doc-table td {
    padding: 10px 12px;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .page-title {
    font-size: 1.8rem;
  }

  .changelog-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
