/* Estilos para el widget de idiomas */
.language-widget {
    position: fixed;
    right: 20px;
    top: 200px; /* 5 espacios por debajo del TTS */
    z-index: 1000;
    font-family: 'Poppins', sans-serif;
}

.language-selector {
    position: relative;
}

.language-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    min-width: 140px;
    justify-content: space-between;
}

.language-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.language-btn i {
    font-size: 16px;
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    min-width: 300px;
    max-height: 400px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    margin-top: 10px;
}

.language-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-search {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.language-search input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

.language-search input:focus {
    border-color: #667eea;
}

.language-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 10px 0;
}

.language-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-left: 3px solid transparent;
}

.language-option:hover {
    background-color: #f8f9ff;
    border-left-color: #667eea;
}

.language-option.active {
    background-color: #e8f0ff;
    border-left-color: #667eea;
    color: #667eea;
    font-weight: 600;
}

.language-name {
    font-size: 14px;
    font-weight: 500;
}

.language-code {
    font-size: 12px;
    color: #666;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.language-option.active .language-code {
    background: #667eea;
    color: white;
}

/* Modal de selección de idioma */
.language-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.language-modal-content {
    background: white;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.language-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #f0f0f0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.language-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.2);
}

.language-modal-search {
    padding: 20px 25px;
    border-bottom: 1px solid #f0f0f0;
}

.language-modal-search input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
}

.language-modal-search input:focus {
    border-color: #667eea;
}

.language-modal-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px 0;
}

/* Estilos para el botón de idioma en el chat */
#chatLanguageBtn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

#chatLanguageBtn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

#chatLanguageBtn i {
    font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .language-widget {
        right: 10px;
        top: 180px;
    }
    
    .language-btn {
        min-width: 120px;
        padding: 10px 15px;
        font-size: 12px;
    }
    
    .language-dropdown {
        min-width: 250px;
        right: -50px;
    }
    
    .language-modal-content {
        width: 95%;
        margin: 20px;
    }
}

/* Scrollbar personalizado */
.language-list::-webkit-scrollbar,
.language-modal-list::-webkit-scrollbar {
    width: 6px;
}

.language-list::-webkit-scrollbar-track,
.language-modal-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.language-list::-webkit-scrollbar-thumb,
.language-modal-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.language-list::-webkit-scrollbar-thumb:hover,
.language-modal-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Tema oscuro */
[data-theme="dark"] .language-dropdown,
[data-theme="dark"] .language-modal-content {
    background: #2d3748;
    color: white;
}

[data-theme="dark"] .language-search input,
[data-theme="dark"] .language-modal-search input {
    background: #4a5568;
    border-color: #718096;
    color: white;
}

[data-theme="dark"] .language-option:hover {
    background-color: #4a5568;
}

[data-theme="dark"] .language-option.active {
    background-color: #2b6cb0;
    color: white;
}

[data-theme="dark"] .language-code {
    background: #4a5568;
    color: #e2e8f0;
}

[data-theme="dark"] .language-option.active .language-code {
    background: #4299e1;
    color: white;
} 