/* ==========================================================
   UOB COMPACT PAGE READER — ENGLISH + ARABIC
   Shared network stylesheet
   ========================================================== */

.uob-reader-widget,
.uob-reader-widget * {
    box-sizing: border-box;
}

.uob-reader-widget {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 999999;
    direction: ltr;
    font-family: Arial, sans-serif;
}

.uob-reader-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 52px;
    min-height: 52px;
    padding: 10px 15px;
    border: 2px solid #ffffff;
    border-radius: 30px;
    background: #0c4180;
    color: #ffffff;
    font: 700 14px/1 Arial, sans-serif;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
}

.uob-reader-toggle:hover,
.uob-reader-toggle:focus-visible {
    background: #bd9c6c;
    color: #082c57;
}

.uob-reader-toggle-icon {
    font-size: 21px;
    line-height: 1;
}

.uob-reader-panel {
    position: absolute;
    right: 0;
    bottom: 64px;
    width: 290px;
    max-width: calc(100vw - 24px);
    max-height: 75vh;
    overflow-y: auto;
    padding: 14px;
    border: 2px solid #0c4180;
    border-radius: 12px;
    background: #ffffff;
    color: #222222;
    text-align: left;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.uob-reader-panel[hidden] {
    display: none !important;
}

.uob-reader-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dddddd;
    color: #0c4180;
    font-size: 17px;
}

.uob-reader-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #333333;
    font-size: 26px;
    cursor: pointer;
}

.uob-reader-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.uob-reader-action {
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid #0c4180;
    border-radius: 6px;
    background: #ffffff;
    color: #0c4180;
    font: 600 14px Arial, sans-serif;
    cursor: pointer;
}

.uob-reader-action:hover,
.uob-reader-action:focus-visible,
.uob-reader-action[aria-pressed="true"],
.uob-reader-action.is-active {
    border-color: #0c4180 !important;
    background: #0c4180 !important;
    color: #ffffff !important;
}

.uob-reader-action[aria-pressed="true"],
.uob-reader-action.is-active {
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.uob-reader-action:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

/* Full-width Read-on-hover button. */
.uob-reader-hover-action {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 7px;
    grid-column: 1 / -1;
    width: 100%;
}

/* Use only the real inline SVG inserted by the shared JavaScript. */
html body #uob-reader-widget #uob-reader-hover::before {
    content: none !important;
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: none !important;
}

html body #uob-reader-widget #uob-reader-hover > svg.uob-reader-hover-icon {
    display: inline-block !important;
    width: 19px !important;
    height: 19px !important;
    min-width: 19px !important;
    flex: 0 0 19px !important;
    margin: 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
    fill: currentColor !important;
}

.uob-reader-speed-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    margin-top: 14px;
}

.uob-reader-speed-row label {
    color: #222222;
    font-size: 14px;
    font-weight: 600;
}

.uob-reader-speed {
    min-width: 92px;
    min-height: 40px;
    padding: 6px 9px;
    border: 1px solid #0c4180;
    border-radius: 6px;
    background: #ffffff;
    color: #222222;
    font-family: Arial, sans-serif;
}

.uob-reader-status {
    display: block;
    min-height: 20px;
    margin-top: 10px;
    color: #555555;
    font-size: 13px;
    line-height: 1.5;
}

.uob-reader-widget button:focus-visible,
.uob-reader-widget select:focus-visible {
    outline: 3px solid #ffbf47 !important;
    outline-offset: 3px !important;
}

html.uob-hover-reader-active header,
html.uob-hover-reader-active nav,
html.uob-hover-reader-active main,
html.uob-hover-reader-active footer,
html.uob-hover-reader-active #main,
html.uob-hover-reader-active p,
html.uob-hover-reader-active h1,
html.uob-hover-reader-active h2,
html.uob-hover-reader-active h3,
html.uob-hover-reader-active h4,
html.uob-hover-reader-active h5,
html.uob-hover-reader-active h6,
html.uob-hover-reader-active li,
html.uob-hover-reader-active a,
html.uob-hover-reader-active img {
    cursor: help;
}

/* The floating control is used; hide the optional duplicate inline button. */
#uob-reader-inline,
.uob-reader-inline {
    display: none !important;
}

/* Arabic/RTL: keep the widget on the left and open the panel inward. */
html[lang^="ar"] .uob-reader-widget,
html[dir="rtl"] .uob-reader-widget,
body.rtl .uob-reader-widget {
    left: 20px;
    right: auto;
    direction: rtl;
}

html[lang^="ar"] .uob-reader-panel,
html[dir="rtl"] .uob-reader-panel,
body.rtl .uob-reader-panel {
    left: 0;
    right: auto;
    direction: rtl;
    text-align: right;
}

/* On mobile, show a reliable SVG speaker inside the circular toggle. */
@media (max-width: 600px) {
    .uob-reader-widget {
        right: 12px;
        bottom: 12px;
    }

    .uob-reader-toggle {
        width: 52px;
        min-width: 52px;
        height: 52px;
        padding: 0;
        border-radius: 50%;
    }

    .uob-reader-toggle-text,
    .uob-reader-toggle-icon {
        display: none !important;
    }

    .uob-reader-toggle::before {
        content: "";
        display: block;
        width: 25px;
        height: 25px;
        flex: 0 0 25px;
        background-position: center;
        background-repeat: no-repeat;
        background-size: contain;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ffffff' d='M3 9v6h4l5 4V5L7 9H3z'/%3E%3Cpath fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' d='M15 8.5a5 5 0 0 1 0 7M17.5 6a8 8 0 0 1 0 12'/%3E%3C/svg%3E");
    }

    .uob-reader-panel {
        right: 0;
        width: min(290px, calc(100vw - 24px));
    }

    html[lang^="ar"] .uob-reader-widget,
    html[dir="rtl"] .uob-reader-widget,
    body.rtl .uob-reader-widget {
        left: 12px;
        right: auto;
    }

    html[lang^="ar"] .uob-reader-panel,
    html[dir="rtl"] .uob-reader-panel,
    body.rtl .uob-reader-panel {
        left: 0;
        right: auto;
    }
}

/* Hover interaction is unavailable on touch-only devices. */
@media (hover: none), (pointer: coarse) {
    .uob-reader-hover-action {
        display: none !important;
    }
}

/* ==========================================================
   END UOB COMPACT PAGE READER
   ========================================================== */
