/**
 * Decode Multi-Lang - Style definitions (Versión Estable 1.3.0)
 */

/* ==========================================================================
   1. OCULTAR BARRA SUPERIOR Y LEYENDAS INTRUSIVAS DE GOOGLE TRANSLATE
   ========================================================================== */
iframe.goog-te-banner-frame,
iframe[id*="container"],
iframe[id*=":1.container"],
iframe[id*=":2.container"],
.goog-te-banner-frame,
.goog-te-banner-frame.skiptranslate,
#goog-gt-tt,
.goog-te-balloon-frame,
.goog-tooltip,
.goog-te-spinner-pos,
.VIpgJd-yD4Bvf-yWrapper,
.VIpgJd-yD4Bvf-GHb,
.VIpgJd-yD4Bvf-r0255e {
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0px !important;
    width: 0px !important;
    max-height: 0px !important;
    position: absolute !important;
    top: -9999px !important;
    left: -9999px !important;
    pointer-events: none !important;
}

html, body {
    top: 0px !important;
    position: static !important;
    margin-top: 0px !important;
}

/* Ocultar texto y leyendas "Con la tecnología de Google" */
.goog-te-gadget {
    color: transparent !important;
    font-size: 0 !important;
}

.goog-te-gadget span,
.goog-te-gadget div,
.goog-te-gadget a {
    display: none !important;
}

body {
    top: 0px !important;
    position: static !important;
}

font,
.goog-text-highlight {
    background-color: transparent !important;
    box-shadow: none !important;
}

/* Proteger iconos de Material Symbols y fuentes de iconos */
.notranslate,
[translate="no"],
.material-symbols-outlined,
.material-symbols-sharp,
.material-symbols-rounded,
.material-icons,
.dashicons,
[class*="material-symbols"] {
    -webkit-translate: no !important;
    translate: no !important;
}

/* ==========================================================================
   2. ESTRUCTURA PRINCIPAL DEL WIDGET DE IDIOMAS DECODE
   ========================================================================== */
.decode-ml-wrapper {
    font-family: inherit;
    box-sizing: border-box;
    z-index: 2147483647 !important;
    -webkit-tap-highlight-color: transparent;
}

.decode-ml-wrapper * {
    box-sizing: border-box;
}

/* Ubicación Flotante Abajo a la Derecha */
.decode-ml-pos-bottom-right {
    position: fixed !important;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px)) !important;
    right: 20px !important;
}

/* Ubicación Flotante Abajo a la Izquierda */
.decode-ml-pos-bottom-left {
    position: fixed !important;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px)) !important;
    left: 20px !important;
}

/* Ubicación Inline (Shortcode o Menú Header) */
.decode-ml-pos-inline {
    display: inline-block !important;
    position: relative !important;
}

li.decode-ml-menu-item {
    display: inline-flex !important;
    align-items: center !important;
    list-style: none !important;
}

/* ==========================================================================
   3. BOTÓN PRINCIPAL (TRIGGER)
   ========================================================================== */
.decode-ml-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
    user-select: none;
    line-height: 1;
    touch-action: manipulation;
}

.decode-ml-trigger:hover {
    transform: translateY(-2px);
}

.decode-ml-chevron {
    font-size: 10px;
    transition: transform 0.3s ease;
    opacity: 0.7;
}

.decode-ml-wrapper.is-open .decode-ml-chevron {
    transform: rotate(180deg);
}

/* ==========================================================================
   4. MENÚ DESPLEGABLE (DROPDOWN)
   ========================================================================== */
.decode-ml-dropdown {
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    min-width: 180px;
    max-height: 55vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    border-radius: 12px;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    z-index: 2147483647 !important;
}

.decode-ml-dropdown::-webkit-scrollbar {
    width: 4px;
}
.decode-ml-dropdown::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.5);
    border-radius: 4px;
}

.decode-ml-pos-bottom-left .decode-ml-dropdown {
    right: auto;
    left: 0;
}

.decode-ml-pos-inline .decode-ml-dropdown {
    bottom: auto;
    top: calc(100% + 8px);
    right: 0;
}

.decode-ml-wrapper.is-open .decode-ml-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.decode-ml-lang-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.decode-ml-lang-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    line-height: 1.2;
    touch-action: manipulation;
}

.decode-ml-flag {
    font-size: 18px;
    line-height: 1;
}

/* ==========================================================================
   5. OPTIMIZACIONES ESPECÍFICAS PARA PANTALLAS MÓVILES (< 640px)
   ========================================================================== */
