/* ==========================================================================
   NOVA VERTEX ASSETS — RESPONSIVE GOOGLE TRANSLATOR
   High-performance, elegant, and fully responsive multi-language switcher.
   ========================================================================== */

/* --- 1. Google Translate Core Resets (Eliminates banner shift & iframe artifacts) --- */
body {
    top: 0px !important;
    position: static !important;
}

.goog-te-banner-frame.skiptranslate,
.goog-te-banner-frame,
iframe.goog-te-banner-frame,
iframe[name="goog-te-banner-frame"],
#goog-gt-tt,
.goog-te-balloon-frame {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0px !important;
    width: 0px !important;
    border: none !important;
    box-shadow: none !important;
    pointer-events: none !important;
}

body > .skiptranslate:first-child {
    display: none !important;
    visibility: hidden !important;
    height: 0px !important;
    font-size: 0px !important;
}

.goog-text-highlight {
    background-color: transparent !important;
    box-shadow: none !important;
    border: none !important;
    outline: none !important;
}

#google_translate_element {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
}

/* --- 2. Desktop Header Top Translator --- */
.nva-translator-desktop {
    position: relative;
    display: inline-block;
    vertical-align: middle;
}

.nva-translator-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Work Sans', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    line-height: 1.4;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
}

.nva-translator-btn:hover,
.nva-translator-btn:focus,
.nva-translator-desktop.active .nva-translator-btn {
    background: rgba(44, 114, 79, 0.35);
    border-color: #c49a2e;
    color: #f2d87e;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.nva-translator-btn .ti-world {
    font-size: 13px;
    color: #c49a2e;
}

.nva-translator-btn .nva-current-flag {
    font-size: 15px;
    line-height: 1;
}

.nva-translator-btn .nva-current-name {
    font-size: 13px;
    font-weight: 500;
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nva-translator-btn .nva-caret {
    font-size: 10px;
    transition: transform 0.3s ease;
    opacity: 0.8;
}

.nva-translator-desktop.active .nva-caret {
    transform: rotate(180deg);
}

/* --- 3. Unified Dropdown Panel --- */
.nva-translator-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    background: #0d1e16;
    border: 1px solid rgba(44, 114, 79, 0.45);
    border-radius: 10px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(196, 154, 46, 0.2);
    z-index: 10000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px) scale(0.98);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.nva-translator-desktop.active .nva-translator-dropdown,
.nva-floating-translator.active .nva-translator-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.nva-trans-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
}

.nva-trans-title {
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Work Sans', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nva-trans-title .ti-world {
    color: #c49a2e;
}

.nva-trans-reset {
    background: transparent;
    border: 1px solid rgba(196, 154, 46, 0.4);
    color: #f0c952;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nva-trans-reset:hover {
    background: #c49a2e;
    color: #0e2b1f;
}

.nva-trans-search-box {
    position: relative;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.15);
}

.nva-trans-search-box .ti-search {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    color: #8da496;
    font-size: 12px;
    pointer-events: none;
}

.nva-trans-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 8px 12px 8px 32px;
    color: #ffffff;
    font-size: 12.5px;
    font-family: 'Work Sans', sans-serif;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.nva-trans-search-input:focus {
    border-color: #2c724f;
    background: rgba(255, 255, 255, 0.1);
}

.nva-trans-search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.nva-trans-list {
    max-height: 270px;
    overflow-y: auto;
    padding: 6px 0;
    margin: 0;
    list-style: none;
}

/* Custom Scrollbar for Language List */
.nva-trans-list::-webkit-scrollbar {
    width: 6px;
}
.nva-trans-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.15);
}
.nva-trans-list::-webkit-scrollbar-thumb {
    background: #2c724f;
    border-radius: 3px;
}
.nva-trans-list::-webkit-scrollbar-thumb:hover {
    background: #c49a2e;
}

.nva-trans-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nva-trans-item:hover {
    background: rgba(44, 114, 79, 0.3);
    border-left-color: #2c724f;
}

.nva-trans-item.active {
    background: rgba(44, 114, 79, 0.45);
    border-left-color: #c49a2e;
}

.nva-trans-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nva-trans-item-flag {
    font-size: 16px;
    line-height: 1;
}

.nva-trans-item-names {
    display: flex;
    flex-direction: column;
}

.nva-trans-item-name {
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.25;
}

.nva-trans-item-native {
    color: #8ea598;
    font-size: 11px;
    line-height: 1.2;
}

.nva-trans-item.active .nva-trans-item-name {
    color: #f2d87e;
    font-weight: 600;
}

.nva-trans-item-check {
    color: #c49a2e;
    font-weight: 700;
    font-size: 14px;
    display: none;
}

.nva-trans-item.active .nva-trans-item-check {
    display: inline-block;
}

.nva-trans-no-results {
    padding: 20px 16px;
    text-align: center;
    color: #8ea598;
    font-size: 12.5px;
    display: none;
}

.nva-trans-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 16px;
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
}

.nva-trans-footer a {
    color: #8ea598;
    text-decoration: none;
    transition: color 0.2s;
}

.nva-trans-footer a:hover {
    color: #f0c952;
}

/* --- 4. Navbar Compact Language Button (Mobile & Tablet) --- */
.nva-nav-lang-btn {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 40px;
    padding: 0 12px;
    background: rgba(44, 114, 79, 0.12);
    border: 1px solid rgba(44, 114, 79, 0.35);
    border-radius: 4px;
    color: #2c724f;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Work Sans', sans-serif;
    cursor: pointer;
    margin-right: 12px;
    transition: all 0.3s ease;
}

.nva-nav-lang-btn:hover {
    background: #2c724f;
    color: #ffffff;
    border-color: #2c724f;
}

