html,
body {
    background-color: black;
    height: 100%;
    width: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
    cursor: url("../assets/hand-pointer.svg"), auto;
}

#console {
    height: 100px;
    width: fit-content;

    background-image: url('console_bg.svg');

    font-family: Arial, Helvetica, sans-serif;
    font-size: 32px;
    bottom: 0px;
    left: 50%;
    transform: translate(-50%, -50%);
    position: absolute;
    z-index: 1;

    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

#console h2 {
    color: black;
    font-size: 1.1em;
}

#console table {
    white-space: nowrap;
}

#console table tr {
    vertical-align: top;

}

#console table td {
    padding: 3px;
}

.button {
    display: inline-block;
    width: 30px;
    height: 30px;
}

.buttonRefresh {
    background-image: url('refresh.svg');
    background-size: 30px 30px;
    background-repeat: no-repeat;
    background-position: center center;
}

.buttonLarger {
    background-image: url('plus.svg');
    background-size: 30px 30px;
    background-repeat: no-repeat;
    background-position: center center;
}

.buttonSmaller {
    background-image: url('minus.svg');
    background-size: 30px 30px;
    background-repeat: no-repeat;
    background-position: center center;
}

.mirror {
    -moz-transform: scaleX(-1);
    /* Gecko */
    -o-transform: scaleX(-1);
    /* Operah */
    -webkit-transform: scaleX(-1);
    /* webkit */
    transform: scaleX(-1);
    /* standard */
    filter: FlipH;
    /* IE 6/7/8 */
}

#displayFrame {
    background-color: #ffffff;
    position: relative;
    width: 100%;
    height: 100%;
    /*display:table;*/
    line-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;

    -moz-user-select: none;
    -khtml-user-select: none;
    -webkit-user-select: none;
    -o-user-select: none;
    user-select: none;
}

.chart {
    width: 100%;
    text-align: center;
    position: absolute;
    /*overflow:hidden;*/
}

.chart .row {
    position: relative;
    line-height: 0;
    white-space: nowrap;
}

.letters {
    display: block;
    position: relative;
}

.crowdBars {
    position: absolute;
    display: inline;
    margin-left: auto;
    margin-right: auto;
    left: 0;
    right: 0;

}

.crowdBar {
    position: absolute;
    background-color: black;
}

h2 {

    white-space: nowrap;
}

.chart span {
    position: relative;
    overflow: visible;
}

.chart .scale,
.chart .scale_left {
    position: absolute;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#acuityLabelsLayer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 5;
}

.acuity-label {
    position: fixed;
    top: 0;
    font-size: 1rem;
    display: inline-block;
    font-weight: 700;
    color: #000000;
    letter-spacing: 0.08em;
    white-space: nowrap;
    /* white outline so label text stays visible over black letters */
    text-shadow:
        -0.06em -0.06em 0 #ffffff,
         0.06em -0.06em 0 #ffffff,
        -0.06em  0.06em 0 #ffffff,
         0.06em  0.06em 0 #ffffff;
    background: transparent;
    padding: 0.05em 0.15em;
    border-radius: 0;
    box-shadow: none;
    transform: scale(3.0);
    transform-origin: left top;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.acuity-label.visible {
    opacity: 1;
}

.acuity-label--left {
    left: 2vw;
    text-align: left;
}

.acuity-label--right {
    right: 0;
    text-align: right;
    transform-origin: right top;
}

.logo {
    position: absolute;
    right: 1em;
    top: 1em;
    float: right;
}

#auth {
    position: absolute;
    right: 1em;
    top: 1em;
    float: right;
}

#settings table th {
    text-align: center;
}

#settings {
    display: flex;
    align-items: center;
    justify-content: center;
}

#consoleToggle {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 10;
}

#consoleToggleButton {
    width: 5.5rem;
    height: 3rem;
    border-radius: 1.5rem;
    border: none;
    position: relative;
    padding: 0;
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.35);
}

.console-toggle-track {
    position: absolute;
    inset: 0.15rem;
    border-radius: 999px;
    background-color: rgba(0, 0, 0, 0.3);
}

.console-toggle-knob {
    position: absolute;
    top: 0.15rem;
    left: 0.15rem;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    background-color: #ffffff;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.35);
    transition: left 0.22s ease, background-color 0.22s ease;
}

