/**
 * Estilos del selector de idioma - 3 diseños diferentes
 * 
 * @package WP-AI-Translator
 * @since 1.0.0
 */

/* Estilos base del selector de idioma */
.wpait-language-switcher {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    z-index: 9999;
}

/* Diseño 1: Banderas con Texto */
.wpait-style-flags-text {
    position: relative;
    display: inline-block;
    min-width: 150px;
}

.wpait-style-flags-text .wpait-current-language {
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.wpait-style-flags-text .wpait-current-language:hover {
    border-color: #007cba;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.wpait-style-flags-text .wpait-flag {
    font-size: 18px;
    line-height: 1;
}

.wpait-style-flags-text .wpait-language-name {
    font-weight: 500;
    color: #333;
    flex: 1;
}

.wpait-style-flags-text .wpait-arrow {
    color: #666;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.wpait-style-flags-text.wpait-open .wpait-arrow {
    transform: rotate(180deg);
}

.wpait-style-flags-text .wpait-language-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.wpait-style-flags-text.wpait-open .wpait-language-options {
    max-height: 200px;
    opacity: 1;
}

.wpait-style-flags-text .wpait-language-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    text-decoration: none;
    color: #333;
    transition: background-color 0.2s ease;
}

.wpait-style-flags-text .wpait-language-option:hover {
    background-color: #f8f9fa;
}

/* Diseño 2: Menú Desplegable */
.wpait-style-dropdown {
    display: inline-block;
}

.wpait-style-dropdown .wpait-language-select {
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px 15px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    min-width: 120px;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 35px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.wpait-style-dropdown .wpait-language-select:hover {
    border-color: #007cba;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.wpait-style-dropdown .wpait-language-select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0,124,186,0.1);
}

.wpait-style-dropdown option {
    padding: 8px;
}

/* Diseño 3: Botones Separados */
.wpait-style-buttons {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.wpait-style-buttons .wpait-language-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.wpait-style-buttons .wpait-language-button:hover {
    background-color: #f8f9fa;
    border-color: #007cba;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.wpait-style-buttons .wpait-language-button.wpait-active {
    background-color: #007cba;
    border-color: #007cba;
    color: #ffffff;
}

.wpait-style-buttons .wpait-language-button.wpait-active:hover {
    background-color: #005a87;
}

.wpait-style-buttons .wpait-flag {
    font-size: 16px;
    line-height: 1;
}

.wpait-style-buttons .wpait-lang-code {
    font-weight: 600;
    font-size: 12px;
}

/* Posiciones del selector */
.wpait-position-floating {
    position: fixed;
    top: 20px;
    right: 20px;
}

.wpait-position-header {
    display: inline-block;
    margin: 0 10px;
}

.wpait-position-menu {
    display: block;
    margin: 10px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .wpait-style-flags-text {
        min-width: 120px;
    }
    
    .wpait-style-flags-text .wpait-current-language {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .wpait-style-dropdown .wpait-language-select {
        min-width: 100px;
        padding: 8px 30px 8px 12px;
        font-size: 13px;
    }
    
    .wpait-style-buttons {
        gap: 3px;
    }
    
    .wpait-style-buttons .wpait-language-button {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .wpait-style-buttons .wpait-flag {
        font-size: 14px;
    }
    
    .wpait-position-floating {
        top: 10px;
        right: 10px;
    }
}

/* Animaciones */
@keyframes wpaitFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wpait-language-options {
    animation: wpaitFadeIn 0.3s ease;
}

/* Temas de color */
.wpait-theme-dark .wpait-style-flags-text .wpait-current-language,
.wpait-theme-dark .wpait-style-dropdown .wpait-language-select,
.wpait-theme-dark .wpait-style-buttons .wpait-language-button {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

.wpait-theme-dark .wpait-style-flags-text .wpait-language-options {
    background: #2d3748;
    border-color: #4a5568;
}

.wpait-theme-dark .wpait-style-flags-text .wpait-language-option {
    color: #e2e8f0;
}

.wpait-theme-dark .wpait-style-flags-text .wpait-language-option:hover {
    background-color: #4a5568;
}

/* Accesibilidad */
.wpait-language-switcher:focus-within {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.wpait-language-switcher button:focus,
.wpait-language-switcher select:focus,
.wpait-language-switcher a:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Estados de carga */
.wpait-loading {
    opacity: 0.6;
    pointer-events: none;
}

.wpait-loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: wpaitSpin 1s linear infinite;
    margin-left: 8px;
}

@keyframes wpaitSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Personalización adicional para integración con temas */
.wpait-language-switcher.wpait-oceanwp {
    font-family: inherit;
}

.wpait-language-switcher.wpait-oceanwp .wpait-style-flags-text .wpait-current-language,
.wpait-language-switcher.wpait-oceanwp .wpait-style-dropdown .wpait-language-select,
.wpait-language-switcher.wpait-oceanwp .wpait-style-buttons .wpait-language-button {
    border-radius: 3px;
    font-family: inherit;
}

/* Soporte para temas oscuros del navegador */
@media (prefers-color-scheme: dark) {
    .wpait-language-switcher:not(.wpait-theme-light) .wpait-style-flags-text .wpait-current-language,
    .wpait-language-switcher:not(.wpait-theme-light) .wpait-style-dropdown .wpait-language-select,
    .wpait-language-switcher:not(.wpait-theme-light) .wpait-style-buttons .wpait-language-button {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .wpait-language-switcher:not(.wpait-theme-light) .wpait-style-flags-text .wpait-language-options {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .wpait-language-switcher:not(.wpait-theme-light) .wpait-style-flags-text .wpait-language-option {
        color: #e2e8f0;
    }
    
    .wpait-language-switcher:not(.wpait-theme-light) .wpait-style-flags-text .wpait-language-option:hover {
        background-color: #4a5568;
    }
}