/* Translation System Styles for SARAIVA PLÁSTICOS */

.language-switcher {
    margin-left: 15px;
    display: flex !important;
    align-items: center;
    position: relative;
}

/* Translation Loading Indicator */
.translation-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px 30px;
    border-radius: 10px;
    z-index: 9999;
    display: none;
    align-items: center;
    gap: 15px;
    font-size: 16px;
    font-weight: 500;
}

.translation-loading.show {
    display: flex;
}

.translation-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Language button loading state */
.language-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.language-btn.loading .language-text {
    opacity: 0.5;
}

.language-btn {
    border: 1px solid rgba(2, 2, 92, 0.3);
    background: transparent;
    color: #0b055a;
    font-size: 14px;
    padding: 8px 15px;
    border-radius: 25px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    visibility: visible !important;
}

.language-btn:hover {
    background: rgba(252, 34, 34, 0.1);
    border-color: rgba(244, 200, 5, 0.5);
    color: #045d0b;
}

.language-btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
    color: #fff;
}

.language-btn .fas {
    font-size: 16px;
}

.language-text {
    font-weight: 500;
    letter-spacing: 0.5px;
}

.dropdown-menu {
    background: #fff;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 8px 0;
    min-width: 160px;
    margin-top: 8px;
}

.dropdown-item {
    padding: 10px 20px;
    color: #333;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: #f8f9fa;
    color: #2c5530;
}

.dropdown-item:active {
    background: #e9ecef;
    color: #2c5530;
}

.flag-icon {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    object-fit: cover;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .language-switcher {
        margin-left: 0;
        margin-top: 10px;
    }
    
    .language-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Dark theme support for footer */
.bg-dark .language-switcher .language-btn {
    border-color: rgba(255, 255, 255, 0.2);
}

.bg-dark .language-switcher .language-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Animation for language switch */
[data-translate] {
    transition: opacity 0.2s ease;
}

.translating [data-translate] {
    opacity: 0.7;
}

/* Loading state */
.language-switcher.loading .language-btn {
    opacity: 0.6;
    pointer-events: none;
}

/* Success feedback */
.language-switcher.success .language-btn {
    background: rgba(40, 167, 69, 0.2);
    border-color: rgba(40, 167, 69, 0.5);
}

/* Ensure proper spacing in navigation */
.navbar-nav .nav-item.language-switcher {
    display: flex;
    align-items: center;
}

/* Custom dropdown arrow */
.language-btn::after {
    margin-left: 5px;
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
}

/* Mobile language switcher styles */
.mobile-language-switcher {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-language-switcher h6 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
}

.language-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.language-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
}

.language-option:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-decoration: none;
}

.language-option .flag-icon {
    width: 20px;
    height: 15px;
    border-radius: 2px;
}

/* RTL support for future expansion */
[dir="rtl"] .language-switcher {
    margin-left: 0;
    margin-right: 15px;
}

[dir="rtl"] .dropdown-item {
    text-align: right;
    flex-direction: row-reverse;
}
