/* Modern, responsive styling for Legal Policies (Privacy Policy & Terms) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  
  /* Light Theme */
  --bg-color: #f8fafc;
  --bg-gradient: radial-gradient(circle at 50% 0%, #e2e8f0 0%, #f8fafc 100%);
  --card-bg: rgba(255, 255, 255, 0.95);
  --card-border: #e2e8f0;
  --text-main: #0f172a;
  --text-sub: #64748b;
  --text-muted: #94a3b8;
  --primary: #2563eb;
  --primary-rgb: 37, 99, 235;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --header-bg: rgba(255, 255, 255, 0.85);
  --header-border: #e2e8f0;
  --section-border: #f1f5f9;
  --section-hover-border: #cbd5e1;
  --note-bg: #f8fafc;
  --note-border: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.07), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

[data-theme='dark'] {
  --bg-color: #0b0f19;
  --bg-gradient: radial-gradient(circle at 50% 0%, #1e293b 0%, #0b0f19 100%);
  --card-bg: rgba(17, 24, 39, 0.95);
  --card-border: #1f2937;
  --text-main: #f3f4f6;
  --text-sub: #9ca3af;
  --text-muted: #6b7280;
  --primary: #3b82f6;
  --primary-rgb: 59, 130, 246;
  --primary-hover: #60a5fa;
  --primary-light: rgba(59, 130, 246, 0.12);
  --header-bg: rgba(15, 23, 42, 0.85);
  --header-border: #1e293b;
  --section-border: #1e293b;
  --section-hover-border: #374151;
  --note-bg: #111827;
  --note-border: #1f2937;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body, html {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-main);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.policy-container {
  min-height: 100vh;
  background-color: var(--bg-color);
  color: var(--text-main);
  transition: background-color 0.3s ease, color 0.3s ease;
  display: flex;
  flex-direction: column;
}

/* Header */
.policy-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  color: var(--primary);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.back-button:hover {
  background: var(--primary-light);
  transform: translateX(-3px);
}

.header-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Theme & Action buttons */
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--card-bg);
  color: var(--text-main);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 0.5rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.icon-button:hover {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* Tabs */
.tabs-wrapper {
  display: flex;
  justify-content: center;
  padding: 1.5rem 1rem 0;
}

.tabs-bar {
  display: inline-flex;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 0.35rem;
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  gap: 0.35rem;
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 0.6rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-sub);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

/* Main Content Area */
.policy-main {
  flex: 1;
  padding: 2.5rem 1.25rem 5rem;
  display: flex;
  justify-content: center;
}

.policy-content-card {
  width: 100%;
  max-width: 960px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 3rem;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}

/* Title & Metadata Banner */
.policy-hero {
  border-bottom: 1px solid var(--section-border);
  padding-bottom: 2rem;
  margin-bottom: 2.5rem;
}

.policy-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--primary-light);
  color: var(--primary);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  margin-bottom: 1rem;
}

.policy-title {
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--primary);
  line-height: 1.2;
  margin-bottom: 1.25rem;
}

.policy-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--text-sub);
}

.meta-label {
  font-weight: 600;
  color: var(--text-muted);
}

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

/* Quick Jump / TOC */
.toc-container {
  background: var(--note-bg);
  border: 1px solid var(--note-border);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2.5rem;
}

.toc-title {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.toc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.toc-chip {
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-sub);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.toc-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

/* Sections */
.policy-section {
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--section-border);
  scroll-margin-top: 90px;
  transition: border-color 0.2s ease;
}

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

.policy-section-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.85rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.policy-section-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-main);
  opacity: 0.92;
}

.policy-section-body p {
  margin-bottom: 1rem;
}

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

.policy-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.policy-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  line-height: 1.6;
}

.policy-list li::before {
  content: '•';
  color: var(--primary);
  font-size: 1.4rem;
  line-height: 1;
  font-weight: bold;
}

/* Email CTA Button */
.email-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  border: 1.5px solid var(--primary);
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(var(--primary-rgb), 0.1);
}

.email-cta-btn:hover {
  background: var(--primary);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(var(--primary-rgb), 0.25);
}

/* Advisory / Note Callout */
.policy-note-box {
  margin-top: 3rem;
  padding: 1.5rem 1.75rem;
  border-radius: 16px;
  background: var(--note-bg);
  border: 1px solid var(--note-border);
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.policy-note-icon {
  color: var(--text-sub);
  font-size: 1.25rem;
  line-height: 1;
}

.policy-note-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-sub);
}

/* Footer */
.policy-footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  border-top: 1px solid var(--header-border);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .policy-header {
    padding: 0 1.25rem;
    height: 64px;
  }

  .header-title {
    font-size: 1.1rem;
  }

  .policy-content-card {
    padding: 1.75rem 1.25rem;
    border-radius: 18px;
  }

  .policy-title {
    font-size: 1.9rem;
  }

  .policy-section-title {
    font-size: 1.2rem;
  }

  .policy-section-body {
    font-size: 0.98rem;
  }

  .tabs-bar {
    width: 100%;
    max-width: 360px;
  }

  .tab-btn {
    flex: 1;
    text-align: center;
    padding: 0.55rem 0.75rem;
    font-size: 0.88rem;
  }
}

/* Print Styles */
@media print {
  body, html {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .policy-header,
  .tabs-wrapper,
  .toc-container,
  .header-actions,
  .policy-footer {
    display: none !important;
  }

  .policy-main {
    padding: 0 !important;
  }

  .policy-content-card {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 100% !important;
  }

  .policy-title,
  .policy-section-title {
    color: #000000 !important;
  }
}
