/* ==========================================================================
   Privacy Policy - Stylesheet
   Modern, Accessible, Responsive & Print-Friendly
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Custom Properties / Design Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Color Palette */
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-header: rgba(255, 255, 255, 0.88);
  
  --text-primary: #0f172a;       /* Slate 900 */
  --text-secondary: #334155;     /* Slate 700 */
  --text-muted: #64748b;         /* Slate 500 */
  --text-inverse: #ffffff;
  
  --brand-primary: #2563eb;     /* Blue 600 */
  --brand-hover: #1d4ed8;       /* Blue 700 */
  --brand-subtle: #eff6ff;      /* Blue 50 */
  --brand-border: #bfdbfe;      /* Blue 200 */

  --accent-success: #059669;    /* Emerald 600 */
  --accent-success-bg: #ecfdf5; /* Emerald 50 */
  --accent-success-border: #a7f3d0;
  
  --accent-warning: #d97706;    /* Amber 600 */
  --accent-warning-bg: #fffbeb; /* Amber 50 */
  --accent-warning-border: #fde68a;

  --border-color: #e2e8f0;      /* Slate 200 */
  --border-light: #f1f5f9;      /* Slate 100 */
  --border-focus: #2563eb;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Spacing */
  --max-width: 900px;
  --header-height: 70px;
  
  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-card: 0 2px 8px -2px rgba(15, 23, 42, 0.06), 0 1px 4px -1px rgba(15, 23, 42, 0.04);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-secondary);
  line-height: 1.7;
  letter-spacing: -0.011em;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Accessible Skip Link */
.skip-link {
  position: absolute;
  top: -60px;
  left: 20px;
  background: var(--brand-primary);
  color: var(--text-inverse);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  z-index: 9999;
  transition: top var(--transition-fast);
  box-shadow: var(--shadow-md);
}

.skip-link:focus {
  top: 15px;
  outline: 3px solid #93c5fd;
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   3. Reading Progress Bar
   -------------------------------------------------------------------------- */
.reading-progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  z-index: 1001;
}

.reading-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6, #2563eb, #1d4ed8);
  transition: width 50ms ease-out;
}

/* --------------------------------------------------------------------------
   4. Sticky Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  width: 100%;
  height: var(--header-height);
  background-color: var(--bg-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: box-shadow var(--transition-normal);
}

.site-header.is-scrolled {
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.header-logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  object-fit: cover;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.header-badge {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  background-color: var(--brand-subtle);
  color: var(--brand-primary);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-full);
}

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

.header-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.header-action-btn:hover {
  background-color: var(--bg-subtle);
  color: var(--text-primary);
  border-color: var(--border-color-hover);
}

.header-action-btn.btn-primary {
  background-color: var(--brand-primary);
  color: var(--text-inverse);
  border-color: var(--brand-primary);
}

.header-action-btn.btn-primary:hover {
  background-color: var(--brand-hover);
}

/* --------------------------------------------------------------------------
   5. Layout & Container
   -------------------------------------------------------------------------- */
.main-wrapper {
  flex: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 40px 24px 80px 24px;
}

/* --------------------------------------------------------------------------
   6. Hero & Document Header
   -------------------------------------------------------------------------- */
.policy-hero {
  margin-bottom: 32px;
  text-align: left;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--brand-primary);
  background-color: var(--brand-subtle);
  border: 1px solid var(--brand-border);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
}

.hero-tag-pulse {
  width: 7px;
  height: 7px;
  background-color: var(--brand-primary);
  border-radius: 50%;
  animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

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

.policy-subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 680px;
  margin-bottom: 24px;
}

/* Metadata Bar / Details Box */
.metadata-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
}

.metadata-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metadata-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.metadata-value {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
}

/* Callout Summary Banner */
.privacy-highlight-banner {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background-color: var(--accent-success-bg);
  border: 1px solid var(--accent-success-border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 32px;
}

.highlight-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  color: var(--accent-success);
}

.highlight-content h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #065f46;
  margin-bottom: 4px;
}

.highlight-content p {
  font-size: 0.9375rem;
  color: #047857;
  line-height: 1.55;
}

/* --------------------------------------------------------------------------
   7. Table of Contents Card
   -------------------------------------------------------------------------- */
.toc-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 24px 28px;
  box-shadow: var(--shadow-card);
  margin-bottom: 32px;
}

.toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.toc-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.toc-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand-primary);
  background-color: var(--brand-subtle);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.toc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px 16px;
  list-style: none;
}