#consoleToggle.console-toggle--on #consoleToggleButton {
    background-color: rgba(0, 0, 0, 0.85);
}

#consoleToggle.console-toggle--on .console-toggle-track {
    background-color: rgba(255, 255, 255, 0.25);
}

#consoleToggle.console-toggle--on .console-toggle-knob {
    left: calc(100% - 2.6rem - 0.15rem);
    background-color: #ffffff;
}

#displayControlsFloating {
    position: fixed;
    right: 7.5rem;
    bottom: 4.5rem; /* nằm trên console, không che các nút khác */
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 6;
}

#displayControlsFloating .btn-display {
    width: 7.0rem;
    height: 7.0rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 3.4rem;
    background-color: rgba(0, 0, 0, 0.55); /* bóng đen mờ, vẫn thấy nền sau */
    color: #ffffff;
    border: none;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.45);
}

#settingsMenuToggle {
    position: fixed;
    top: 5.2rem;
    right: 1.5rem;
    z-index: 10;
}

#settingsMenuButton {
    width: 4.2rem;
    height: 4.2rem;
    border-radius: 1.3rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: linear-gradient(135deg, #005bea, #00c6fb);
    border: none;
    color: #ffffff;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.45);
}

#settingsMenuButton i {
    font-size: 2.3rem;
    color: #ffffff;
}

#settingsMenuButton:hover,
#settingsMenuButton:focus {
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.55);
    transform: translateY(-1px);
}

#settingsMenu {
    position: absolute;
    top: 4.2rem;
    right: 0;
    background-color: #f8f9fa;
    border-radius: 0.6rem;
    padding: 0.9rem 1.2rem;
    box-shadow: 0 0 14px rgba(0, 0, 0, 0.55);
    display: none;
    white-space: nowrap;
    font-size: 1.6rem;
}

#settingsMenu .btn {
    margin: 0 0.2rem;
    width: 4.6rem;
    height: 4.6rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8rem;
    border-radius: 1.2rem;
    background: linear-gradient(135deg, #ffffff, #e4ecff);
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: #202430;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

#settingsMenu .btn i {
    color: #202430;
}

#settingsMenu .btn:hover,
#settingsMenu .btn:focus {
    background: linear-gradient(135deg, #005bea, #00c6fb);
    color: #ffffff;
    border-color: rgba(0, 0, 0, 0.2);
}

#settingsMenu .btn:hover i,
#settingsMenu .btn:focus i {
    color: #ffffff;
}

#optoContextMenu {
    position: absolute;
    z-index: 20;
    background-color: rgba(255, 255, 255, 0.96);
    border-radius: 0.8rem;
    padding: 1.8rem 2.4rem;
    box-shadow:
        0 14px 32px rgba(0, 0, 0, 0.65),
        0 0 0 3px rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(0, 0, 0, 0.4);
    display: none;
    white-space: nowrap;
    font-size: 3.2rem;
    min-width: 38rem;
    backdrop-filter: blur(4px);
}

#optoContextMenu .context-row {
    display: flex;
    align-items: center;
    margin-bottom: 1.3rem;
}

#optoContextMenu .context-row:last-child {
margin-bottom: 0;
}

#optoContextMenu label {
flex: 0 0 16rem;
margin-right: 1.2rem;
margin-bottom: 0;
font-size: 3.0rem;
font-weight: 700;
}

#optoContextMenu select {
    flex: 1 1 auto;
    font-size: 3.0rem;
    height: 4.8rem;
    padding: 0.4rem 1.0rem;
}

/* Phóng to chữ trong các menu/modal để dễ đọc từ xa */
#modal_tuychon .modal-body,
#modal_canchinh .modal-body,
#modal_huongdan .modal-body,
#modal_gioithieu .modal-body {
    font-size: 1.8rem;
}

#modal_tuychon .modal-title,
#modal_canchinh .modal-title,
#modal_huongdan .modal-title,
#modal_gioithieu .modal-title {
    font-size: 2.2rem;
}

#modal_tuychon .modal-body label,
#modal_tuychon .modal-body span {
    font-size: 1.8rem;
}

#modal_tuychon .modal-body input[type="checkbox"],
#modal_tuychon .modal-body input[type="radio"] {
    width: 1.6rem;
    height: 1.6rem;
}

