/* =================================================================== */
/* ===== CSS CHO CUSTOM LANGUAGE SWITCHER (VN | EN) ===== */
/* =================================================================== */

/* 1. Ẩn thanh banner của Google */
body {
    top: 0 !important; 
}

.goog-te-banner-frame.skiptranslate {
    display: none !important;
}

/* 2. Ẩn hoàn toàn popup/banner Google Translate */
.goog-te-banner-frame {
    display: none !important;
}

body > .skiptranslate {
    display: none !important;
}

#goog-gt-tt {
    display: none !important;
}

.goog-te-balloon-frame {
    display: none !important;
}

/* 3. Ẩn thanh notification "Được dịch sang: Anh" */
iframe.goog-te-banner-frame {
    display: none !important;
}

/* 4. Fix body top khi Google Translate thêm padding */
body {
    top: 0px !important;
    position: static !important;
}

/* 5. Ẩn hoàn toàn Google Translate widget mặc định */
#google_translate_element {
    display: none !important;
    visibility: hidden !important;
}

.goog-te-gadget {
    display: none !important;
}

.goog-te-gadget-simple {
    display: none !important;
}

/* 6. Container cho language switcher */
.nav-item-translation {
    display: inline-block !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* 7. Style cho các link ngôn ngữ - ĐỒNG BỘ VỚI MENU ITEMS */
.lang-link {
    color: #333 !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    letter-spacing: 2px !important;
    text-decoration: none !important;
    padding: 20px 8px !important;
    display: inline-block !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    position: relative !important;
}

.lang-link:hover {
    color: #007bff !important;
}

/* 8. Active state - ngôn ngữ đang được chọn */
.lang-link.active {
    color: #007bff !important;
    font-weight: 600 !important;
}

/* 9. Dấu phân cách giữa VN và EN */
.lang-separator {
    color: #999 !important;
    font-size: 11px !important;
    padding: 0 5px !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

/* 10. Loading overlay - smooth transition */
#lang-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    z-index: 999999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lang-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.lang-loading-text {
    margin-top: 20px;
    font-size: 16px;
    color: #333;
    font-weight: 500;
    letter-spacing: 1px;
}

/* 11. Disable clicks during loading */
body.lang-switching {
    pointer-events: none;
    user-select: none;
}

/* 12. Responsive - mobile */
@media (max-width: 767px) {
    .lang-link {
        padding: 15px 6px !important;
        font-size: 10px !important;
    }
    
    .lang-separator {
        padding: 0 3px !important;
    }
    
    .lang-link.active::after {
        bottom: 10px;
    }
    
    .lang-loading-spinner {
        width: 40px;
        height: 40px;
    }
    
    .lang-loading-text {
        font-size: 14px;
    }
}

/* 13. Smooth page transition effect */
html.lang-transition {
    animation: fadeOut 0.2s ease;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0.8; }
}
