/* 
 * Hub Inklusiva Acessibilidade - Drawer Styles V3.1 (Bugfix)
 */

:root {
    --hi-bg-panel: #f5f7fa;
    --hi-text-main: #333333;
    --hi-border: #e0e0e0;
    --hi-hover: #ffffff;
    --hi-shadow: rgba(0, 0, 0, 0.2);
}

/* O wrapper agora cobre a tela inteira, mas deixa os cliques passarem direto pro site */
#hi-acessibilidade-wrapper {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 2147483647;
    pointer-events: none; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Somente o botao e o painel recebem cliques */
#hi-acesso-toggle, #hi-acesso-panel {
    pointer-events: auto;
}

/* Botão Flutuante */
#hi-acesso-toggle {
    background-color: var(--hi-acesso-color, #1b2d42);
    color: #ffffff;
    border: 3px solid #ffffff;
    border-radius: 50%;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--hi-shadow);
    transition: transform 0.2s;
    position: absolute;
    z-index: 2; /* Fica acima do painel, caso se cruzem */
}
#hi-acesso-toggle:focus { outline: 3px solid #ffcc00; }
#hi-acessibilidade-wrapper.hi-is-open #hi-acesso-toggle {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.5);
}

/* Posições Absolutas do Botão */
#hi-acessibilidade-wrapper.pos-right-middle #hi-acesso-toggle { top: calc(50% + 70px); right: 30px; margin-top: -32px; }
#hi-acessibilidade-wrapper.pos-left-middle #hi-acesso-toggle { top: calc(50% + 70px); left: 30px; margin-top: -32px; }
#hi-acessibilidade-wrapper.pos-right-bottom #hi-acesso-toggle { bottom: 30px; right: 30px; }
#hi-acessibilidade-wrapper.pos-left-bottom #hi-acesso-toggle { bottom: 30px; left: 30px; }


/* 
 * O NOVO PAINEL (SIDEBAR GIGANTE)
 */
#hi-acesso-panel {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 420px;
    max-width: 100vw; 
    background: var(--hi-bg-panel);
    box-shadow: 0 0 40px var(--hi-shadow);
    z-index: 1; 
    display: flex;
    flex-direction: column;
    visibility: hidden;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), visibility 0.4s;
}

/* Fixar na direita ou esquerda (oculto por padrão) */
.pos-right-bottom #hi-acesso-panel,
.pos-right-middle #hi-acesso-panel { 
    right: 0; 
    transform: translateX(100%); 
}
.pos-left-bottom #hi-acesso-panel,
.pos-left-middle #hi-acesso-panel { 
    left: 0; 
    transform: translateX(-100%); 
}

#hi-acesso-panel.hi-panel-open {
    visibility: visible;
    transform: translateX(0) !important;
}

/* Cabeçalho Gigante */
.hi-panel-header {
    background: var(--hi-acesso-color, #1b2d42);
    color: #fff;
    padding: 30px 20px;
    text-align: center;
    position: relative;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    flex-shrink: 0;
}

.hi-header-icon {
    width: 60px;
    height: 60px;
    background: #fff;
    color: var(--hi-acesso-color, #1b2d42);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.hi-panel-header h2 { 
    margin: 0; 
    font-size: 24px; 
    color: #fff; 
    font-weight: bold;
}

#hi-acesso-close { 
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255,255,255,0.2); 
    border: none; 
    color: #fff; 
    font-size: 20px; 
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer; 
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
#hi-acesso-close:hover { background: rgba(255,255,255,0.4); }

/* Área de Rolagem do Conteúdo */
.hi-panel-content {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1; 
}

.hi-panel-content::-webkit-scrollbar { width: 8px; }
.hi-panel-content::-webkit-scrollbar-track { background: transparent; }
.hi-panel-content::-webkit-scrollbar-thumb { background: #ccc; border-radius: 10px; }
.hi-panel-content::-webkit-scrollbar-thumb:hover { background: #aaa; }

/* Seções e Grid */
.hi-section { margin-bottom: 30px; }
.hi-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--hi-text-main);
    margin-top: 0;
    margin-bottom: 15px;
}

.hi-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px; }
.hi-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