.nva-nav-lang-btn .ti-world {
    font-size: 14px;
}

.nva-nav-lang-code {
    font-size: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* --- 5. Mobile Drawer Translator Box --- */
.mobile-translator-box {
    position: relative;
    padding: 16px 20px 20px;
    border-bottom: 1px solid #e1e9e4;
    margin-bottom: 15px;
    background: #f4f8f6;
    border-radius: 6px;
    margin-left: 15px;
    margin-right: 15px;
}

.mobile-trans-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.mobile-trans-label {
    color: #2c724f;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mobile-trans-label .ti-world {
    color: #c49a2e;
    font-size: 13px;
}

.mobile-trans-current {
    color: #111111;
    font-size: 12.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mobile-trans-quick-pills {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.mobile-trans-pill {
    background: #ffffff;
    border: 1.5px solid #d0ddd5;
    color: #153324;
    padding: 8px 4px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.mobile-trans-pill:hover {
    background: #2c724f;
    border-color: #2c724f;
    color: #ffffff;
}

.mobile-trans-pill.active {
    background: #2c724f;
    border-color: #c49a2e;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 3px 8px rgba(44, 114, 79, 0.3);
}

.mobile-trans-open-all-btn {
    width: 100%;
    background: #ffffff;
    border: 1.5px solid #2c724f;
    color: #2c724f;
    padding: 10px 14px;
    border-radius: 5px;
    font-size: 12.5px;
    font-weight: 700;
    font-family: 'Work Sans', sans-serif;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px rgba(44, 114, 79, 0.08);
}

.mobile-trans-open-all-btn:hover {
    background: #2c724f;
    color: #ffffff;
}

/* --- 6. Floating Bottom-Left Translator Badge --- */
.nva-floating-translator {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 10002; /* Must be above backdrop (9998) and dropdown (10000) */
    font-family: 'Work Sans', sans-serif;
}

.nva-floating-btn {
    background: rgba(14, 43, 31, 0.94);
    border: 1.5px solid rgba(196, 154, 46, 0.6);
    color: #ffffff;
    padding: 9px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35), 0 0 14px rgba(44, 114, 79, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
}

.nva-floating-btn:hover,
.nva-floating-btn:focus,
.nva-floating-translator.active .nva-floating-btn {
    background: #0e2b1f;
    border-color: #f2d87e;
    color: #f2d87e;
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 18px rgba(196, 154, 46, 0.4);
}

.nva-floating-btn .ti-world {
    font-size: 14px;
    color: #c49a2e;
}

.nva-floating-btn .nva-floating-flag {
    font-size: 15px;
    line-height: 1;
}

.nva-floating-btn .nva-floating-code {
    font-size: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.nva-floating-btn .nva-caret {
    font-size: 10px;
    transition: transform 0.3s ease;
    opacity: 0.8;
}

.nva-floating-translator.active .nva-caret {
    transform: rotate(180deg);
}

.nva-floating-translator .nva-translator-dropdown {
    top: auto;
    bottom: calc(100% + 12px);
    left: 0;
    right: auto;
}

/* --- 7. Modal Overlay / Full Screen on Small Mobile --- */
.nva-trans-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9998; /* Below the floating translator (10002) so widget stays sharp & clickable */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s;
    /* No backdrop-filter here — blurring a stacking-context ancestor corrupts child rendering */
}

.nva-trans-modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* --- 8. Responsive Breakpoints --- */
@media (max-width: 991px) {
    .nva-nav-lang-btn {
        display: inline-flex;
    }
}

@media (max-width: 767px) {
    .main-header .header-top .nva-translator-desktop {
        margin-top: 6px;
    }
    
    .nva-floating-translator {
        bottom: 18px;
        left: 18px;
    }

    .nva-floating-btn {
        padding: 8px 13px;
        font-size: 12px;
    }

    .nva-translator-dropdown {
        width: 290px;
    }

    .nva-floating-translator .nva-translator-dropdown {
        left: 0;
        width: min(320px, calc(100vw - 36px));
    }
}

@media (max-width: 480px) {
    .nva-floating-btn span.nva-floating-text {
        display: none;
    }
    
    .nva-floating-btn {
        padding: 8px 10px;
        gap: 5px;
    }
}

/* --- 9. Auto-Detection Language Notification Toast --- */
.nva-auto-detect-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #0d1e16;
    border: 1px solid rgba(196, 154, 46, 0.55);
    border-radius: 12px;
    padding: 12px 16px;
    color: #ffffff;
    font-family: 'Work Sans', sans-serif;
    font-size: 13px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(44, 114, 79, 0.4);
    z-index: 10003;
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: 440px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(18px);
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s;
    pointer-events: none;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.nva-auto-detect-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.nva-toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.4;
}

.nva-toast-flag {
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
}

.nva-toast-text {
    color: #e5ece8;
    font-size: 12.5px;
}

.nva-toast-text strong {
    color: #f2d87e;
    font-weight: 600;
}

.nva-toast-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.nva-toast-btn-revert {
    background: rgba(196, 154, 46, 0.15);
    border: 1px solid rgba(196, 154, 46, 0.6);
    color: #f0c952;
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nva-toast-btn-revert:hover {
    background: #c49a2e;
    color: #0e2b1f;
}

.nva-toast-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.nva-toast-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 767px) {
    .nva-auto-detect-toast {
        left: 16px;
        right: 16px;
        bottom: 80px; /* Sits cleanly above the floating translator button */
        max-width: none;
        padding: 10px 12px;
        gap: 10px;
    }
    .nva-toast-text {
        font-size: 11.5px;
    }
}
