/* ===========================================
   ACCESSIBILITY IMPROVEMENTS FOR PRIVACY POLICY
   =========================================== */

/* Skip to Content Link */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #2d3436;
  color: white;
  padding: 12px 16px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 1001;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.skip-to-content:focus {
  top: 6px;
  color: white;
  outline: 2px solid #fdcb6e;
  outline-offset: 2px;
}

/* Screen Reader Only Content */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Better Focus Styles */
*:focus {
  outline: 2px solid #fdcb6e;
  outline-offset: 2px;
}

.toc-link:focus {
  background: rgba(108, 92, 231, 0.2) !important;
  outline: 2px solid #fdcb6e;
  outline-offset: -2px;
}

button:focus,
.btn:focus {
  outline: 2px solid #fdcb6e;
  outline-offset: 2px;
  box-shadow: none;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  :root {
    --primary: #000080;
    --bg-card: rgba(255, 255, 255, 1);
    --dark: #000000;
  }
  
  .toc-card {
    background: rgba(0, 0, 0, 0.95) !important;
    border: 2px solid white !important;
  }
  
  .important-notice {
    background: #ffff99 !important;
    border: 2px solid #000000 !important;
    color: #000000 !important;
  }
  
  .section-card {
    background: rgba(255, 255, 255, 1) !important;
    border: 2px solid #000000 !important;
  }
}

/* High Contrast Mode (User Toggle) */
body.high-contrast {
  background: #000000 !important;
  color: #ffffff !important;
}

body.high-contrast .privacy-policy {
  background: #000000 !important;
  color: #ffffff !important;
  border: 2px solid #ffffff !important;
}

body.high-contrast .section-card {
  background: #000000 !important;
  border: 2px solid #ffffff !important;
  color: #ffffff !important;
}

body.high-contrast .section-card h2 {
  color: #ffffff !important;
}

body.high-contrast .section-card p,
body.high-contrast .section-card li {
  color: #ffffff !important;
}

body.high-contrast .toc-card {
  background: #000000 !important;
  border: 2px solid #ffffff !important;
}

body.high-contrast .toc-link {
  color: #ffffff !important;
  background: transparent !important;
}

body.high-contrast .toc-link:hover,
body.high-contrast .toc-link.active {
  background: #ffffff !important;
  color: #000000 !important;
}

body.high-contrast .important-notice {
  background: #ffff00 !important;
  border: 3px solid #000000 !important;
  color: #000000 !important;
}


body.high-contrast a {
  color: #ffff00 !important;
  text-decoration: underline !important;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .reading-progress .progress-bar {
    transition: none;
  }
  
  .animate-fade-in {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  
  .feature-highlight {
    animation: none !important;
  }
}





/* Improved Touch Targets for Mobile */
@media (max-width: 768px) {
  .toc-mobile-toggle {
    min-height: 48px;
    min-width: 48px;
    display: flex !important;
    align-items: center;
    justify-content: center;
  }
  
  .toc-link {
    min-height: 48px;
    display: flex;
    align-items: center;
  }
  
  .back-to-top {
    width: 56px !important;
    height: 56px !important;
    font-size: 1.5rem;
  }
}



/* Enhanced Loading State */
.policy-section.loading {
  opacity: 0.5;
  pointer-events: none;
}

.policy-section.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  border: 2px solid #6c5ce7;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  transform: translate(-50%, -50%);
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Copy Section Link Button */
.copy-section-link {
  background: transparent;
  border: none;
  color: #6c757d;
  cursor: pointer;
  font-size: 0.8rem;
  margin-left: 10px;
  padding: 4px 8px;
  transition: all 0.3s ease;
  vertical-align: middle;
}

.copy-section-link:hover {
  color: #6c5ce7;
  transform: scale(1.1);
}

.copy-section-link.copied {
  color: #007755;
}

/* Search Highlight */
.search-highlight {
  background: #fdcb6e;
  color: #2d3436;
  padding: 2px 4px;
  border-radius: 2px;
  font-weight: 500;
}



/* TOC Overlay for Mobile */
.toc-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.toc-overlay.show {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 991.98px) {
  .toc-card {
    position: fixed !important;
    top: 0 !important;
    left: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    z-index: 999;
    transition: left 0.3s ease;
    overflow-y: auto;
    border-radius: 0 16px 16px 0;
  }
  
  .toc-card.show {
    left: 0;
  }
}

/* Print Improvements */
@media print {
  .skip-to-content,
  .toc-mobile-toggle,
  .back-to-top,
  
  .policy-section {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  
  .section-card {
    border: 1px solid #000 !important;
    background: white !important;
    box-shadow: none !important;
  }
  
  .toc-card {
    background: white !important;
    border: 1px solid #000 !important;
    color: black !important;
  }
  
  .important-notice {
    background: #f9f9f9 !important;
    border: 2px solid #333 !important;
    color: black !important;
  }
}