/* --- HIDE GOOGLE'S "POWERED BY" --- */
.goog-logo-link {
  display: none !important;
}

.goog-te-gadget {
  /* CHANGED: Make it inline-block so it shrinks to fit content */
  display: inline-block;
  width: auto;
  /* Allow it to shrink */
  vertical-align: middle;
}

/* --- UPDATED: Dark Theme Google Dropdown --- */
.goog-te-gadget .goog-te-combo {
  /* REMOVED width: 100% */
  padding: 10px 40px 10px 20px;
  /* Add padding for size: top/bottom, right (for arrow), left */
  border-radius: 4px;
  border: 1px solid #555;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
  background-color: #3a3a3a;
  font-size: 1rem;
  color: #f0f0f0;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  /* REMOVED text-align: center (now handled by flex) */
  background-image: url('data:image/svg+xml;utf8,<svg fill="%23f0f0f0" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 18px;
  cursor: pointer;
}

/* Fix for Google's icon and text alignment */
.goog-te-gadget-simple {
  /* CHANGED: Make it inline-flex to shrink */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  /* Allow it to shrink */
  padding: 10px 20px;
  /* Symmetrical padding */
  border-radius: 4px;
  border: 1px solid #555;
  background-color: #3a3a3a;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  gap: 8px;
  /* Space between icon and text */
}

.goog-te-gadget-simple .goog-te-menu-value {
  color: #f0f0f0;
  /* Light text */
  white-space: nowrap;
  /* Prevent "Select Language" from wrapping */
}

.goog-te-gadget-simple .goog-te-gadget-icon {
  background-image: url('https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_18_1x.png') !important;
  background-size: 16px 16px !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  width: 16px;
  height: 16px;
}

/* Hide the default <select> if Google enhances it */
.goog-te-gadget-simple+.goog-te-combo {
  display: none;
}


/* --- TRIGGER BUTTON STYLE --- */
.language-switcher-button {
  background-color: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.language-switcher-button:hover {
  background-color: rgba(255, 255, 255, 0.1);
  /* Light hover for dark theme */
}

.language-switcher-icon {
  width: 24px;
  height: 24px;
  stroke: #f0f0f0;
  /* Light icon color */
}

/* --- UPDATED: Dark Theme MODAL STYLES --- */
.language-switcher-modal {
  display: none;
  /* Hidden by default */
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.language-switcher-modal.is-open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.language-switcher-modal-backdrop {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  /* Darker backdrop */
}

.language-switcher-modal-content {
  position: relative;
  z-index: 2;
  background-color: #2d2d2d;
  /* Dark modal background */
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  width: 90%;
  max-width: 320px;
  animation: modal-fade-in 0.3s ease-out;
  color: #f0f0f0;
  /* Light text */
  font-family: Arial, sans-serif;
}

.language-switcher-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #444;
  /* Darker border */
}

.language-switcher-modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  color: #f5f5f5;
  /* Light title */
}

/* --- UPDATED: Modal Body with Flexbox --- */
.language-switcher-modal-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* --- Position the Google Translate Element --- */
#google_translate_element {
  order: 1;
  /* Ensure it comes first in flex order */
  /* --- NEW: Center the gadget --- */
  text-align: center;
}

/* --- UPDATED: "Switch to English" Link Styles --- */
.switch-to-english-wrapper {
  order: 2;
  /* Ensure it comes second */
  padding-top: 16px;
  border-top: 1px solid #444;
  /* Darker separator */
  text-align: center;
}

.switch-to-english-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: #aaa;
  /* Light gray text */
  text-decoration: none;
  transition: color 0.2s ease;
}

.switch-to-english-link:hover {
  text-decoration: underline;
  color: #fff;
  /* White hover */
}

/* --- UPDATED STYLES FOR THE CLOSE <a> 'X' --- */
.language-switcher-close {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  opacity: 0.6;
  /* Slightly more visible on dark */
  transition: opacity 0.2s;
  text-decoration: none;
}

.language-switcher-close:hover {
  opacity: 1;
}

.language-switcher-close span {
  font-family: Arial, sans-serif;
  font-size: 28px;
  font-weight: 300;
  color: #ccc;
  /* Light 'X' */
  line-height: 1;
  display: block;
}

@keyframes modal-fade-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}
