/* ==========================================================================
   Syncrozon Legal Pages Stylesheet (Privacy Policy & Terms of Use)
   Primary Color Theme: #0B0245
   ========================================================================== */

/* Header / Hero Banner for Legal Pages */
.legal-hero {
  position: relative;
  padding: 8rem 0 4rem 0;
  background: radial-gradient(circle at 50% 20%, rgba(11, 2, 69, 0.4) 0%, rgba(7, 13, 25, 0.95) 70%);
  border-bottom: 1px solid rgba(11, 2, 69, 0.3);
  overflow: hidden;
}

[data-theme="light"] .legal-hero {
  background: linear-gradient(180deg, #f0f4fa 0%, #ffffff 100%);
  border-bottom: 1px solid rgba(11, 2, 69, 0.12);
}

.legal-hero-content {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 2;
}

.legal-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: rgba(11, 2, 69, 0.6);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #a5b4fc;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  backdrop-filter: blur(8px);
}

[data-theme="light"] .legal-badge {
  background: #0B0245;
  color: #ffffff;
  border: none;
}

.legal-title {
  font-size: 3rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.legal-title span {
  color: #6366f1;
}

[data-theme="light"] .legal-title span {
  color: #0B0245;
}

.legal-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  flex-wrap: wrap;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 1rem;
}

.legal-meta-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.legal-meta-item svg {
  color: #6366f1;
}

[data-theme="light"] .legal-meta-item svg {
  color: #0B0245;
}

/* Page Layout (TOC + Main Legal Content) */
.legal-layout {
  padding: 3.5rem 0 6rem 0;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3.5rem;
  align-items: start;
}

@media (max-width: 1024px) {
  .legal-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* Sidebar Table of Contents */
.legal-sidebar {
  position: sticky;
  top: 6rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  backdrop-filter: var(--backdrop-blur);
  box-shadow: var(--shadow-md);
}

[data-theme="light"] .legal-sidebar {
  background: #ffffff;
  border-color: rgba(11, 2, 69, 0.15);
  box-shadow: 0 4px 20px rgba(11, 2, 69, 0.06);
}

.legal-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.legal-sidebar-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legal-sidebar-title svg {
  color: #0B0245;
}

/* Section Filter Input */
.legal-search-box {
  margin-bottom: 1rem;
  position: relative;
}

.legal-search-input {
  width: 100%;
  padding: 0.6rem 0.8rem 0.6rem 2.2rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition-fast);
}

.legal-search-input:focus {
  border-color: #0B0245;
  box-shadow: 0 0 0 3px rgba(11, 2, 69, 0.15);
}

.legal-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* TOC Navigation List */
.toc-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: calc(100vh - 260px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.toc-item {
  margin-bottom: 0.35rem;
}

.toc-link {
  display: block;
  padding: 0.5rem 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
  transition: var(--transition-fast);
  line-height: 1.3;
}

.toc-link:hover {
  color: var(--text-primary);
  background: rgba(11, 2, 69, 0.1);
}

.toc-link.active {
  color: #ffffff;
  background: #0B0245;
  border-left-color: #6366f1;
  font-weight: 600;
}

[data-theme="light"] .toc-link.active {
  color: #ffffff;
  background: #0B0245;
  border-left-color: #38bdf8;
}

.legal-actions {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.legal-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

/* Main Content Styling */
.legal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 3rem;
  backdrop-filter: var(--backdrop-blur);
  box-shadow: var(--shadow-md);
  line-height: 1.75;
}

[data-theme="light"] .legal-content {
  background: #ffffff;
  border-color: rgba(11, 2, 69, 0.12);
  box-shadow: 0 4px 24px rgba(11, 2, 69, 0.05);
}

@media (max-width: 768px) {
  .legal-content {
    padding: 1.75rem;
  }
}

.legal-section {
  margin-bottom: 3.5rem;
  scroll-margin-top: 6.5rem;
}

.legal-section:last-child {
  margin-bottom: 0;
}

.section-number {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6366f1;
  margin-bottom: 0.35rem;
}

[data-theme="light"] .section-number {
  color: #0B0245;
}

.section-heading {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid rgba(11, 2, 69, 0.25);
  padding-bottom: 0.6rem;
}

[data-theme="light"] .section-heading {
  border-bottom-color: rgba(11, 2, 69, 0.12);
}

.section-heading a.anchor-link {
  color: var(--text-muted);
  opacity: 0;
  text-decoration: none;
  font-size: 1.1rem;
  transition: opacity 0.2s ease;
}

.section-heading:hover a.anchor-link {
  opacity: 1;
}

.legal-content p {
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  font-size: 1.02rem;
}

.legal-content p strong {
  color: var(--text-primary);
  font-weight: 600;
}

.legal-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 1.75rem 0 0.85rem 0;
}

