/* Enhanced Google Translate Widget Styles */
.translate-widget {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    z-index: 10000;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50px;
    padding: 12px 20px;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
}

.translate-widget:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

.translate-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-weight: 500;
    font-size: 14px;
}

.translate-icon {
    font-size: 18px;
    animation: rotate 2s linear infinite;
}

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

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

.translate-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    padding: 20px;
    min-width: 280px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
    z-index: 10001;
}

.translate-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.translate-dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 20px;
    width: 16px;
    height: 16px;
    background: white;
    border: 1px solid #e2e8f0;
    border-bottom: none;
    border-right: none;
    transform: rotate(45deg);
}

.translate-header {
    text-align: center;
    margin-bottom: 15px;
    color: #1a202c;
    font-weight: 600;
}

.language-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 15px;
}

.language-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    color: #4a5568;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.language-btn:hover {
    border-color: #667eea;
    background: #f7fafc;
    color: #667eea;
    transform: translateY(-1px);
}

.language-btn.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.language-flag {
    font-size: 16px;
}

/* Current language indicator */
.current-language {
    position: absolute;
    top: -8px;
    left: -8px;
    background: #22c55e;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Google Translate Container - VISIBLE */
.google-translate-container {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

/* Show Google Translate element */
#google_translate_element {
    display: block !important;
    visibility: visible !important;
}

/* Style the Google Translate widget */
.goog-te-gadget-simple {
    background-color: transparent !important;
    border: none !important;
    font-size: 13px !important;
}

.goog-te-combo {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
    left: auto !important;
    top: auto !important;
    background: white !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 5px !important;
    padding: 5px !important;
}

/* Hide ALL Google Translate UI elements and banners */
.goog-te-banner-frame,
.goog-te-menu-frame,
iframe.goog-te-banner-frame,
#goog-gt-tt,
.goog-tooltip,
.goog-logo-link {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 0 !important;
    height: 0 !important;
}

.goog-te-gadget {
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
}

.goog-te-combo {
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    pointer-events: none !important;
}

/* Hide any Google Translate popups or notifications */
div[id*="goog"],
iframe[id*="goog"],
div[class*="goog-te"],
iframe[class*="goog-te"] {
    display: none !important;
    visibility: hidden !important;
}

/* Force hide translation notifications */
body > div[style*="position: fixed"],
body > div[style*="z-index"] {
    display: none !important;
}

/* Prevent body from being pushed down by Google Translate */
body {
    top: 0px !important;
}

body.translated {
    top: 0px !important;
}

/* Translated content styling */
.translated-ltr {
    direction: ltr !important;
}

.translated-rtl {
    direction: rtl !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .translate-widget {
        right: 15px;
        padding: 10px 16px;
    }

    .translate-dropdown {
        min-width: 260px;
        right: -20px;
    }

    .language-grid {
        grid-template-columns: 1fr;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .translate-dropdown {
        background: #2d3748;
        border-color: #4a5568;
        color: white;
    }
    
    .translate-dropdown::before {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .translate-header {
        color: white;
    }
    
    .language-btn {
        background: #4a5568;
        color: white;
        border-color: #718096;
    }
    
    .language-btn:hover {
        background: #667eea;
        border-color: #667eea;
    }
}