/**
 * Google Translator Styles
 * Extracted from translator.php for better maintainability
 */

/* Aggressive hiding of Google Translate elements */
.goog-te-banner-frame,
.goog-te-banner-frame.skiptranslate,
.goog-te-gadget,
.goog-te-gadget-simple,
.goog-te-balloon-frame,
.goog-te-ftab,
#goog-gt-tt,
.goog-tooltip,
.skiptranslate,
iframe[src*="translate.google"],
iframe[src*="translate.googleapis.com"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
}

body {
    top: 0 !important;
    position: static !important;
}

body.goog-te-compat-mode {
    top: 0 !important;
    position: static !important;
}

.goog-te-menu-value {
    display: none !important;
}

.goog-te-combo {
    visibility: hidden !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Hide any translate header that shows "Translated into: Language" */
body > .skiptranslate {
    display: none !important;
}

/* Additional hiding for translate header */
#google_translate_element_global .goog-te-gadget {
    display: none !important;
}

#google_translate_element_global .goog-te-gadget-simple {
    display: none !important;
}

/* Custom dropdown styling - Dark Theme for Header */
.translate-wrapper {
    position: relative;
    display: inline-block;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    z-index: 1000;
}

.custom-translate-dropdown {
    position: relative;
    min-width: 140px;
}

.translate-selected {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    color: #fff;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.translate-selected:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.flag-icon {
    width: 20px;
    height: 15px;
    margin-right: 8px;
    border-radius: 3px;
    object-fit: cover;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.dropdown-arrow {
    margin-left: auto;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    transition: transform 0.3s ease;
}

#current-lang {
    font-size: 13px;
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.translate-options {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 280px;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 999999;
    overflow: hidden;
    backdrop-filter: blur(20px);
}

.search-container {
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.language-search {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 6px;
    font-size: 13px;
    box-sizing: border-box;
    outline: none !important;
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    transition: border-color 0.2s ease;
}

.language-search::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
}

.language-search:focus {
    border-color: rgba(66, 133, 244, 0.8) !important;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.3) !important;
    background: rgba(255, 255, 255, 0.15) !important;
}

.options-list {
    max-height: 240px;
    overflow-y: auto;
    padding: 4px 0;
}

.translate-option {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    color: #fff;
}

.translate-option:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.translate-option .flag-icon {
    margin-right: 10px;
    width: 18px;
    height: 14px;
}

.translate-option span {
    font-size: 13px;
    color: #fff;
    font-weight: 500;
}

/* Scrollbar styling - Dark Theme */
.options-list::-webkit-scrollbar {
    width: 6px;
}

.options-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.options-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.options-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* No results message styling */
.no-results {
    padding: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    font-style: italic;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .translate-wrapper {
        position: relative;
        display: block !important;
        width: auto;
        z-index: 1001;
    }

    .custom-translate-dropdown {
        min-width: 120px;
        width: auto;
        max-width: 160px;
        display: block;
    }

    .translate-selected {
        padding: 6px 10px;
        font-size: 12px;
        display: flex !important;
        align-items: center;
    }

    .flag-icon {
        width: 16px;
        height: 12px;
        margin-right: 6px;
    }

    #current-lang {
        font-size: 12px;
    }

    .dropdown-arrow {
        font-size: 10px;
    }

    .translate-options {
        position: fixed;
        top: auto;
        bottom: 20px;
        left: 20px;
        right: 20px;
        min-width: auto;
        max-height: 60vh;
        border-radius: 16px;
        z-index: 999999;
    }

    .search-container {
        padding: 16px;
    }

    .language-search {
        padding: 10px 12px;
        font-size: 14px;
    }

    .options-list {
        max-height: 40vh;
    }

    .translate-option {
        padding: 12px 16px;
    }

    .translate-option .flag-icon {
        width: 20px;
        height: 15px;
    }

    .translate-option span {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .custom-translate-dropdown {
        min-width: 100px;
        max-width: 140px;
    }

    .translate-selected {
        padding: 5px 8px;
    }

    #current-lang {
        font-size: 11px;
    }
}
