/* ==========================================================================
   SalahSync — Privacy Policy
   Palette derived from the app icon: deep teal/green gradient + gold accent
   ========================================================================== */

:root {
  --brand-dark: #0d3b33;
  --brand: #146356;
  --brand-mid: #1f7a5c;
  --brand-light: #34b892;
  --gold: #d9a441;
  --gold-soft: #f0c869;

  --bg: #f7f6f0;
  --surface: #ffffff;
  --surface-2: #f1efe6;
  --text: #1b2421;
  --text-muted: #5b665f;
  --border: #e4e1d4;

  --shadow: 0 10px 30px rgba(13, 59, 51, 0.08);
  --radius: 16px;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0b1512;
  --surface: #10201b;
  --surface-2: #142822;
  --text: #eef3f0;
  --text-muted: #a9b8b1;
  --border: #1d3830;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1512;
    --surface: #10201b;
    --surface-2: #142822;
    --text: #eef3f0;
    --text-muted: #a9b8b1;
    --border: #1d3830;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

* { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: background-color 0.25s ease, color 0.25s ease;
}

h1, h2, h3, .brand-text, .hero-title {
  font-family: "Poppins", "Inter", sans-serif;
}

a { color: var(--brand-mid); }
a:hover { color: var(--brand-light); }

/* ---------- Scroll progress bar ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--brand-light), var(--gold));
  z-index: 1100;
  transition: width 0.1s ease-out;
}

/* ---------- Navbar ---------- */
.app-navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(13, 59, 51, 0.05);
  padding-top: .6rem;
  padding-bottom: .6rem;
}

.brand-text {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--brand-dark);
}
:root[data-theme="dark"] .brand-text { color: var(--brand-light); }

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--brand-mid);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease;
}
.theme-toggle:hover { transform: rotate(-12deg); background: var(--surface); }

.toc-pills .nav-link {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.92rem;
  padding: .5rem .75rem;
  border-radius: 999px;
}
.toc-pills .nav-link:hover,
.toc-pills .nav-link.active {
  color: var(--brand-dark);
  background: var(--surface-2);
}
:root[data-theme="dark"] .toc-pills .nav-link.active,
:root[data-theme="dark"] .toc-pills .nav-link:hover {
  color: var(--brand-light);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 7.5rem 1rem 4.5rem;
  background: radial-gradient(120% 140% at 50% -10%, #1a5b4a 0%, var(--brand-dark) 55%, #082720 100%);
  color: #f6fbf9;
}

.hero-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(52, 184, 146, 0.35), transparent 40%),
    radial-gradient(circle at 85% 15%, rgba(217, 164, 65, 0.25), transparent 45%);
  pointer-events: none;
}

.hero-logo {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.hero-title {
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 2.9rem);
  margin-bottom: .5rem;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  color: rgba(246, 251, 249, 0.78);
  font-size: 1.05rem;
  margin-bottom: 1.25rem;
}

.updated-badge {
  background: rgba(217, 164, 65, 0.16);
  color: var(--gold-soft);
  border: 1px solid rgba(217, 164, 65, 0.4);
  font-weight: 500;
  font-size: 0.85rem;
  padding: .5rem 1rem;
  border-radius: 999px;
}

/* ---------- Content layout ---------- */
.content-wrap {
  padding-top: 3.5rem;
  padding-bottom: 4rem;
}

.sidebar-sticky {
  position: sticky;
  top: 6rem;
}

.sidebar-title {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: .75rem;
}

.side-toc .nav-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: var(--text-muted);
  font-size: .92rem;
  font-weight: 500;
  padding: .5rem .75rem;
  border-radius: 10px;
  border-left: 2px solid transparent;
}

.side-toc .nav-link i { font-size: 1rem; color: var(--brand-light); }

.side-toc .nav-link:hover {
  background: var(--surface-2);
  color: var(--text);
}

.side-toc .nav-link.active {
  color: var(--brand-dark);
  background: var(--surface-2);
  border-left-color: var(--brand-light);
  font-weight: 600;
}
:root[data-theme="dark"] .side-toc .nav-link.active { color: var(--brand-light); }

/* ---------- Policy sections ---------- */
.policy-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem clamp(1.25rem, 3vw, 2.5rem);
  margin-bottom: 1.5rem;
  scroll-margin-top: 6.5rem;
}

.policy-section-last { margin-bottom: 0; }

.section-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand-mid), var(--brand-light));
  color: #fff;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.policy-section h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--brand-dark);
  margin-bottom: .85rem;
}
:root[data-theme="dark"] .policy-section h2 { color: var(--brand-light); }

.policy-section p {
  color: var(--text-muted);
  line-height: 1.75;
  font-size: 1rem;
  margin-bottom: 1rem;
}
.policy-section p:last-child { margin-bottom: 0; }

/* ---------- Footer ---------- */
.app-footer {
  background: var(--brand-dark);
  color: rgba(246, 251, 249, 0.75);
  padding: 2.5rem 1rem;
}

.footer-tagline {
  color: #f6fbf9;
  font-weight: 600;
}

.footer-copy { font-size: .85rem; }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--brand-mid), var(--brand-light));
  color: #fff;
  font-size: 1.1rem;
  box-shadow: 0 8px 20px rgba(13, 59, 51, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  z-index: 1000;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover { filter: brightness(1.08); }

/* ---------- Responsive tweaks ---------- */
@media (max-width: 991.98px) {
  .hero { padding: 6.5rem 1rem 3.5rem; }
  .content-wrap { padding-top: 2.5rem; }
  .toc-pills {
    background: var(--surface-2);
    border-radius: 14px;
    padding: .5rem;
  }
}

@media (max-width: 575.98px) {
  .policy-section { padding: 1.5rem 1.25rem; }
  .back-to-top { right: 1rem; bottom: 1.25rem; }
}
