/* Google Translate Custom Styling */
.custom-translate {
    /* margin-left: 15px; */
    position: relative;
}

/* Custom Language Selector */
.language-selector {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.current-lang img{
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin-right: 6px;
}

.language-select {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 25px;
  background: rgba(0,0,0,0.04);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}
.language-select:hover {
  background: rgba(0,0,0,0.08);
}

.language-select img {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}


/* Ensure dropdown is hidden by default */
#language_dropdown {
    display: none !important;
    visibility: hidden !important;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#language_dropdown.show {
    display: grid !important;
    visibility: visible !important;
    opacity: 1;
    transform: translateY(0);
}

.current-lang {
  display: flex;
  gap: 3px;
  width: 95px;
  padding: 15px 0px;
  border-radius: 25px;
  /* background: rgba(0,0,0,0.04); */
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  align-items: center;
  justify-content: center;
}

/* .current-lang:hover {
  background: rgba(0,0,0,0.08);
  border-color: #D71921;
  box-shadow: 0 0 8px rgba(215, 25, 33, 0.25);
  transform: translateY(-1px);
} */

.language-dropdown {
    position: absolute !important;
    top: 100% !important;
    left: auto !important;
    right: -50px !important;
    background: #fff !important;
    border: 1px solid #e9ecef !important;
    border-radius: 16px !important;
    box-shadow: 0 18px 40px rgba(22, 28, 45, 0.2) !important;
    z-index: 9999 !important;
    width: 850px !important;
    max-width: 850px;
    padding: 18px !important;
    margin-top: 8px !important;
    opacity: 0;
    transform: translateY(-12px);
    transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    display: none !important;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    column-gap: 14px;
    row-gap: 12px;
    overflow: visible !important;
}



.language-dropdown.show {
    display: grid !important;
    opacity: 1;
    transform: translateY(0);
}

.lang-item {
    padding: 10px 12px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #334155 !important;
    border: 1px solid transparent !important;
    border-radius: 14px !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    position: relative !important;
    display: block !important;
    background: #f9fafc !important;
    margin: 0 !important;
    list-style: none !important;
    width: 100px;
}

.lang-item:hover {
  background-color: #ffeef0 !important; /* light red background */
  color: #d71921 !important;
  transform: translateY(-2px);
  box-shadow: 0 12px 22px rgba(215, 25, 33, 0.18) !important;
  border-color: rgba(215, 25, 33, 0.35) !important;
}

.lang-item.selected {
  background-color: #d71921 !important;
  color: #fff !important;
  border-color: #d71921 !important;
}


/* .lang-item.selected::after {
    content: "✓";
    margin-left: auto;
    font-weight: bold;
    font-size: 14px;
} */

.current-lang .lang-arrow {
    display: inline-block;
    transition: transform 0.3s;
    vertical-align: middle;
    margin-left: 6px;
}
.language-dropdown.show ~ .current-lang .lang-arrow,
.current-lang.active .lang-arrow {
    transform: rotate(180deg);
}
.language-dropdown.show + .current-lang .lang-arrow {
    transform: rotate(180deg);
}

.custom-translate .goog-te-gadget {
    font-family: inherit !important;
    font-size: 14px !important;
}