.legal-content ul, .legal-content ol {
  margin: 1rem 0 1.5rem 1.5rem;
  color: var(--text-secondary);
}

.legal-content li {
  margin-bottom: 0.6rem;
  font-size: 1rem;
}

.legal-content li strong {
  color: var(--text-primary);
}

/* Highlight / Alert Callout Boxes */
.legal-callout {
  position: relative;
  background: rgba(11, 2, 69, 0.25);
  border-left: 4px solid #0B0245;
  border-top: 1px solid rgba(11, 2, 69, 0.4);
  border-right: 1px solid rgba(11, 2, 69, 0.4);
  border-bottom: 1px solid rgba(11, 2, 69, 0.4);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

[data-theme="light"] .legal-callout {
  background: rgba(11, 2, 69, 0.04);
  border-left: 4px solid #0B0245;
  border-top: 1px solid rgba(11, 2, 69, 0.1);
  border-right: 1px solid rgba(11, 2, 69, 0.1);
  border-bottom: 1px solid rgba(11, 2, 69, 0.1);
}

.legal-callout-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #0B0245;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.1rem;
}

.legal-callout-content {
  flex: 1;
}

.legal-callout-title {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

.legal-callout-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 0 !important;
}

/* Compliance Badges Matrix Table */
.legal-table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.legal-table th {
  background: #0B0245;
  color: #ffffff;
  padding: 0.85rem 1.25rem;
  font-weight: 600;
}

.legal-table td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.legal-table tr:last-child td {
  border-bottom: none;
}

.legal-table tr:nth-child(even) {
  background: rgba(11, 2, 69, 0.08);
}

[data-theme="light"] .legal-table tr:nth-child(even) {
  background: rgba(11, 2, 69, 0.03);
}

/* Contact Details Card */
.legal-contact-card {
  background: linear-gradient(135deg, rgba(11, 2, 69, 0.5) 0%, rgba(15, 28, 54, 0.7) 100%);
  border: 1px solid #0B0245;
  border-radius: var(--radius-md);
  padding: 2rem;
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

[data-theme="light"] .legal-contact-card {
  background: linear-gradient(135deg, #f0f4fa 0%, #ffffff 100%);
  border-color: rgba(11, 2, 69, 0.2);
}

.contact-item-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #6366f1;
  margin-bottom: 0.4rem;
}

[data-theme="light"] .contact-item-title {
  color: #0B0245;
}

.contact-item-value {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Back to Top Floating Button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #0B0245;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-normal);
  z-index: 99;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-4px);
  background: #190978;
}

/* Print Styles */
@media print {
  .navbar-wrapper,
  .footer,
  .legal-sidebar,
  .back-to-top,
  .legal-search-box,
  .legal-actions {
    display: none !important;
  }

  .legal-hero {
    padding: 2rem 0;
    background: none !important;
    border-bottom: 2px solid #000 !important;
  }

  .legal-title {
    color: #000 !important;
    font-size: 2rem !important;
  }

  .legal-layout {
    display: block !important;
    padding: 1rem 0 !important;
  }

  .legal-content {
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
  }

  .legal-content p, .legal-content li, .legal-content td {
    color: #111 !important;
  }

  .legal-section {
    page-break-inside: avoid;
  }
}
