/* CSS untuk fitur aksesibilitas Ruang Lestari */

/* High Contrast Mode */
.high-contrast {
  background-color: #000000 !important;
  color: #ffffff !important;
}

.high-contrast * {
  background-color: #000000 !important;
  color: #ffffff !important;
  border-color: #ffffff !important;
}

.high-contrast aside {
  background-color: #000000 !important;
  border-color: #ffffff !important;
}

.high-contrast .text-white {
  color: #ffffff !important;
}

.high-contrast .bg-white {
  background-color: #000000 !important;
  color: #ffffff !important;
}

.high-contrast .text-gray-700 {
  color: #ffffff !important;
}

.high-contrast .text-gray-500 {
  color: #cccccc !important;
}

.high-contrast .text-gray-800 {
  color: #ffffff !important;
}

.high-contrast .bg-gray-200 {
  background-color: #333333 !important;
  border-color: #ffffff !important;
}

.high-contrast .bg-gray-300 {
  background-color: #666666 !important;
}

.high-contrast .bg-gray-500 {
  background-color: #ffffff !important;
  color: #000000 !important;
}

.high-contrast .bg-blue-500 {
  background-color: #ffffff !important;
  color: #000000 !important;
}

.high-contrast .hover\:bg-gray-600:hover {
  background-color: #cccccc !important;
  color: #000000 !important;
}

.high-contrast .hover\:bg-blue-600:hover {
  background-color: #cccccc !important;
  color: #000000 !important;
}

.high-contrast .hover\:bg-\[\#3E5879\]:hover {
  background-color: #ffffff !important;
  color: #000000 !important;
}

/* Accessibility Menu Styling */
#accessibilityMenu {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

#accessibilityMenu:not(.hidden) {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -60%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Desktop animation */
@media (min-width: 769px) {
  #accessibilityMenu:not(.hidden) {
    animation: slideInDesktop 0.3s ease-out;
  }
}

@keyframes slideInDesktop {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Font Size Control - PERBAIKAN UTAMA */
/* Pastikan semua elemen dapat diubah ukuran fontnya */
body {
  transition: font-size 0.3s ease !important;
}

body * {
  transition: font-size 0.3s ease !important;
}

/* CSS untuk ukuran font yang spesifik */
body[style*="font-size: 80%"] {
  font-size: 80% !important;
}

body[style*="font-size: 90%"] {
  font-size: 90% !important;
}

body[style*="font-size: 100%"] {
  font-size: 100% !important;
}

body[style*="font-size: 110%"] {
  font-size: 110% !important;
}

body[style*="font-size: 120%"] {
  font-size: 120% !important;
}

body[style*="font-size: 130%"] {
  font-size: 130% !important;
}

body[style*="font-size: 140%"] {
  font-size: 140% !important;
}

body[style*="font-size: 150%"] {
  font-size: 150% !important;
}

body[style*="font-size: 160%"] {
  font-size: 160% !important;
}

body[style*="font-size: 170%"] {
  font-size: 170% !important;
}

body[style*="font-size: 180%"] {
  font-size: 180% !important;
}

body[style*="font-size: 190%"] {
  font-size: 190% !important;
}

body[style*="font-size: 200%"] {
  font-size: 200% !important;
}

/* Override CSS yang mungkin konflik dengan ukuran font */
body[style*="font-size"] * {
  font-size: inherit !important;
}

/* Pastikan elemen spesifik dapat diubah ukuran fontnya */
body[style*="font-size"] h1,
body[style*="font-size"] h2,
body[style*="font-size"] h3,
body[style*="font-size"] h4,
body[style*="font-size"] h5,
body[style*="font-size"] h6,
body[style*="font-size"] p,
body[style*="font-size"] span,
body[style*="font-size"] div,
body[style*="font-size"] button,
body[style*="font-size"] a,
body[style*="font-size"] input,
body[style*="font-size"] textarea,
body[style*="font-size"] label {
  font-size: inherit !important;
}

/* Skip link styling */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #000;
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 10000;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Notification styling */
.accessibility-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  padding: 12px 20px;
  border-radius: 8px;
  color: white;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.accessibility-notification.show {
  transform: translateX(0);
}

/* Responsive design untuk menu aksesibilitas */
@media (max-width: 768px) {
  #accessibilityMenu {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    bottom: auto !important;
    right: auto !important;
    width: 90vw !important;
    max-width: 350px !important;
  }
}

/* Focus indicators */
button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #3b82f6 !important;
  outline-offset: 2px !important;
}

/* High contrast focus indicators */
.high-contrast button:focus,
.high-contrast a:focus,
.high-contrast input:focus,
.high-contrast select:focus,
.high-contrast textarea:focus {
  outline: 2px solid #ffffff !important;
  outline-offset: 2px !important;
}

/* Animation untuk tombol toggle */
#textReaderToggle,
#contrastToggle {
  transition: transform 0.3s ease;
}

#textReaderToggle.translate-x-6,
#contrastToggle.translate-x-6 {
  transform: translateX(24px);
}

/* Hover effects untuk tombol aksesibilitas */
#accessibilityMenu button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Loading state untuk tombol */
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Accessibility menu backdrop */
#accessibilityMenu::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.1);
  z-index: -1;
}

/* Custom scrollbar untuk aksesibilitas */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 6px;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* High contrast scrollbar */
.high-contrast ::-webkit-scrollbar-track {
  background: #333333 !important;
}

.high-contrast ::-webkit-scrollbar-thumb {
  background: #ffffff !important;
}

.high-contrast ::-webkit-scrollbar-thumb:hover {
  background: #cccccc !important;
}