/* ===============================================
   ReadSpeaker - Acessibilidade Text-to-Speech
   =============================================== */

/* Controlos fixos para não alterarem o layout da página */
.readspeaker-toolbar-row {
    position: fixed;
    right: 16px;
    bottom: 88px;
    z-index: 10002;
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    pointer-events: none;
}

.readspeaker-button-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    align-items: flex-end;
    pointer-events: auto;
}

.virtualsign-launcher,
.virtualsign-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    border: 1px solid #c4cbd1;
    border-radius: 4px;
    background: #ffffff;
    color: #20303e;
    cursor: pointer;
    font: inherit;
}

#abrirVirtualSign {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 10003;
    width: 60px;
    height: 60px;
    min-height: 60px;
    padding: 0;
    overflow: hidden;
    border-radius: 50%;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.28);
    pointer-events: auto;
}

#readspeaker_button1 {
    pointer-events: auto;
}

#readspeaker_button1_toolpanel.rsbtn_toolpanel {
    position: absolute !important;
    top: auto !important;
    right: 0 !important;
    bottom: 100% !important;
    left: auto !important;
    z-index: 10001 !important;
}

#readspeaker_button1 #readspeaker_button1_toolpanel .rsbtn_tools {
    top: auto !important;
    bottom: 0 !important;
}

.virtualsign-icon {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.virtualsign-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

#interpretarVirtualSign {
    margin: 0 12px 12px;
}

.virtualsign-launcher:disabled {
    opacity: 0.6;
    cursor: default;
}

.virtualsign-launcher {
    padding: 8px 12px;
    font-size: 14px;
}

.virtualsign-close {
    width: 44px;
    flex-shrink: 0;
}

.virtualsign-launcher:focus-visible,
.virtualsign-close:focus-visible {
    outline: 3px solid #0066cc;
    outline-offset: 3px;
}

.virtualsign-panel[hidden] {
    display: none;
}

.virtualsign-panel {
    position: fixed;
    right: 16px;
    bottom: 128px;
    z-index: 10004;
    display: block;
}

.virtualsign-dialog {
    display: flex;
    flex-direction: column;
    width: min(344px, calc(100vw - 24px));
    height: min(477px, calc(100dvh - 24px));
    min-width: min(280px, calc(100vw - 24px));
    min-height: min(300px, calc(100dvh - 24px));
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    overflow: auto;
    resize: both;
    border-radius: 6px;
    background: #ffffff;
    color: #20303e;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

.virtualsign-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    cursor: move;
    touch-action: none;
    user-select: none;
}

.virtualsign-heading:focus-visible {
    outline: 3px solid #0066cc;
    outline-offset: -3px;
}

.virtualsign-heading h2 {
    margin: 0;
    font-size: 18px;
    line-height: 1.4;
}

#estadoVirtualSign {
    margin: 0;
    padding: 0 12px 12px;
}

.virtualsign-frame-container {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
}

.virtualsign-frame-container iframe {
    display: block;
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
}

@media (max-width: 600px) {
    .virtualsign-launcher {
        max-width: 100%;
        white-space: normal;
        text-align: left;
    }
}

