/* Container หลัก - ติดขอบขวาของหน้าจอ */
.accessibility-toolbar {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/*  แต่ละปุ่ม */
.accessibility-btn {
  width: 50px;
  height: 50px;
  background: #ffffff;
  border: 2px solid #2c3e50;
  border-right: none;
  border-radius: 50% 0 0 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #2c3e50;
  font-size: 20px;
  margin-right: -5px;
}

.accessibility-btn:first-child {
  border-radius: 50% 0 0 0;
  margin-right: 0;
}

.accessibility-btn:last-child {
  border-radius: 0 0 0 50%;
}

.accessibility-btn:hover {
  background: #2c3e50;
  color: #ffffff;
  transform: translateX(-5px);
}

.accessibility-btn.active {
  background: #e74c3c;
  border-color: #e74c3c;
  color: #ffffff;
}

/* ปุ่มแบบ Dropdown (สไลด์ออกมา) */
.accessibility-dropdown {
  position: relative;
}

.accessibility-dropdown-content {
  position: absolute;
  right: 100%;
  left: auto;
  top: 0;
  background: #ffffff;
  border: 2px solid #2c3e50;
  border-radius: 10px 0 0 10px;
  padding: 10px;
  min-width: 150px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(20px);
  transition: all 0.3s ease;
  box-shadow: -2px 2px 10px rgba(0, 0, 0, 0.1);
}

.accessibility-dropdown:hover .accessibility-dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* ปุ่มขนาดตัวอักษร */
.font-size-controls {
  display: flex;
  gap: 5px;
}

.font-size-btn {
  width: 40px;
  height: 40px;
  background: #f8f9fa;
  border: 2px solid #2c3e50;
  border-radius: 50%;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
}

.font-size-btn:hover {
  background: #2c3e50;
  color: #ffffff;
}

/* ปุ่มเปลี่ยนภาษา */
.lang-options {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.lang-btn {
  padding: 8px 15px;
  background: #f8f9fa;
  border: 2px solid #2c3e50;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
  text-align: center;
}

.lang-btn:hover,
.lang-btn.active {
  background: #2c3e50;
  color: #ffffff;
}




/* โหมดสำหรับผู้พิการทางสายตา */


/* High Contrast Mode - โหมดความคมชัดสูง */
html.high-contrast {
  filter: contrast(1.5) !important;
}

html.high-contrast body,
html.high-contrast header,
html.high-contrast nav,
html.high-contrast .navbar,
html.high-contrast .bg-navmenu,
html.high-contrast .testimonial-2,
html.high-contrast .gray-bg,
html.high-contrast footer {
  filter: none !important;
}

html.high-contrast * {
  border-color: #000 !important;
}

/* Inverted Colors - สลับสี */
html.inverted-colors {
  filter: invert(1) hue-rotate(180deg) !important;
}

html.inverted-colors body,
html.inverted-colors header,
html.inverted-colors nav,
html.inverted-colors .navbar,
html.inverted-colors .bg-navmenu,
html.inverted-colors .testimonial-2,
html.inverted-colors .gray-bg,
html.inverted-colors footer {
  filter: none !important;
}

html.inverted-colors img,
html.inverted-colors video,
html.inverted-colors .carousel-item img {
  filter: invert(1) hue-rotate(180deg) !important;
}

/* Grayscale - ขาวดำ */
html.grayscale-mode {
  filter: grayscale(100%) !important;
}

html.grayscale-mode body,
html.grayscale-mode header,
html.grayscale-mode nav,
html.grayscale-mode .navbar,
html.grayscale-mode .bg-navmenu,
html.grayscale-mode .testimonial-2,
html.grayscale-mode .gray-bg,
html.grayscale-mode footer {
  filter: none !important;
}

/* Large Text - ตัวอักษรใหญ่ */
html.large-text {
  font-size: 120% !important;
}

html.large-text body,
html.large-text body * {
  font-size: inherit !important;
}

/* Extra Large Text */
html.xlarge-text {
  font-size: 140% !important;
}

html.xlarge-text body,
html.xlarge-text body * {
  font-size: inherit !important;
}


/* Font Size Scaling - ให้ทุกส่วนเปลี่ยนตาม */


/* Navbar menu items */
html #navbarmain .nav-link,
html .navbar-nav .nav-item a,
html .dropdown-item,
body .nav-link,
#navbarmain a {
  font-size: 1rem !important;
}

/* Service section titles */
html .testimonial-2 h5,
html .testimonial-2 .card-title,
html .gray-bg h5,
html .gray-bg .card-title {
  font-size: 1.25rem !important;
}

/* Card titles (news cards) */
html .card-title,
html .card-text,
html .card-footer,
html .card-body h5,
html .card-body p {
  font-size: 1rem !important;
}

/* Section headers */
html h5,
html h6 {
  font-size: 1.25rem !important;
}

/* General text */
html p,
html span,
html a:not(.nav-link):not(.navbar-brand),
html li,
html div {
  /* Allow inheritance but respect minimums or scaling if explicitly set elsewhere */
  /* converting explicit px to rem where possible in style.css would be best, but overriding here: */
}

/* Force inherit for most text when scaling is active is tricky. 
   Instead, relying on rem for the specific problematic areas. */

/* Specific fix for the user request about navbar */
.navbar-nav li a {
  font-size: 1rem !important;
}

/* Service section titles */
body .testimonial-2 h5,
body .testimonial-2 .card-title,
body .gray-bg h5,
body .gray-bg .card-title {
  font-size: 1em !important;
}

/* Card titles (news cards) */
body .card-title,
body .card-text,
body .card-footer,
body .card-body h5,
body .card-body p {
  font-size: 1em !important;
}

/* Section headers */
body h5,
body h6 {
  font-size: 1.1em !important;
}

/* General text */
body p,
body span,
body a {
  font-size: 1em !important;
}

/*  Tooltip */

.accessibility-btn[data-tooltip] {
  position: relative;
}

.accessibility-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 100%;
  left: auto;
  top: 50%;
  transform: translateY(-50%);
  background: #2c3e50;
  color: #fff;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  margin-right: 10px;
}

.accessibility-btn[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
}

/* Responsive - มือถือ  */

@media (max-width: 768px) {
  .accessibility-toolbar {
    top: auto;
    bottom: 650px;
    transform: none;
  }

  .accessibility-btn {
    width: 45px;
    height: 45px;
    font-size: 18px;
  }

  .accessibility-dropdown-content {
    min-width: 120px;
    padding: 8px;
  }
}