/* ==========================================================================
   ShlokaSvara — Privacy Policy Stylesheet
   Modern, Accessible, Responsive, Print-Ready
   Themes: Parchment (Manuscript), Light (Clean), Dark (Modern)
   ========================================================================== */

:root {
  /* Common typography and dimensions */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  --font-serif: "Georgia", "Cambria", "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --max-width: 1200px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition: all 0.25s ease-in-out;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
}

/* --------------------------------------------------------------------------
   Theme 1: Parchment / Manuscript (Default Royal Talapatra Inspired)
   -------------------------------------------------------------------------- */
body[data-theme="parchment"] {
  --bg-page: #fdfaf3;
  --bg-card: #f9f3e5;
  --bg-card-subtle: #f3ecd6;
  --border-color: #e4d7b8;
  --border-focus: #c58d34;
  --text-main: #342718;
  --text-muted: #6b5740;
  --text-subtle: #8a7356;
  --accent-gold: #c58d34;
  --accent-saffron: #b85d19;
  --accent-saffron-light: #fbeee3;
  --accent-green: #2d7a46;
  --accent-green-bg: #eaf4ed;
  --accent-red: #a72828;
  --accent-red-bg: #fae8e8;
  --header-bg: rgba(253, 250, 243, 0.95);
  --sidebar-bg: #f9f3e5;
  --code-bg: #efe6cb;
  --highlight-border: #e0cca1;
}

/* --------------------------------------------------------------------------
   Theme 2: Light (Clean White & Slate)
   -------------------------------------------------------------------------- */
body[data-theme="light"] {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  --accent-gold: #d97706;
  --accent-saffron: #ea580c;
  --accent-saffron-light: #fff7ed;
  --accent-green: #15803d;
  --accent-green-bg: #dcfce7;
  --accent-red: #b91c1c;
  --accent-red-bg: #fee2e2;
  --header-bg: rgba(255, 255, 255, 0.95);
  --sidebar-bg: #ffffff;
  --code-bg: #f1f5f9;
  --highlight-border: #cbd5e1;
}

/* --------------------------------------------------------------------------
   Theme 3: Dark (Slate Deep & Amber Accent)
   -------------------------------------------------------------------------- */
body[data-theme="dark"] {
  --bg-page: #0f172a;
  --bg-card: #1e293b;
  --bg-card-subtle: #273549;
  --border-color: #334155;
  --border-focus: #f59e0b;
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-subtle: #94a3b8;
  --accent-gold: #f59e0b;
  --accent-saffron: #f97316;
  --accent-saffron-light: #431407;
  --accent-green: #22c55e;
  --accent-green-bg: #064e3b;
  --accent-red: #ef4444;
  --accent-red-bg: #7f1d1d;
  --header-bg: rgba(15, 23, 42, 0.95);
  --sidebar-bg: #1e293b;
  --code-bg: #0b1120;
  --highlight-border: #475569;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 85px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.68;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Reading Progress Indicator */
#progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: transparent;
  z-index: 1000;
}

#progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-saffron), var(--accent-gold));
  transition: width 0.1s ease-out;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  background-color: var(--header-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  z-index: 999;
  padding: 14px 0;
  transition: var(--transition);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  font-family: var(--font-serif);
  font-size: 26px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-saffron), var(--accent-gold));
  color: #fff;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.brand-info h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.2;
}

.brand-info .subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-switch {
  display: inline-flex;
  background: var(--bg-card-subtle);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.theme-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.theme-btn:hover {
  color: var(--text-main);
}

.theme-btn.active {
  background: var(--bg-card);
  color: var(--accent-saffron);
  box-shadow: var(--shadow-sm);
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 7px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.action-btn:hover {
  border-color: var(--accent-gold);
  color: var(--accent-saffron);
}

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
.hero-section {
  padding: 40px 0 20px;
}

.hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, var(--accent-saffron), var(--accent-gold));
}

.meta-badge-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 9999px;
}

.badge-success {
  background: var(--accent-green-bg);
  color: var(--accent-green);
}

.badge-primary {
  background: var(--accent-saffron-light);
  color: var(--accent-saffron);
}

.badge-neutral {
  background: var(--bg-card-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.badge-danger {
  background: var(--accent-red-bg);
  color: var(--accent-red);
}

.hero-card h2 {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
  color: var(--text-main);
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 900px;
  line-height: 1.7;
  margin-bottom: 24px;
}

.app-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  background: var(--bg-card-subtle);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 28px;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
}

.meta-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.meta-value code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--accent-saffron);
}

/* Privacy Highlights Grid */
.privacy-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.highlight-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.highlight-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-gold);
}

.card-icon {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.highlight-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-main);
}

.highlight-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Layout (TOC + Content)
   -------------------------------------------------------------------------- */
