﻿/* Bộ công cụ hỗ trợ người khuyết tật – dùng chung mọi giao diện (Views/Shared/Portals/_HoTroNguoiKhuyetTat.cshtml).
   Mọi lớp có tiền tố .httc- (hỗ trợ tiếp cận) để không đụng CSS theme; cỡ chữ của bảng viết bằng px
   và bảng không bị phóng chữ / đổi màu theo trang để luôn đọc được. */

/* ---------- Nút nổi + bảng công cụ ---------- */
.httc, .httc * { box-sizing: border-box; }
.httc { position: fixed; right: 0; top: 50%; z-index: 9998; transform: translateY(-50%);
        font: 400 14px/1.4 Arial, Helvetica, sans-serif; color: #10233f; text-align: left; letter-spacing: 0; text-transform: none; }
.httc button { font: inherit; margin: 0; cursor: pointer; text-transform: none; letter-spacing: 0; }
.httc-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.httc-toggle { display: flex; align-items: center; justify-content: center; width: 50px; height: 50px; padding: 0;
               border: 2px solid #fff !important; border-right: 0 !important; border-radius: 12px 0 0 12px;
               background: #0b57b4 !important; color: #fff !important; box-shadow: 0 6px 20px rgba(10, 34, 70, .35); transition: width .15s, background-color .15s; }
.httc-toggle:hover, .httc-toggle[aria-expanded="true"] { width: 56px; background: #083f85 !important; }
.httc-toggle svg { display: block; }

.httc-panel { position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 300px; max-width: calc(100vw - 16px);
              max-height: calc(100vh - 24px); overflow-y: auto; padding: 14px; border-radius: 14px 0 0 14px;
              background: #fff !important; color: #10233f !important; border: 1px solid #c9d3e2; border-right: 0;
              box-shadow: 0 12px 36px rgba(10, 34, 70, .30); }
.httc-panel[hidden] { display: none !important; }

.httc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.httc-head strong { font-size: 16px; font-weight: 700; color: #0b3c7d; }
.httc-close { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 8px; background: #eef2f8 !important; color: #10233f !important; font-size: 22px !important; line-height: 1; }
.httc-close:hover { background: #dde5f1 !important; }

.httc-group { margin: 0 0 12px; }
.httc-label { display: flex; justify-content: space-between; margin: 0 0 6px; font-size: 13px; font-weight: 700; color: #3b4b63; }
.httc-val { font-weight: 700; color: #0b57b4; }

.httc-row { display: flex; gap: 6px; }
.httc-btn { flex: 1 1 0; height: 44px; padding: 0; border: 1px solid #b7c4d8; border-radius: 10px; background: #f5f8fc !important;
            color: #10233f !important; font-family: Georgia, "Times New Roman", serif !important; font-size: 17px !important; font-weight: 700; }
.httc-btn-lg { font-size: 21px !important; }
.httc-btn:hover { background: #e3ebf7 !important; border-color: #0b57b4; }
.httc-btn:disabled { opacity: .45; cursor: not-allowed; }

.httc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.httc-opt { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 8px; border: 1px solid #b7c4d8; border-radius: 10px;
            background: #f5f8fc !important; color: #10233f !important; font-size: 13px !important; line-height: 1.25; text-align: left; }
.httc-opt:hover { background: #e3ebf7 !important; border-color: #0b57b4; }
.httc-opt[aria-pressed="true"] { border: 2px solid #0b57b4; background: #e1ecfb !important; font-weight: 700; padding: 5px 7px; }
.httc-wide { width: 100%; }
.httc-sw { flex: 0 0 auto; display: inline-block; width: 20px; height: 20px; border-radius: 50%; border: 1px solid #6b7a90; }
.httc-sw-def { background: conic-gradient(#e53935 0 25%, #fbc02d 0 50%, #43a047 0 75%, #1e88e5 0) !important; }
.httc-sw-gray { background: linear-gradient(90deg, #222 50%, #ccc 50%) !important; }
.httc-sw-dark { background: linear-gradient(90deg, #000 50%, #ff0 50%) !important; }
.httc-sw-light { background: linear-gradient(90deg, #fff 50%, #000 50%) !important; }
.httc-sw-link { border-radius: 4px; background: #ff0 !important; box-shadow: inset 0 -4px 0 #0b57b4; }

.httc-reset { width: 100%; height: 42px; border: 0; border-radius: 10px; background: #0b57b4 !important; color: #fff !important; font-weight: 700; }
.httc-reset:hover { background: #083f85 !important; }

.httc button:focus { outline: none; }
.httc button:focus-visible { outline: 3px solid #f2b705 !important; outline-offset: 2px; }

@media (max-width: 575px) {
    .httc-toggle { width: 44px; height: 44px; }
    .httc-toggle:hover, .httc-toggle[aria-expanded="true"] { width: 48px; }
    .httc-toggle svg { width: 22px; height: 22px; }
}
@media (prefers-reduced-motion: reduce) { .httc-toggle { transition: none; } }
@media print { .httc { display: none !important; } }

/* Trong lúc script đo / đổi cỡ chữ (vài mili giây): tắt transition để đo đúng cỡ chữ gốc */
html.httc-measuring *, html.httc-measuring *::before, html.httc-measuring *::after { transition: none !important; }

/* ---------- Chế độ màu áp dụng cho trang (lớp đặt trên thẻ <html>) ---------- */
/* Đen trắng: lọc trên <html> để phần tử position: fixed (menu dính, nút lên đầu trang) vẫn đúng vị trí */
html.httc-gray { filter: grayscale(100%); }

/* Tương phản cao – nền tối: nền đen, chữ trắng, liên kết vàng */
html.httc-dark, html.httc-dark body { background: #000 !important; }
html.httc-dark body *:not(.httc):not(.httc *) {
    background-color: #000 !important; background-image: none !important; color: #fff !important;
    border-color: #fff !important; text-shadow: none !important; box-shadow: none !important;
}
html.httc-dark body a:not(.httc):not(.httc *), html.httc-dark body a *:not(.httc):not(.httc *) { color: #ff0 !important; }
html.httc-dark body a:not(.httc):not(.httc *) { text-decoration: underline !important; }
html.httc-dark body :is(input, select, textarea):not(.httc):not(.httc *) { border: 1px solid #fff !important; }
html.httc-dark body :is(button, .btn):not(.httc):not(.httc *) { border: 1px solid #ff0 !important; color: #ff0 !important; }

/* Tương phản cao – nền sáng: nền trắng, chữ đen, liên kết xanh đậm */
html.httc-light, html.httc-light body { background: #fff !important; }
html.httc-light body *:not(.httc):not(.httc *) {
    background-color: #fff !important; background-image: none !important; color: #000 !important;
    border-color: #000 !important; text-shadow: none !important; box-shadow: none !important;
}
html.httc-light body a:not(.httc):not(.httc *), html.httc-light body a *:not(.httc):not(.httc *) { color: #0000c8 !important; }
html.httc-light body a:not(.httc):not(.httc *) { text-decoration: underline !important; }
html.httc-light body :is(input, select, textarea, button, .btn):not(.httc):not(.httc *) { border: 1px solid #000 !important; }

/* Hai chế độ tương phản: lớp phủ trong suốt trên ảnh (overlay/mask) không được che ảnh */
html.httc-dark body :is([class*="overlay"], [class*="mask"], [class*="shadow"]):not(.httc):not(.httc *),
html.httc-light body :is([class*="overlay"], [class*="mask"], [class*="shadow"]):not(.httc):not(.httc *) { background-color: transparent !important; }
html.httc-dark body :is(img, video, iframe, picture, canvas):not(.httc):not(.httc *),
html.httc-light body :is(img, video, iframe, picture, canvas):not(.httc):not(.httc *) { background-color: transparent !important; }

/* Làm nổi bật liên kết */
html.httc-links body a:not(.httc):not(.httc *) { text-decoration: underline !important; text-underline-offset: 3px; outline: 2px dashed currentColor; outline-offset: 1px; }
html.httc-links body a:not(.httc):not(.httc *):hover, html.httc-links body a:not(.httc):not(.httc *):focus { background-color: #ff0 !important; color: #000 !important; }
