/* Senior-friendly translate container - matching your UI system */
.gini-translate-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 10000;
  background: #ffffff;
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(47,46,177,0.15), 0 1px 3px rgba(0,0,0,0.1);
  border: 1px solid rgba(47,46,177,0.1);
  min-width: 300px;
  max-width: 340px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
}

/* Hide translate widget by default - now shown via header link */
.gini-translate-container {
  display: none !important;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Show translate widget when explicitly triggered */
.gini-translate-container.show-widget {
  display: block !important;
  opacity: 1;
  transform: translateY(0);
}

/* Hide translate widget on chat pages to avoid UI interference */
body[data-route="/chat"] .gini-translate-container,
body[data-route="/public-chat"] .gini-translate-container,
body[data-route="/public-voice-chat"] .gini-translate-container {
  display: none !important;
}

.gini-translate-container:hover {
  box-shadow: 0 8px 32px rgba(47,46,177,0.2), 0 4px 8px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.gini-translate-header {
  margin-bottom: 20px;
  text-align: center;
}

.gini-translate-title {
  font-size: 20px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.gini-translate-subtitle {
  font-size: 14px;
  color: #6b7280;
  margin: 0 0 16px 0;
  line-height: 1.6;
  font-weight: 400;
}

/* Style Google Translate element - clean and functional */
#google_translate_element {
  margin: 16px 0;
  text-align: left;
}

/* Style the Google Translate dropdown to match your design */
#google_translate_element select,
.goog-te-combo {
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 500;
  color: #374151;
  width: 100%;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

#google_translate_element select:hover,
.goog-te-combo:hover {
  border-color: #2F2EB1;
  background: #F1F0FB;
  box-shadow: 0 2px 4px rgba(47,46,177,0.1);
}

#google_translate_element select:focus,
.goog-te-combo:focus {
  outline: none;
  border-color: #2F2EB1;
  box-shadow: 0 0 0 3px rgba(47,46,177,0.1);
  background: #ffffff;
}

/* Clean up Google Translate branding but keep functional */
.goog-logo-link {
  display: none !important;
}

/* Style the gadget container */
.goog-te-gadget {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-size: 14px !important;
  color: #6b7280 !important;
}

.goog-te-gadget .goog-te-combo {
  margin: 0 !important;
}

/* Hide Google Translate banner and other elements */
.goog-te-banner-frame {
  display: none !important;
}

.goog-te-balloon-frame {
  display: none !important;
}

/* Hide "Powered by" text */
.goog-te-gadget .goog-te-combo + * {
  display: none !important;
}

/* Clean up any remaining Google elements */
#google_translate_element .skiptranslate {
  font-size: 0 !important;
  color: transparent !important;
}

#google_translate_element .goog-te-gadget-icon {
  display: none !important;
}

/* Style the dropdown container */
#google_translate_element > div {
  border: none !important;
  background: transparent !important;
}

/* Ensure dropdown blends with design */
.goog-te-combo option {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-size: 14px !important;
  padding: 8px !important;
}

/* Help text for older adults - matching your UI typography */
.gini-translate-help {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
  font-size: 14px;
  color: #6b7280;
  line-height: 1.5;
}

.gini-translate-help-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
  font-weight: 400;
}

/* Larger text for translated content */
.translated-ltr {
  font-size: 18px !important;
  line-height: 1.6 !important;
  letter-spacing: 0.3px !important;
}

/* Mobile responsiveness - better mobile experience */
@media (max-width: 768px) {
  .gini-translate-container {
    bottom: 16px;
    left: 16px;
    right: 16px;
    min-width: auto;
    max-width: none;
    padding: 16px;
  }

  .gini-translate-container.minimized {
    left: 16px;
    right: auto;
    width: auto;
    min-width: 140px;
  }

  .gini-translate-title {
    font-size: 18px;
  }

  .gini-translate-toggle {
    padding: 10px 16px;
    font-size: 14px;
    min-height: 44px;
  }

  .gini-language-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .gini-language-card {
    padding: 8px;
    min-height: 60px;
  }

  .gini-language-flag {
    font-size: 20px;
    margin-bottom: 2px;
  }

  .gini-language-name {
    font-size: 12px;
  }

  .gini-language-native {
    font-size: 10px;
  }
}

/* Larger container for desktop to accommodate cards */
@media (min-width: 769px) {
  .gini-translate-container {
    min-width: 360px;
    max-width: 380px;
  }
}

/* Subtle floating animation - more refined */
.gini-translate-container {
  animation: gentleFloat 4s ease-in-out infinite;
}

@keyframes gentleFloat {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-3px);
  }
}

.gini-translate-container:hover {
  animation-play-state: paused;
}

/* Enhanced glass morphism effect */
@supports (backdrop-filter: blur(10px)) {
  .gini-translate-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
  }
}

/* Close button - matching your UI button patterns */
.gini-translate-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(107, 114, 128, 0.1);
  border: none;
  font-size: 16px;
  color: #6b7280;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.2s ease;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gini-translate-close:hover {
  background: rgba(107, 114, 128, 0.15);
  color: #374151;
  transform: scale(1.05);
}

/* Hide when minimized - elegant collapsed state */
.gini-translate-container.minimized {
  padding: 16px;
  min-width: auto;
  width: auto;
  border-radius: 20px;
}

.gini-translate-container.minimized .gini-translate-content {
  display: none;
}

.gini-translate-toggle {
  background: #2F2EB1;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(47,46,177,0.25);
  min-height: 48px;
  justify-content: center;
}

.gini-translate-toggle:hover {
  background: #242391;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(47,46,177,0.35);
}

.gini-translate-toggle:active {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(47,46,177,0.3);
}