.main-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
  margin-top: 30px;
  margin-bottom: 60px;
  align-items: start;
}

/* TOC Sidebar */
.toc-sidebar {
  position: sticky;
  top: 90px;
}

.toc-sticky-box {
  background: var(--sidebar-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.toc-heading {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.toc-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toc-link {
  font-size: 0.84rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  line-height: 1.4;
}

.toc-link:hover {
  color: var(--accent-saffron);
  background: var(--bg-card-subtle);
}

.toc-link.active {
  color: var(--accent-saffron);
  font-weight: 700;
  background: var(--accent-saffron-light);
  border-left: 3px solid var(--accent-saffron);
}

.quick-audit-summary {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-color);
}

.quick-audit-summary h4 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-subtle);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.audit-list {
  list-style: none;
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.audit-list .check-icon {
  color: var(--accent-green);
  font-weight: bold;
  margin-right: 4px;
}

/* --------------------------------------------------------------------------
   Policy Content Sections
   -------------------------------------------------------------------------- */
.policy-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 44px 40px;
  box-shadow: var(--shadow-sm);
}

.policy-section {
  padding-bottom: 38px;
  margin-bottom: 38px;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.policy-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.section-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-saffron);
  margin-bottom: 6px;
}

.policy-section h2 {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 14px;
  line-height: 1.3;
}

.policy-section h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 22px 0 10px;
}

.policy-section p {
  color: var(--text-muted);
  margin-bottom: 14px;
  font-size: 0.98rem;
  line-height: 1.75;
}

.policy-section ul {
  padding-left: 22px;
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.75;
}

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

.policy-section code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--accent-saffron);
}

.feature-bullets {
  list-style: square;
}

/* Callouts */
.callout {
  padding: 18px 20px;
  border-radius: var(--radius-md);
  margin: 20px 0;
  font-size: 0.94rem;
  line-height: 1.65;
}

.callout-info {
  background: var(--accent-saffron-light);
  border-left: 4px solid var(--accent-saffron);
  color: var(--text-main);
}

/* Tables */
.data-table-wrapper {
  overflow-x: auto;
  margin: 20px 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.data-spec-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.data-spec-table th {
  background: var(--bg-card-subtle);
  color: var(--text-main);
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.data-spec-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
  vertical-align: middle;
}

.data-spec-table tbody tr:last-child td {
  border-bottom: none;
}

.data-spec-table tbody tr:hover {
  background: var(--bg-card-subtle);
}

.text-success {
  color: var(--accent-green);
}

/* Architecture Grid */
.architecture-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.arch-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
}

.arch-box h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-main);
}

.arch-box p {
  font-size: 0.88rem;
  margin-bottom: 0;
  line-height: 1.55;
}

/* Permissions Pill Grid */
.permission-pill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.perm-pill {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Audit Badges List */
.audit-badges-list {
  list-style: none;
  padding-left: 0;
}

.audit-badges-list li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 12px;
}

.audit-badges-list li::before {
  content: "✔";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent-green);
  font-weight: bold;
}

/* Contact Card */
.contact-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}

.contact-label {
  font-weight: 700;
  color: var(--text-subtle);
  min-width: 180px;
}

.contact-value {
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.contact-value a {
  color: var(--accent-saffron);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}

.copy-email-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.copy-email-btn:hover {
  color: var(--text-main);
  border-color: var(--accent-gold);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
  padding: 30px 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-left .copyright {
  font-size: 0.8rem;
  color: var(--text-subtle);
  margin-top: 4px;
}

.back-to-top {
  color: var(--accent-saffron);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.back-to-top:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Toast Notification
   -------------------------------------------------------------------------- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text-main);
  color: var(--bg-card);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 10000;
}

.toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Responsive & Mobile Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .main-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .toc-sidebar {
    position: static;
  }

  .policy-content {
    padding: 30px 22px;
  }

  .hero-card {
    padding: 26px 20px;
  }

  .hero-card h2 {
    font-size: 1.65rem;
  }
}

@media (max-width: 640px) {
  .header-container {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .contact-label {
    min-width: 100%;
  }

  .permission-pill-grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   Print Stylesheet (Perfect for PDF Export or Legal Filing)
   -------------------------------------------------------------------------- */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt;
  }

  .site-header,
  .theme-switch,
  .action-btn,
  #progress-container,
  .toc-sidebar,
  .copy-email-btn,
  .back-to-top,
  .toast {
    display: none !important;
  }

  .main-layout {
    display: block !important;
    margin: 0 !important;
  }

  .policy-content,
  .hero-card {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    background: transparent !important;
  }

  .policy-section {
    page-break-inside: avoid;
    border-bottom: 1px solid #ccc !important;
    margin-bottom: 24pt !important;
    padding-bottom: 24pt !important;
  }

  a {
    color: #000000 !important;
    text-decoration: underline !important;
  }
}

