/* =============================================
   PRIVACY POLICY PAGE — UI/UX ENHANCEMENTS
   Kebijakan Privasi DISDUKCAPIL Kota Salatiga
   ============================================= */

/* ===== 1. Cookie Consent Banner ===== */
.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #F1F5F9;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  z-index: 10000;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.25);
  transform: translateY(100%);
  animation: cookieSlideUp 0.5s ease 0.8s forwards;
}
@keyframes cookieSlideUp {
  to { transform: translateY(0); }
}
.cookie-consent.cookie-hidden {
  animation: cookieSlideDown 0.4s ease forwards;
}
@keyframes cookieSlideDown {
  to { transform: translateY(100%); }
}
.cookie-consent-text {
  font-size: 0.9rem;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.cookie-consent-actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}
.btn-cookie {
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
}
.btn-cookie-accept {
  background: #22C55E;
  color: white;
}
.btn-cookie-accept:hover {
  background: #16A34A;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}
.btn-cookie-learn {
  background: transparent;
  color: #93C5FD;
  border: 1px solid rgba(147, 197, 253, 0.4);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.btn-cookie-learn:hover {
  background: rgba(147, 197, 253, 0.1);
  color: #BFDBFE;
}

/* ===== 2. Search in Document ===== */
.search-box {
  margin-bottom: 1rem;
  position: relative;
}
.search-input {
  width: 100%;
  padding: 0.55rem 2rem 0.55rem 2.25rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--text-dark);
  background: var(--bg-body);
  transition: all 0.2s ease;
  outline: none;
}
.search-input::placeholder {
  color: var(--text-muted);
}
.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 85, 164, 0.1);
}
.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.8rem;
  pointer-events: none;
}
.search-clear {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  display: none;
  padding: 0.25rem;
  line-height: 1;
}
.search-clear.visible {
  display: block;
}
.toc-link.dimmed {
  opacity: 0.25;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.card-section.search-highlight {
  animation: pulseHighlight 1.2s ease;
}
@keyframes pulseHighlight {
  0%, 100% { box-shadow: var(--shadow-sm); }
  50% { box-shadow: 0 0 0 4px rgba(0, 85, 164, 0.2), var(--shadow-md); }
}

/* ===== 3. Data Flow Infographic ===== */
.data-flow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  margin: 1.5rem 0 0.5rem;
  overflow-x: auto;
  padding: 1rem 0.5rem;
}
.flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  min-width: 85px;
}
.flow-step.visible {
  opacity: 1;
  transform: translateY(0);
}
.flow-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: white;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  transition: transform 0.3s ease;
}
.flow-step:hover .flow-icon {
  transform: scale(1.1);
}
.flow-icon-1 { background: linear-gradient(135deg, #3B82F6, #2563EB); }
.flow-icon-2 { background: linear-gradient(135deg, #8B5CF6, #6D28D9); }
.flow-icon-3 { background: linear-gradient(135deg, #0EA5E9, #0284C7); }
.flow-icon-4 { background: linear-gradient(135deg, #10B981, #059669); }
.flow-icon-5 { background: linear-gradient(135deg, #F59E0B, #D97706); }
.flow-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dark);
  text-align: center;
  max-width: 85px;
  line-height: 1.3;
}
.flow-arrow {
  color: #94A3B8;
  font-size: 1.1rem;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
  margin: 0 0.15rem;
}
.flow-arrow.visible {
  opacity: 1;
}
@media (max-width: 600px) {
  .data-flow {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding: 0.5rem 0;
  }
  .flow-step {
    flex-direction: row;
    min-width: unset;
    gap: 0.75rem;
  }
  .flow-icon {
    width: 42px;
    height: 42px;
    font-size: 1.1rem;
  }
  .flow-label {
    text-align: left;
    max-width: unset;
    font-size: 0.85rem;
  }
  .flow-arrow {
    transform: rotate(90deg);
    align-self: center;
    margin: 0;
  }
}

/* ===== 4. Accordion Mobile ===== */
@media (max-width: 768px) {
  .card-section[data-accordion] .section-header {
    cursor: pointer;
    margin-bottom: 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    user-select: none;
    position: relative;
    padding-right: 2rem;
  }
  .card-section[data-accordion] .section-header::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
  }
  .card-section[data-accordion].accordion-open .section-header {
    margin-bottom: 1.25rem;
  }
  .card-section[data-accordion].accordion-open .section-header::after {
    transform: translateY(-50%) rotate(180deg);
  }
  .card-section[data-accordion] .accordion-content {
    display: grid;
    grid-template-rows: 0fr;
    overflow: hidden;
    opacity: 0;
    transition: grid-template-rows 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease-out;
  }
  .card-section[data-accordion] .accordion-content-inner {
    min-height: 0;
  }
  .card-section[data-accordion].accordion-open .accordion-content {
    grid-template-rows: 1fr;
    opacity: 1;
  }
}

/* ===== Focus States & Highlighting ===== */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--accent) !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.35) !important;
}

mark.search-mark {
  background-color: #FDE047 !important;
  color: #0F172A !important;
  border-radius: 4px;
  padding: 0 0.2rem;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
body.dark-mode mark.search-mark {
  background-color: #EAB308 !important;
  color: #000000 !important;
}


/* ===== 5. Reading Time Badge ===== */
.reading-time-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.92rem;
  color: #F8FAFC !important;
}
.reading-time-badge i {
  color: #F59E0B;
}

/* ===== 6. Version History ===== */
.version-item {
  padding: 0.6rem 0;
  border-bottom: 1px dashed var(--border-color);
  font-size: 0.82rem;
}
.version-item:last-child {
  border-bottom: none;
}
.version-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 700;
  color: var(--primary);
  font-size: 0.8rem;
}
.version-date {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-left: 0.5rem;
}
.version-desc {
  color: var(--text-dark);
  font-size: 0.8rem;
  margin-top: 0.15rem;
  line-height: 1.4;
}

/* ===== 7. Print Watermark & Header/Footer ===== */
.print-header, .print-footer {
  display: none;
}
@media print {
  body::after {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 350px;
    height: 350px;
    background-image: url('../images/logo-salatiga.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.04;
    z-index: -1;
    pointer-events: none;
  }
  .print-header {
    display: block !important;
    text-align: center;
    border-bottom: 3px double #000;
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
  }
  .print-footer {
    display: block !important;
    text-align: center;
    font-size: 0.75rem;
    color: #666;
    border-top: 1px solid #ccc;
    padding-top: 0.5rem;
    margin-top: 2rem;
    page-break-inside: avoid;
  }
  .cookie-consent {
    display: none !important;
  }
  .quiz-card {
    break-inside: avoid;
  }
  .data-flow .flow-step {
    opacity: 1 !important;
    transform: none !important;
  }
  .data-flow .flow-arrow {
    opacity: 1 !important;
  }
}

/* ===== 8. Quiz Section ===== */
.quiz-card {
  background: linear-gradient(135deg, #EFF6FF 0%, #F0F9FF 100%) !important;
  border: 1.5px solid #BFDBFE !important;
}
.quiz-question {
  margin-bottom: 1rem;
  padding: 1.15rem;
  background: white;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}
.quiz-q-text {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  color: var(--text-dark);
  line-height: 1.5;
}
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.quiz-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.88rem;
  border: 1.5px solid var(--border-color);
  background: white;
  transition: all 0.2s ease;
  color: var(--text-dark);
  line-height: 1.4;
}
.quiz-option i {
  flex-shrink: 0;
  font-size: 0.9rem;
}
.quiz-option:hover:not(.q-disabled) {
  border-color: var(--primary);
  background: var(--primary-light);
}
.quiz-option.q-correct {
  border-color: #22C55E !important;
  background: #F0FDF4 !important;
  color: #166534;
  font-weight: 600;
}
.quiz-option.q-wrong {
  border-color: #EF4444 !important;
  background: #FEF2F2 !important;
  color: #991B1B;
  text-decoration: line-through;
  opacity: 0.55;
}
.quiz-option.q-disabled {
  pointer-events: none;
}
.quiz-result {
  text-align: center;
  padding: 1.5rem;
  display: none;
}
.quiz-result.show {
  display: block;
  animation: fadeIn 0.5s ease;
}
.quiz-score {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.15rem;
}
.quiz-confetti {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}

/* ===== 9. Dark Mode ===== */
body.dark-mode {
  --bg-body: #0F172A;
  --bg-card: #1E293B;
  --text-dark: #E2E8F0;
  --text-muted: #94A3B8;
  --border-color: #334155;
  --primary-light: rgba(59, 130, 246, 0.12);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 8px rgba(0,0,0,0.35);
  background-color: #0F172A;
  color: #E2E8F0;
}
body.dark-mode .header-banner {
  background: linear-gradient(135deg, #020617 0%, #0F172A 60%, #1E293B 100%) !important;
}
body.dark-mode .card-section p,
body.dark-mode .card-section ul,
body.dark-mode .card-section ol,
body.dark-mode .card-section li,
body.dark-mode .card-section span {
  color: #CBD5E1 !important;
}
body.dark-mode .section-title {
  color: #F1F5F9 !important;
}
body.dark-mode .section-header {
  border-bottom-color: #334155;
}
body.dark-mode .section-icon {
  background: rgba(59, 130, 246, 0.15);
}
body.dark-mode .callout {
  background: rgba(59, 130, 246, 0.08);
  border-left-color: #3B82F6;
}
body.dark-mode .callout-title {
  color: #60A5FA !important;
}
body.dark-mode .callout-warning {
  background: rgba(245, 158, 11, 0.08);
  border-left-color: #F59E0B;
}
body.dark-mode .callout-warning .callout-title {
  color: #FBBF24 !important;
}
body.dark-mode .data-card {
  background: #1E293B;
  border-color: #334155;
}
body.dark-mode .data-card-title {
  color: #E2E8F0;
}
body.dark-mode .data-card p {
  color: #94A3B8 !important;
}
body.dark-mode .legal-card {
  background: #1E293B;
  border-color: #334155;
}
body.dark-mode .legal-card-text {
  color: #CBD5E1;
}
body.dark-mode .contact-box {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.06) 0%, rgba(16, 185, 129, 0.03) 100%);
  border-color: #334155;
}
body.dark-mode .contact-info span,
body.dark-mode .contact-info a {
  color: #E2E8F0 !important;
}
body.dark-mode .contact-info strong {
  color: #93C5FD !important;
}
body.dark-mode .btn-action {
  background: #1E293B;
  color: #E2E8F0;
  border-color: #334155;
}
body.dark-mode .btn-action:hover {
  background: #334155;
  border-color: #60A5FA;
  color: #60A5FA;
}
body.dark-mode .btn-feedback {
  background: #1E293B;
  color: #CBD5E1;
  border-color: #475569;
}
body.dark-mode .btn-feedback-yes:hover {
  background: rgba(34, 197, 94, 0.1) !important;
  border-color: #22C55E !important;
  color: #86EFAC !important;
}
body.dark-mode .btn-feedback-no:hover {
  background: rgba(239, 68, 68, 0.1) !important;
  border-color: #EF4444 !important;
  color: #FCA5A5 !important;
}
body.dark-mode .search-input {
  background: #0F172A;
  color: #E2E8F0;
  border-color: #334155;
}
body.dark-mode .search-input:focus {
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
}
body.dark-mode .flow-label {
  color: #CBD5E1;
}
body.dark-mode .badge-item {
  border-color: #475569;
}
body.dark-mode .badge-blue { background: rgba(30, 64, 175, 0.2); color: #93C5FD; border-color: #3B82F6; }
body.dark-mode .badge-green { background: rgba(22, 101, 52, 0.2); color: #86EFAC; border-color: #22C55E; }
body.dark-mode .badge-amber { background: rgba(146, 64, 14, 0.2); color: #FCD34D; border-color: #F59E0B; }
body.dark-mode .highlight-bullet-item { color: #CBD5E1; }
body.dark-mode .highlights-title { color: #93C5FD !important; border-bottom-color: #334155; }
body.dark-mode .highlights-card { background: #1E293B; border-color: #334155; }
body.dark-mode code {
  background: #334155;
  color: #93C5FD;
}
body.dark-mode .sidebar-title {
  color: #60A5FA;
  border-bottom-color: rgba(96, 165, 250, 0.2);
}
body.dark-mode .toc-link {
  color: #94A3B8;
}
body.dark-mode .toc-link:hover,
body.dark-mode .toc-link.active {
  background: rgba(59, 130, 246, 0.12);
  color: #60A5FA;
}
body.dark-mode .version-tag { color: #60A5FA; }
body.dark-mode .version-desc { color: #CBD5E1; }
/* Dark mode quiz */
body.dark-mode .quiz-card {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.06) 0%, rgba(14, 165, 233, 0.04) 100%) !important;
  border-color: #334155 !important;
}
body.dark-mode .quiz-question {
  background: #1E293B;
  border-color: #334155;
}
body.dark-mode .quiz-q-text {
  color: #E2E8F0;
}
body.dark-mode .quiz-option {
  background: #0F172A;
  border-color: #475569;
  color: #CBD5E1;
}
body.dark-mode .quiz-option:hover:not(.q-disabled) {
  background: rgba(59, 130, 246, 0.1);
  border-color: #3B82F6;
}
body.dark-mode .quiz-option.q-correct {
  background: rgba(34, 197, 94, 0.1) !important;
  border-color: #22C55E !important;
  color: #86EFAC;
}
body.dark-mode .quiz-option.q-wrong {
  background: rgba(239, 68, 68, 0.1) !important;
  border-color: #EF4444 !important;
  color: #FCA5A5;
}
/* Dark mode high contrast override */
body.high-contrast.dark-mode {
  background: #000 !important;
}

/* ===== 10. WhatsApp Share Button ===== */
.btn-wa-share i {
  color: #25D366;
  transition: transform 0.2s ease;
}
.btn-wa-share:hover i {
  transform: scale(1.15);
}

/* ===== 11. Modernized Lists for Sections ===== */
.card-section ul.privacy-bullet-list,
.card-section ol.privacy-num-list {
  margin-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.card-section ul.privacy-bullet-list li,
.card-section ol.privacy-num-list li {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  margin-bottom: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.card-section ul.privacy-bullet-list li:hover,
.card-section ol.privacy-num-list li:hover {
  border-color: #CBD5E1;
  background: #F1F5F9;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* Bullet item icon marker */
.privacy-list-marker {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  font-weight: 700;
  margin-top: 0.15rem;
}

/* For custom text alignment inside li items */
.privacy-list-content {
  flex-grow: 1;
  font-size: 0.95rem;
  color: var(--text-dark);
  line-height: 1.6;
}

/* Dark mode support */
body.dark-mode .card-section ul.privacy-bullet-list li,
body.dark-mode .card-section ol.privacy-num-list li {
  background: #1E293B;
  border-color: #334155;
}

body.dark-mode .card-section ul.privacy-bullet-list li:hover,
body.dark-mode .card-section ol.privacy-num-list li:hover {
  background: #273549;
  border-color: #475569;
}

body.dark-mode .privacy-list-marker {
  background: rgba(59, 130, 246, 0.2);
  color: #60A5FA;
}

body.dark-mode .privacy-list-content {
  color: #CBD5E1;
}

/* High contrast support */
body.high-contrast .card-section ul.privacy-bullet-list li,
body.high-contrast .card-section ol.privacy-num-list li {
  background: #000 !important;
  border-color: #fff !important;
}
body.high-contrast .privacy-list-marker {
  background: #000 !important;
  color: #fff !important;
  border: 1px solid #fff;
}
body.high-contrast .privacy-list-content {
  color: #fff !important;
}

