/* =============================================================
   UIDE PANEL DE ACCESIBILIDAD - ESTILOS
   ============================================================= */

/* ---- Botón flotante principal (izquierda) ---- */
#uide-accessibility-panel {
    position: fixed !important;
    left: 15px !important;
    bottom: 70px !important;
    z-index: 999999 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.uide-acc-trigger {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    max-width: 44px !important;
    max-height: 44px !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    border: 2px solid #002D72 !important;
    color: #002D72 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

.uide-acc-trigger:hover {
    transform: scale(1.08) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
    background: #f8f9fa !important;
}

.uide-acc-trigger.active {
    background: #002D72 !important;
    border-color: #002D72 !important;
}

.uide-acc-trigger.active .uide-acc-icon {
    color: #ffffff !important;
}

.uide-acc-trigger:focus {
    outline: 2px solid #EAAA00 !important;
    outline-offset: 3px !important;
}

.uide-acc-icon {
    width: 20px !important;
    height: 20px !important;
    display: block !important;
    flex-shrink: 0 !important;
    line-height: 0 !important;
}

/* ---- Panel expandible ---- */
.uide-acc-panel {
    position: absolute;
    bottom: 65px;
    left: 0;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    border: 1px solid #e0e0e0;
    width: 260px;
    overflow: hidden;
    animation: uidePanelSlide 0.25s ease;
}

@keyframes uidePanelSlide {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.uide-acc-panel-header {
    background: linear-gradient(135deg, #002D72 0%, #001a44 100%);
    color: #ffffff;
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.3px;
}

.uide-acc-panel-body {
    padding: 16px;
}

/* ---- Grupos de controles ---- */
.uide-acc-group {
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f0f0f0;
}

.uide-acc-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.uide-acc-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.uide-acc-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ---- Botones ---- */
.uide-acc-btn {
    width: 38px; height: 38px; border-radius: 8px;
    background: #f5f5f5; border: 2px solid #e0e0e0;
    color: #002D72; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease; padding: 0;
}

.uide-acc-btn:hover {
    background: #e8e8e8; border-color: #ccc; transform: translateY(-1px);
}

.uide-acc-btn:focus { outline: 2px solid #EAAA00; outline-offset: 2px; }
.uide-acc-btn:active { transform: translateY(0); }

.uide-acc-btn.active {
    background: #002D72; border-color: #002D72; color: #ffffff;
}

.uide-acc-btn.active svg,
.uide-acc-btn.active svg path,
.uide-acc-btn.active svg circle,
.uide-acc-btn.active svg line {
    stroke: #ffffff !important;
    fill: #ffffff !important;
}

/* For contrast icon which has fill path */
.uide-acc-btn.active svg path[fill] {
    fill: #ffffff !important;
}

.uide-acc-btn-reset { width: 32px; height: 32px; border-radius: 6px; }

/* ---- Display de zoom ---- */
.uide-acc-zoom-value {
    flex: 1;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #002D72;
    background: #f0f4ff;
    padding: 6px 8px;
    border-radius: 6px;
    min-width: 50px;
}

/* ---- Botones toggle (contraste / dark mode) ---- */
.uide-acc-toggle {
    width: 100%;
    height: auto;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    border-radius: 10px;
}

.uide-acc-toggle svg {
    flex-shrink: 0;
}

.uide-acc-toggle span {
    flex: 1;
    text-align: left;
}

.uide-acc-toggle.active {
    background: #EAAA00;
    border-color: #EAAA00;
    color: #002D72;
    font-weight: 600;
}

/* =============================================================
   HIGH CONTRAST MODE
   ============================================================= */
html.high-contrast {
    filter: contrast(1.25) brightness(1.05);
}

html.high-contrast body {
    color: #000 !important;
}

html.high-contrast a {
    color: #0000CC !important;
    text-decoration: underline !important;
}

html.high-contrast a:hover {
    color: #0000FF !important;
    text-decoration: underline !important;
}

/* =============================================================
   DARK MODE ADJUSTMENTS FOR PANEL
   ============================================================= */
html.dark-mode .uide-acc-panel {
    background: #1a1f2e;
    border-color: #2d3748;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

html.dark-mode .uide-acc-group {
    border-color: #2d3748;
}

html.dark-mode .uide-acc-label {
    color: #8892a4;
}

html.dark-mode .uide-acc-btn {
    background: #252b3b;
    border-color: #3a4258;
    color: #e8eaed;
}

html.dark-mode .uide-acc-btn:hover {
    background: #2d3748;
    border-color: #4a5568;
}

html.dark-mode .uide-acc-btn.active {
    background: #EAAA00;
    border-color: #EAAA00;
    color: #002D72;
}

html.dark-mode .uide-acc-zoom-value {
    background: #252b3b;
    color: #e8eaed;
}

html.dark-mode .uide-acc-toggle {
    color: #e8eaed;
}

html.dark-mode .uide-acc-toggle.active {
    background: #EAAA00;
    border-color: #EAAA00;
    color: #002D72;
}

/* =============================================================
   RESPONSIVE
   ============================================================= */
@media (max-width: 768px) {
    #uide-accessibility-panel {
        left: 12px;
        bottom: 70px;
    }

    .uide-acc-trigger {
        width: 46px;
        height: 46px;
    }

    .uide-acc-panel {
        width: 240px;
        bottom: 58px;
    }
}

@media (max-width: 480px) {
    .uide-acc-panel {
        width: calc(100vw - 24px);
        max-width: 280px;
    }
}

/* =============================================================
   ANIMATION REDUCTION (prefers-reduced-motion)
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
    .uide-acc-trigger,
    .uide-acc-btn,
    .uide-acc-panel {
        transition: none !important;
        animation: none !important;
    }
}