.custom-translate .goog-te-gadget-simple {
    background: #f8f9fa !important;
    border: 2px solid #e9ecef !important;
    border-radius: 8px !important;
    padding: 8px 10px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #495057 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    width: 150px !important;
    text-align: center !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

.custom-translate .goog-te-gadget-simple:hover {
    border-color: #D71921 !important;
    color: #D71921 !important;
    background: #fff !important;
    box-shadow: 0 4px 8px rgba(215, 25, 33, 0.2) !important;
    transform: translateY(-1px) !important;
}

.custom-translate .goog-te-gadget-simple .goog-te-menu-value {
    color: inherit !important;
    font-weight: 500 !important;
}

.custom-translate .goog-te-gadget-simple .goog-te-menu-value span:first-child {
    color: inherit !important;
}

.custom-translate .goog-te-gadget-simple .goog-te-menu-value span:last-child {
    color: inherit !important;
    margin-left: 5px !important;
}

/* Hide "Powered by Google" */
.goog-te-gadget .goog-te-combo {
    margin: 0 !important;
}

.goog-te-banner-frame.skiptranslate {
    display: none !important;
}

body {
    top: 0 !important;
}

/* Hide the Google Translate branding */
.goog-te-gadget-icon {
    display: none !important;
}

/* Hide Google Translate bar and elements */
.goog-te-banner-frame,
.goog-te-banner-frame.skiptranslate,
.goog-te-gadget,
.goog-te-gadget-simple,
.goog-te-combo,
.goog-te-menu-frame,
.VIpgJd-ZVi9od-xl07Ob-OEVmcd,
.goog-te-banner,
.goog-te-ftab,
.goog-te-ftab-link {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Hide Google Translate iframe */
iframe[src*="translate.google.com"],
iframe[src*="translate.googleapis.com"] {
    display: none !important;
    visibility: hidden !important;
}

/* Ensure body doesn't get shifted by Google Translate */
body {
    top: 0 !important;
    position: static !important;
}

/* Prevent Google Translate from translating our language selector */
.notranslate {
    -webkit-transform: none !important;
    -moz-transform: none !important;
    -o-transform: none !important;
    -ms-transform: none !important;
    transform: none !important;
}

/* Ensure only one language item is selected at a time */
.lang-item::after {
    display: none !important;
}

.custom-translate .goog-te-gadget-simple .goog-te-menu-value:before {
    content: "🌐 " !important;
    font-size: 16px !important;
}

/* Dropdown styling */
.goog-te-menu2 {
    border-radius: 12px !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
    border: 1px solid #e9ecef !important;
    background: #fff !important;
    max-height: 300px !important;
    max-width: 50px !important;
    overflow-y: auto !important;
    z-index: 9999 !important;
    animation: dropdownSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    margin-top: 8px !important;
    padding: 8px 0 !important;
}

@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.goog-te-menu2-item {
    padding: 12px 16px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #495057 !important;
    border-bottom: 1px solid #f8f9fa !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
}

.goog-te-menu2-item:hover {
    background-color: #f8f9fa !important;
    color: #D71921 !important;
    transform: translateX(2px) !important;
    box-shadow: 0 2px 8px rgba(215, 25, 33, 0.1) !important;
}

/* Style the language text */
.goog-te-menu2-item span {
    color: inherit !important;
    font-weight: inherit !important;
    transition: all 0.2s ease !important;
}

/* Style the arrow symbol */
.goog-te-menu2-item::before {
    content: "→" !important;
    color: #D71921 !important;
    font-weight: bold !important;
    margin-right: 8px !important;
    font-size: 12px !important;
    transition: all 0.2s ease !important;
}

.goog-te-menu2-item:hover::before {
    color: #D71921 !important;
    transform: translateX(2px) !important;
}

.goog-te-menu2-item:last-child {
    border-bottom: none !important;
    border-radius: 0 0 16px 16px !important;
}

.goog-te-menu2-item:first-child {
    border-radius: 16px 16px 0 0 !important;
}

/* Selected language styling */
.goog-te-menu2-item.goog-te-menu2-item-selected {
    background-color: #D71921 !important;
    color: #fff !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 8px rgba(215, 25, 33, 0.3) !important;
}

.goog-te-menu2-item.goog-te-menu2-item-selected::before {
    content: "✓" !important;
    color: #fff !important;
    font-weight: bold !important;
    margin-right: 8px !important;
    font-size: 14px !important;
}

/* Add subtle animation for better UX */
.goog-te-menu2-item {
    animation: fadeInUp 0.3s ease-out !important;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar styling for dropdown */
.goog-te-menu2::-webkit-scrollbar {
    width: 8px !important;
}

.goog-te-menu2::-webkit-scrollbar-track {
    background: rgba(248, 249, 250, 0.5) !important;
    border-radius: 4px !important;
    margin: 8px 0 !important;
}

.goog-te-menu2::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #D71921 0%, #ff6b6b 100%) !important;
    border-radius: 4px !important;
    border: 2px solid transparent !important;
    background-clip: content-box !important;
}

.goog-te-menu2::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #b91c1c 0%, #e53e3e 100%) !important;
    background-clip: content-box !important;
}

.custom-translate .goog-te-gadget-simple .goog-te-menu-value:before {
    content: "🌐 " !important;
    font-size: 16px !important;
}

/* Google Translate iframe styling */
.VIpgJd-ZVi9od-xl07Ob-OEVmcd {
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
    background: transparent !important;
    z-index: 9999 !important;
    position: fixed !important;
    animation: dropdownSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    visibility: visible !important;
    display: block !important;
    width: 250px !important;
    height: 300px !important;
    filter: hue-rotate(0deg) !important;
}

/* Force override Google's default colors using CSS filters and overlays */
.VIpgJd-ZVi9od-xl07Ob-OEVmcd iframe {
    border: none !important;
    border-radius: 12px !important;
    background: #fff !important;
    filter: hue-rotate(0deg) saturate(1.2) !important;
}

/* Try to override with more specific selectors */
body .VIpgJd-ZVi9od-xl07Ob-OEVmcd,
html .VIpgJd-ZVi9od-xl07Ob-OEVmcd {
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
    background: transparent !important;
    z-index: 9999 !important;
    position: fixed !important;
    animation: dropdownSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    visibility: visible !important;
    display: block !important;
    width: 250px !important;
    height: 300px !important;
}

/* Ensure the iframe content is properly styled */
.VIpgJd-ZVi9od-xl07Ob-OEVmcd iframe {
    border: none !important;
    border-radius: 12px !important;
    background: #fff !important;
}

/* Override Google's default iframe styling */
.goog-te-menu-frame {
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
    background: #fff !important;
    z-index: 9999 !important;
}

/* Style the iframe body content */
body .goog-te-menu-frame {
    border: none !important;
    border-radius: 12px !important;
    background: #fff !important;
}

/* Additional iframe container styling */
.goog-te-menu-frame .goog-te-menu2 {
    border-radius: 12px !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
    border: 1px solid #e9ecef !important;
    background: #fff !important;
    max-height: 300px !important;
    overflow-y: auto !important;
    z-index: 9999 !important;
    animation: dropdownSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    margin-top: 8px !important;
    padding: 8px 0 !important;
}

/* Override Google's default dropdown styling */
.goog-te-menu-frame {
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
    background: #fff !important;
    z-index: 9999 !important;
    font-family: inherit !important;
}

/* Style the dropdown header */
.goog-te-menu-frame .goog-te-menu2 .goog-te-menu2-item:first-child {
    background: #f8f9fa !important;
    color: #495057 !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    padding: 16px !important;
    border-bottom: 2px solid #e9ecef !important;
    border-radius: 12px 12px 0 0 !important;
    text-align: center !important;
}

/* Hide the default "Select Language" text and replace with custom styling */
.goog-te-menu-frame .goog-te-menu2 .goog-te-menu2-item:first-child::before {
    content: "🌐 Select Language" !important;
    color: #D71921 !important;
    font-weight: 600 !important;
}

/* Style the language options */
.goog-te-menu-frame .goog-te-menu2 .goog-te-menu2-item:not(:first-child) {
    padding: 12px 16px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #495057 !important;
    border-bottom: 1px solid #f8f9fa !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    background: #fff !important;
}

.goog-te-menu-frame .goog-te-menu2 .goog-te-menu2-item:not(:first-child):hover {
    background-color: #f8f9fa !important;
    color: #D71921 !important;
    transform: translateX(2px) !important;
    box-shadow: 0 2px 8px rgba(215, 25, 33, 0.1) !important;
}

/* Style the arrow symbols for language options */
.goog-te-menu-frame .goog-te-menu2 .goog-te-menu2-item:not(:first-child)::before {
    content: "→" !important;
    color: #D71921 !important;
    font-weight: bold !important;
    margin-right: 8px !important;
    font-size: 12px !important;
    transition: all 0.2s ease !important;
}

.goog-te-menu-frame .goog-te-menu2 .goog-te-menu2-item:not(:first-child):hover::before {
    color: #D71921 !important;
    transform: translateX(2px) !important;
}

/* Selected language styling */
.goog-te-menu-frame .goog-te-menu2 .goog-te-menu2-item.goog-te-menu2-item-selected {
    background-color: #D71921 !important;
    color: #fff !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 8px rgba(215, 25, 33, 0.3) !important;
}

.goog-te-menu-frame .goog-te-menu2 .goog-te-menu2-item.goog-te-menu2-item-selected::before {
    content: "✓" !important;
    color: #fff !important;
    font-weight: bold !important;
    margin-right: 8px !important;
    font-size: 14px !important;
}

/* Override Google's default text styling */
.goog-te-menu-frame .goog-te-menu2 .goog-te-menu2-item span {
    color: inherit !important;
    font-weight: inherit !important;
    transition: all 0.2s ease !important;
}

/* Ensure proper spacing and layout */
.goog-te-menu-frame .goog-te-menu2 {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 300px !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .custom-translate {
        margin-left: 0;
        margin-top: 10px;
        width: 180px;
    }
    
    .custom-translate .goog-te-gadget-simple {
        width: 180px;
        text-align: center;
        min-width: auto !important;
    }
    
    .goog-te-menu2 {
        width: 70px !important;
        max-width: 90px !important;
    }
    
    .VIpgJd-ZVi9od-xl07Ob-OEVmcd {
        width: 200px !important;
        height: 250px !important;
    }

    /* Mobile: make the custom language dropdown taller, scrollable, and 2 columns */
    .language-dropdown {
        min-height: 250px !important;
        max-height: 250px !important;
        overflow-y: auto !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        width: 270px !important;
        max-width: 380px !important;
        padding: 12px !important;
        top: 40px !important;
    }

    /* Ensure lang items size nicely on mobile */
    .language-dropdown .lang-item {
        width: auto !important;
        padding: 10px 8px !important;
        font-size: 14px !important;
    }
}

@media (max-width: 992px) {
    .language-dropdown {
        left: 0 !important;
    }
}