/* Botões de Ação */
.hi-action-btn {
    background: #fff;
    border: 1px solid var(--hi-border);
    border-radius: 10px;
    padding: 15px 5px;
    font-size: 12px;
    color: var(--hi-text-main);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.hi-action-btn:hover, .hi-action-btn:focus { 
    background: var(--hi-hover) !important; 
    color: var(--hi-text-main) !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05); 
    transform: translateY(-2px); 
}
.hi-action-btn.hi-active {
    background: var(--hi-acesso-color) !important;
    color: #fff !important;
    border-color: var(--hi-acesso-color) !important;
}
.hi-btn-icon {
    font-size: 20px;
    font-weight: bold;
    display: block;
}

/* Botões de + e - */
.hi-control-btn {
    background: #fff;
    border: 1px solid var(--hi-border);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.hi-control-btn span { display: block; font-size: 12px; margin-bottom: 15px; font-weight: 600;}
.hi-control-actions { display: flex; justify-content: space-between; align-items: center; }
.hi-control-actions button {
    background: var(--hi-acesso-color);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 0;
}
.hi-control-actions button:hover { filter: brightness(0.85); }
.hi-control-status { font-size: 12px; color: #777; }

.hi-panel-footer { margin-top: 20px; text-align: center; padding-bottom: 20px;}
#hi-acesso-reset {
    background: var(--hi-acesso-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 15px;
    width: 100%;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 10px;
}

/* EFEITOS V2 */
.hi-force-focus *:focus { outline: 3px solid #ffcc00 !important; outline-offset: 2px !important; }
body.hi-text-size-1 * { font-size: 110% !important; }
body.hi-text-size-2 * { font-size: 125% !important; }
body.hi-text-size-3 * { font-size: 150% !important; }
body.hi-line-height-1 * { line-height: 1.5 !important; }
body.hi-line-height-2 * { line-height: 1.75 !important; }
body.hi-line-height-3 * { line-height: 2.0 !important; }
body.hi-letter-spacing-1 * { letter-spacing: 1px !important; }
body.hi-letter-spacing-2 * { letter-spacing: 2px !important; }
body.hi-font-weight * { font-weight: 700 !important; }
body.hi-align-left * { text-align: left !important; }
body.hi-align-center * { text-align: center !important; }
body.hi-align-right * { text-align: right !important; }
body.hi-high-contrast { filter: invert(100%) hue-rotate(180deg) !important; background: #000 !important; }
body.hi-high-contrast img, body.hi-high-contrast video, body.hi-high-contrast #hi-acessibilidade-wrapper { filter: invert(100%) hue-rotate(180deg) !important; }
body.hi-light-contrast { background: #fff !important; color: #000 !important; }
body.hi-light-contrast * { color: #000 !important; border-color: #000 !important; }
body.hi-light-contrast #hi-acessibilidade-wrapper * { color: inherit !important; }
body.hi-grayscale { filter: grayscale(100%) !important; }
body.hi-grayscale #hi-acessibilidade-wrapper { filter: none !important; }
body.hi-hide-images img, body.hi-hide-images .elementor-image, body.hi-hide-images .gb-container-image { visibility: hidden !important; }
body.hi-highlight-links a, body.hi-highlight-links button { text-decoration: underline !important; text-decoration-color: #ffcc00 !important; background-color: rgba(255, 204, 0, 0.2) !important; color: #000 !important; }
body.hi-highlight-links #hi-acessibilidade-wrapper a, body.hi-highlight-links #hi-acessibilidade-wrapper button { text-decoration: none !important; background-color: transparent !important; }
body.hi-large-cursor, body.hi-large-cursor * { cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path d="M7 2l12 11.2-5.8.5 3.3 7.3-2.2 1-3.2-7.4-4.4 4.8z" fill="%23000" stroke="%23fff" stroke-width="1.5"/></svg>'), auto !important; }
body.hi-stop-animations * { transition: none !important; animation: none !important; }
body.hi-readable-font * { font-family: Arial, Helvetica, sans-serif !important; }
#hi-reading-guide { position: fixed; left: 0; right: 0; height: 4px; background: #ffcc00; z-index: 2147483646; pointer-events: none; display: none; }
#hi-reading-mask-top, #hi-reading-mask-bottom { position: fixed; left: 0; right: 0; background: rgba(0,0,0,0.7); z-index: 2147483645; pointer-events: none; display: none; }
body.hi-reading-line #hi-reading-guide { display: block; }
body.hi-reading-mask #hi-reading-mask-top { display: block; top: 0; }
body.hi-reading-mask #hi-reading-mask-bottom { display: block; bottom: 0; }