#modal_tuychon .modal-footer .btn,
#modal_canchinh .modal-footer .btn,
#modal_huongdan .modal-footer .btn,
#modal_gioithieu .modal-footer .btn {
    font-size: 1.6rem;
    padding: 0.6rem 1.4rem;
}

/* Đảm bảo nội dung hướng dẫn trong modal có thể cuộn khi quá dài */
#modal_huongdan .modal-content {
    max-height: 85vh;
}

/* Hiệu ứng giao diện cho các modal */
#modal_gioithieu .modal-content,
#modal_canchinh .modal-content,
#modal_tuychon .modal-content,
#modal_huongdan .modal-content {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.65);
}

/* Riêng modal Hướng dẫn: cho phép cuộn dọc nội dung, chỉ ẩn tràn ngang */
#modal_huongdan .modal-content {
    max-height: 85vh;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Modal Hướng dẫn chi tiết: kích thước rộng hơn */
#modal_huongdan .modal-dialog {
    width: 95vw;
    max-width: 1100px;
}

/* Layout hướng dẫn chi tiết trong modal Hướng dẫn */
#modal_huongdan .guide-container {
    padding-top: 0.5rem;
    padding-bottom: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

#modal_huongdan .guide-hero {
    background: linear-gradient(135deg, #005bea, #00c6fb);
    color: #ffffff;
    border-radius: 10px;
    padding: 1.2rem 1.4rem;
    margin-bottom: 1.4rem;
}

#modal_huongdan .guide-hero h3 {
    margin-top: 0;
    margin-bottom: 0.4rem;
    font-size: 2.2rem;
    font-weight: 700;
}

#modal_huongdan .guide-hero p {
    margin-bottom: 0;
    font-size: 1.4rem;
}

#modal_huongdan .step-grid {
    margin-top: 0.5rem;
}

#modal_huongdan .step-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 1.0rem 1.0rem 0.9rem 1.0rem;
    margin-bottom: 1.0rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    border-left: 4px solid #005bea;
}

#modal_huongdan .step-card--secondary {
    border-left-color: #28a745;
}

#modal_huongdan .step-card--warning {
    border-left-color: #f0ad4e;
}

#modal_huongdan .step-card--muted {
    border-left-color: #6c757d;
}

#modal_huongdan .step-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.6rem;
}

#modal_huongdan .step-badge {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    background: #005bea;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-right: 0.6rem;
}

#modal_huongdan .step-card--secondary .step-badge {
    background: #28a745;
}

#modal_huongdan .step-card--warning .step-badge {
    background: #f0ad4e;
}

#modal_huongdan .step-card--muted .step-badge {
    background: #6c757d;
}

#modal_huongdan .step-icon {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.4rem;
    font-size: 1.3rem;
}

#modal_huongdan .step-title {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
}

#modal_huongdan .step-card ul,
#modal_huongdan .step-card ol {
    margin-bottom: 0.4rem;
}

#modal_huongdan .qr-row {
    margin-top: 0.6rem;
}

#modal_huongdan .qr-card {
    text-align: center;
    margin-bottom: 0.6rem;
}

#modal_huongdan .qr-card h5 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 0.4rem;
}

#modal_huongdan .qr-img {
    max-width: 160px;
    height: auto;
}

#modal_huongdan .guide-disclaimer {
    margin-top: 0.8rem;
    font-size: 1.4rem;
    font-style: italic;
    color: #7a3b00;
    background: #fff3cd;
    border-left: 4px solid #f0ad4e;
    padding: 0.6rem 0.9rem;
    border-radius: 4px;
}

#modal_gioithieu .modal-header,
#modal_huongdan .modal-header {
    background: linear-gradient(135deg, #005bea, #00c6fb);
    color: #ffffff;
    border-bottom: none;
}

#modal_canchinh .modal-header,
#modal_tuychon .modal-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

#modal_gioithieu .modal-title,
#modal_canchinh .modal-title,
#modal_tuychon .modal-title,
#modal_huongdan .modal-title {
    font-weight: 600;
}

.modal.fade .modal-dialog {
    transition: transform 0.25s ease-out, opacity 0.25s ease-out;
    transform: translateY(-15px);
    opacity: 0;
}

.modal.in .modal-dialog {
    transform: translateY(0);
    opacity: 1;
}

.modal-backdrop.in {
    opacity: 0.65;
    filter: alpha(opacity=65);
}