.toc-link {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9125rem;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.toc-link:hover {
  color: var(--brand-primary);
  background-color: var(--brand-subtle);
}

.toc-num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* --------------------------------------------------------------------------
   8. Policy Content Sections (Cards)
   -------------------------------------------------------------------------- */
.policy-sections-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.policy-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 32px 36px;
  box-shadow: var(--shadow-card);
  scroll-margin-top: calc(var(--header-height) + 24px);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.policy-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.card-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background-color: var(--brand-subtle);
  color: var(--brand-primary);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9375rem;
  border: 1px solid var(--brand-border);
}

.card-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

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

.card-body p {
  margin-bottom: 16px;
}

.card-body p:last-child {
  margin-bottom: 0;
}

.card-body ul,
.card-body ol {
  margin: 12px 0 18px 24px;
}

.card-body li {
  margin-bottom: 8px;
  line-height: 1.65;
}

.card-body li:last-child {
  margin-bottom: 0;
}

.card-body strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Callout Box inside cards */
.info-callout {
  background-color: var(--bg-subtle);
  border-left: 4px solid var(--brand-primary);
  padding: 16px 20px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 18px 0;
  font-size: 0.9375rem;
}

.info-callout.callout-success {
  background-color: var(--accent-success-bg);
  border-left-color: var(--accent-success);
}

.info-callout.callout-warning {
  background-color: var(--accent-warning-bg);
  border-left-color: var(--accent-warning);
}

.callout-title {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Placeholder Styling for clarity and customizable feel */
.placeholder {
  background-color: #fef3c7;
  color: #92400e;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
  font-weight: 600;
  border: 1px dashed #f59e0b;
}

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

.contact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.contact-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.contact-icon {
  width: 20px;
  height: 20px;
  color: var(--brand-primary);
  flex-shrink: 0;
}

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

.copy-btn:hover {
  background-color: var(--brand-subtle);
  color: var(--brand-primary);
  border-color: var(--brand-border);
}

.copy-btn.copied {
  background-color: var(--accent-success-bg);
  color: var(--accent-success);
  border-color: var(--accent-success-border);
}

/* --------------------------------------------------------------------------
   9. Floating Back to Top Button
   -------------------------------------------------------------------------- */
.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  background-color: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all var(--transition-normal);
  z-index: 900;
}

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

.back-to-top:hover {
  background-color: var(--brand-primary);
  color: var(--text-inverse);
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-lg);
}

/* --------------------------------------------------------------------------
   10. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: auto;
  background-color: #ffffff;
  border-top: 1px solid var(--border-color);
  padding: 36px 24px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 18px;
  list-style: none;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--brand-primary);
}

/* --------------------------------------------------------------------------
   11. Focus Visible Styles (Accessibility)
   -------------------------------------------------------------------------- */
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--border-focus);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   12. Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  :root {
    --header-height: 62px;
  }

  .main-wrapper {
    padding: 24px 16px 60px 16px;
  }

  .policy-card {
    padding: 24px 20px;
    border-radius: var(--radius-lg);
  }

  .toc-card {
    padding: 20px 18px;
  }

  .toc-grid {
    grid-template-columns: 1fr;
  }

  .header-actions .btn-print-text {
    display: none;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* --------------------------------------------------------------------------
   13. Print-Friendly Stylesheet
   -------------------------------------------------------------------------- */
@media print {
  body {
    background-color: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt;
    line-height: 1.5;
  }

  .reading-progress-container,
  .site-header,
  .toc-card,
  .back-to-top,
  .copy-btn,
  .hero-tag-pulse,
  .skip-link {
    display: none !important;
  }

  .main-wrapper {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .policy-hero {
    margin-bottom: 20pt;
  }

  .policy-title {
    font-size: 20pt !important;
    color: #000000 !important;
  }

  .policy-card {
    box-shadow: none !important;
    border: 1px solid #cccccc !important;
    padding: 16pt !important;
    margin-bottom: 16pt !important;
    page-break-inside: avoid;
    border-radius: 0 !important;
  }

  .card-badge {
    background: #eeeeee !important;
    color: #000000 !important;
    border: 1px solid #999999 !important;
  }

  .card-title {
    color: #000000 !important;
    font-size: 14pt !important;
  }

  .info-callout,
  .privacy-highlight-banner {
    background: #f4f4f4 !important;
    border-left: 3pt solid #333333 !important;
    box-shadow: none !important;
  }

  .placeholder {
    background: none !important;
    border-bottom: 1px solid #000000;
    color: #000000 !important;
  }

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

  /* Expand URLs for external links in print */
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
  }

  .site-footer {
    border-top: 1pt solid #cccccc !important;
    padding: 12pt 0 !important;
  }
}
