/**
 * Privacy Policy Page Styles
 * A dedicated stylesheet for the privacy policy page
 */

/* Base Typography */
.privacy-policy h2 {
  font-size: 1.875rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  margin-top: 2.5rem;
  color: var(--text-primary);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.privacy-policy h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  margin-top: 2rem;
  color: var(--text-primary);
}

.privacy-policy p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.privacy-policy ul, 
.privacy-policy ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

.privacy-policy ul {
  list-style-type: disc;
}

.privacy-policy ul li, 
.privacy-policy ol li {
  margin-bottom: 0.75rem;
  position: relative;
}

.privacy-policy ol {
  list-style-type: decimal;
}

.privacy-policy a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.2s;
}

.privacy-policy a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Section Containers */
.section-container {
  background-color: var(--bg-card);
  border-radius: 1rem;
  border: 1px solid var(--border-light);
  padding: 2rem;
  margin-bottom: 3rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.section-container:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.section-container:target {
  animation: highlight 1.5s ease-out;
}

@keyframes highlight {
  0% {
    box-shadow: 0 0 0 0.5rem rgba(79, 70, 229, 0.2);
  }
  100% {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  }
}

/* ToC Sidebar */
.toc-nav {
  padding: 0.5rem;
}

.toc-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  margin-bottom: 0.25rem;
  border-radius: 0.5rem;
  position: relative;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

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

.toc-link.active {
  background-color: var(--primary-bg);
  color: var(--primary);
  font-weight: 500;
}

.toc-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0.25rem;
  background-color: var(--primary);
  border-radius: 0 0.25rem 0.25rem 0;
}

[dir="rtl"] .toc-link.active::before {
    right: 0;
  border-radius: 0.25rem 0 0 0.25rem;
}

.toc-link span {
  line-height: 1.2;
}

/* Make ToC sticky with proper spacing */
.toc-container {
  position: sticky;
  top: 5rem;
  max-height: calc(100vh - 8rem);
  overflow-y: auto;
  padding-right: 0.5rem;
  scrollbar-width: thin;
}

.toc-container::-webkit-scrollbar {
  width: 0.25rem;
}

.toc-container::-webkit-scrollbar-thumb {
  background-color: var(--border);
  border-radius: 0.5rem;
}

.on-this-page-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light);
}

/* Accordion Components */
.policy-card {
  margin-bottom: 1rem;
  border-radius: 0.75rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  overflow: hidden;
  transition: all 0.3s ease;
}

.policy-card:hover {
  border-color: var(--border);
}

.policy-card-header {
  padding: 1.25rem;
  background-color: var(--bg-card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid transparent;
}

.policy-card-header h3 {
  margin: 0;
  font-size: 1.125rem;
}

.policy-card-header i {
  transition: transform 0.3s ease;
}

.policy-card-content {
  padding: 1.25rem;
  border-top: 1px solid var(--border-light);
}

/* Toggle Switch Styling */
.checkbox-toggle {
  position: relative;
  cursor: pointer;
  width: 3rem;
  height: 1.5rem;
  background-color: var(--toggle-bg);
  border-radius: 9999px;
  transition: background-color 0.2s ease;
}

.checkbox-toggle.active {
  background-color: var(--primary);
}

.checkbox-toggle::after {
  content: '';
  position: absolute;
  top: 0.25rem;
  left: 0.25rem;
  width: 1rem;
  height: 1rem;
  border-radius: 9999px;
  background-color: white;
  transition: transform 0.2s ease;
}

.checkbox-toggle.active::after {
  transform: translateX(1.5rem);
}

/* Modal Components */
.modal-backdrop {
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.modal-container {
  border-radius: 1rem;
  max-width: 36rem;
  width: 90%;
  max-height: 90vh;
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  max-height: 60vh;
}

.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Visual Indicators - Numbering and Icons */
.section-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background-color: var(--primary-bg);
  color: var(--primary);
  font-weight: 700;
  margin-right: 0.75rem;
  flex-shrink: 0;
}

/* Table Styles */
.privacy-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 0.5rem;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.privacy-table th {
  background-color: var(--table-header-bg);
  color: var(--text-primary);
  font-weight: 600;
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.privacy-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
}

.privacy-table tr:nth-child(even) {
  background-color: var(--table-alt-row);
}

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

/* Responsive Adjustments */
@media (max-width: 1024px) {
  .toc-container {
    position: relative;
    top: 0;
    max-height: none;
    margin-bottom: 2rem;
  }
  
  .section-container {
    padding: 1.5rem;
  }
}

@media (max-width: 768px) {
  .privacy-policy h2 {
    font-size: 1.5rem;
  }
  
  .privacy-policy h3 {
    font-size: 1.125rem;
  }
  
  .section-container {
    padding: 1.25rem;
    margin-bottom: 1.5rem;
  }
  
  .policy-card-header,
  .policy-card-content {
    padding: 1rem;
  }
}

/* CSS Variables for Theme Support */
:root {
  --primary: rgb(37, 99, 235);
  --primary-dark: rgb(29, 78, 216);
  --primary-bg: rgba(37, 99, 235, 0.1);
  --text-primary: rgb(17, 24, 39);
  --text-secondary: rgb(75, 85, 99);
  --bg-card: rgb(255, 255, 255);
  --border: rgb(209, 213, 219);
  --border-light: rgb(229, 231, 235);
  --hover-bg: rgba(243, 244, 246, 0.8);
  --toggle-bg: rgb(209, 213, 219);
  --table-header-bg: rgb(243, 244, 246);
  --table-alt-row: rgb(249, 250, 251);
}

/* Dark mode variables */
.dark-theme {
  --primary: rgb(96, 165, 250);
  --primary-dark: rgb(147, 197, 253);
  --primary-bg: rgba(96, 165, 250, 0.2);
  --text-primary: rgb(243, 244, 246);
  --text-secondary: rgb(209, 213, 219);
  --bg-card: rgb(31, 41, 55);
  --border: rgb(75, 85, 99);
  --border-light: rgb(55, 65, 81);
  --hover-bg: rgba(55, 65, 81, 0.5);
  --toggle-bg: rgb(75, 85, 99);
  --table-header-bg: rgb(55, 65, 81);
  --table-alt-row: rgb(45, 55, 72);
}

/* Print styles */
@media print {
  .toc-container {
    display: none;
  }
  
  .privacy-policy {
    width: 100% !important;
  }
  
  .section-container {
    page-break-inside: avoid;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin-bottom: 1rem !important;
  }
  
  .policy-card {
    break-inside: avoid;
  }
  
  .policy-card-content {
    display: block !important;
  }
}