@media (max-width: 640px) {
    .decode-ml-pos-bottom-left {
        left: 14px !important;
        bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
    }
    .decode-ml-pos-bottom-right {
        right: 14px !important;
        bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
    }
    .decode-ml-trigger {
        padding: 8px 14px;
        font-size: 13px;
    }
    .decode-ml-dropdown {
        max-height: 50vh;
        min-width: 170px;
    }
    .decode-ml-lang-item {
        padding: 12px;
        font-size: 14px;
    }
}

/* ==========================================================================
   6. PRESETS DE ESTILO Y DISEÑO
   ========================================================================== */

/* 6.1 PRESET ADAPTATIVO */
.decode-ml-style-theme-match .decode-ml-trigger {
    background-color: var(--color-surface, var(--bg-surface, #ffffff));
    color: var(--color-on-surface, var(--text-primary, #1e293b));
    border: 1px solid var(--color-outline-variant, var(--border-color, #cbd5e1));
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}
.decode-ml-style-theme-match .decode-ml-trigger:hover {
    border-color: var(--color-primary, #0052cc);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
}
.decode-ml-style-theme-match .decode-ml-dropdown {
    background-color: var(--color-surface, #ffffff);
    border: 1px solid var(--color-outline-variant, #e2e8f0);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
}
.decode-ml-style-theme-match .decode-ml-lang-item {
    color: var(--color-on-surface-variant, #334155);
}
.decode-ml-style-theme-match .decode-ml-lang-item:hover,
.decode-ml-style-theme-match .decode-ml-lang-item.is-active {
    background-color: var(--color-primary-container, #f1f5f9);
    color: var(--color-primary, #0052cc);
}

/* 6.2 PRESET DECODE PROGRAMACIÓN (Azul Eléctrico & Cyan Neón) */
.decode-ml-style-decode-cyan .decode-ml-trigger {
    background: linear-gradient(135deg, #0052cc 0%, #00c3ff 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 18px rgba(0, 195, 255, 0.4);
}
.decode-ml-style-decode-cyan .decode-ml-trigger:hover {
    background: linear-gradient(135deg, #0040be 0%, #00e5ff 100%);
    box-shadow: 0 6px 24px rgba(0, 195, 255, 0.6);
}
.decode-ml-style-decode-cyan .decode-ml-dropdown {
    background-color: #0b172a;
    border: 1px solid #00c3ff;
    box-shadow: 0 12px 30px rgba(0, 195, 255, 0.25);
}
.decode-ml-style-decode-cyan .decode-ml-lang-item {
    color: #e0f2fe;
}
.decode-ml-style-decode-cyan .decode-ml-lang-item:hover,
.decode-ml-style-decode-cyan .decode-ml-lang-item.is-active {
    background: linear-gradient(90deg, rgba(0, 82, 204, 0.4) 0%, rgba(0, 195, 255, 0.25) 100%);
    color: #00e5ff;
}

/* 6.3 PRESET DECODE DARK CYBER (Fondo Oscuro Cyberpunk & Cyan) */
.decode-ml-style-decode-dark .decode-ml-trigger {
    background-color: #070d19;
    color: #00c3ff;
    border: 1px solid #0052cc;
    box-shadow: 0 4px 16px rgba(7, 13, 25, 0.6);
}
.decode-ml-style-decode-dark .decode-ml-trigger:hover {
    border-color: #00c3ff;
    box-shadow: 0 0 15px rgba(0, 195, 255, 0.4);
}
.decode-ml-style-decode-dark .decode-ml-dropdown {
    background-color: #070d19;
    border: 1px solid #0052cc;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.8);
}
.decode-ml-style-decode-dark .decode-ml-lang-item {
    color: #94a3b8;
}
.decode-ml-style-decode-dark .decode-ml-lang-item:hover,
.decode-ml-style-decode-dark .decode-ml-lang-item.is-active {
    background-color: rgba(0, 195, 255, 0.1);
    color: #00e5ff;
}

/* 6.4 PRESET GLASSMORPHISM */
.decode-ml-style-glassmorphism .decode-ml-trigger {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}
.decode-ml-style-glassmorphism .decode-ml-dropdown {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14);
}
.decode-ml-style-glassmorphism .decode-ml-lang-item {
    color: #1e293b;
}
.decode-ml-style-glassmorphism .decode-ml-lang-item:hover,
.decode-ml-style-glassmorphism .decode-ml-lang-item.is-active {
    background: rgba(255, 255, 255, 0.95);
    color: #0f172a;
}
