/**
 * CareGo Language Switcher - Bottom-Left Floating Widget
 * Smooth, professional design matching CareGo's industrial aesthetic
 */

/* ==============================================
   CONTAINER - Fixed Bottom-Left Position
   ============================================== */
.carego-language-switcher {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 1000;
  font-family: 'Rubik', sans-serif;
}

/* ==============================================
   BUTTON - Collapsed State
   ============================================== */
.lang-switcher-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #ffffff;
  border: 2px solid #e0e0e0;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  min-width: 100px;
  user-select: none;
}

.lang-switcher-btn:hover {
  border-color: #FF771B;
  box-shadow: 0 6px 20px rgba(255, 119, 27, 0.2);
  transform: translateY(-2px);
}

/* ==============================================
   BUTTON CONTENT
   ============================================== */
.lang-switcher-icon {
  font-size: 20px;
  line-height: 1;
}

.lang-switcher-current {
  font-size: 14px;
  font-weight: 600;
  color: #333333;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.lang-switcher-arrow {
  font-size: 12px;
  color: #999999;
  transition: transform 0.3s ease;
  margin-left: auto;
}

.lang-switcher-btn:hover .lang-switcher-arrow {
  color: #FF771B;
}

/* Arrow rotation when expanded */
.carego-language-switcher.expanded .lang-switcher-arrow {
  transform: rotate(180deg);
}

/* ==============================================
   DROPDOWN MENU - Expanded State
   ============================================== */
.lang-switcher-menu {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 8px;
  background: #ffffff;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 8px;
  min-width: 160px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.carego-language-switcher.expanded .lang-switcher-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ==============================================
   MENU ITEMS
   ============================================== */
.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.lang-option:hover {
  background: #f5f5f5;
  transform: translateX(4px);
}

.lang-option.active {
  background: #FFF3E6;
  cursor: default;
}

.lang-option.active:hover {
  transform: translateX(0);
}

/* Active indicator dot */
.lang-option::before {
  content: '';
  position: absolute;
  left: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #FF771B;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.lang-option.active::before {
  opacity: 1;
}

/* ==============================================
   OPTION CONTENT
   ============================================== */
.lang-option-flag {
  font-size: 20px;
  line-height: 1;
  min-width: 24px;
  text-align: center;
}

.lang-option-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.lang-option-code {
  font-size: 13px;
  font-weight: 600;
  color: #333333;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.lang-option-name {
  font-size: 11px;
  color: #666666;
  margin-top: 2px;
}

.lang-option.active .lang-option-code {
  color: #FF771B;
}

/* ==============================================
   LOADING STATE
   ============================================== */
.lang-switcher-loading {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
}

.carego-language-switcher.loading .lang-switcher-btn {
  display: none;
}

.carego-language-switcher.loading .lang-switcher-loading {
  display: flex;
}

.lang-switcher-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #e0e0e0;
  border-top-color: #FF771B;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==============================================
   MOBILE RESPONSIVE
   ============================================== */
@media (max-width: 768px) {
  .carego-language-switcher {
    bottom: 16px;
    left: 16px;
  }

  .lang-switcher-btn {
    padding: 10px 14px;
    min-width: 90px;
  }

  .lang-switcher-icon {
    font-size: 18px;
  }

  .lang-switcher-current {
    font-size: 13px;
  }

  .lang-switcher-menu {
    min-width: 140px;
  }

  .lang-option {
    padding: 9px 12px;
  }
}

/* Small screens - make it even more compact */
@media (max-width: 480px) {
  .carego-language-switcher {
    bottom: 12px;
    left: 12px;
  }

  .lang-switcher-btn {
    padding: 8px 12px;
    min-width: 80px;
  }

  .lang-switcher-icon {
    font-size: 16px;
  }

  .lang-switcher-current {
    font-size: 12px;
  }
}

/* ==============================================
   ACCESSIBILITY & FOCUS STATES
   ============================================== */
.lang-switcher-btn:focus,
.lang-option:focus {
  outline: 2px solid #FF771B;
  outline-offset: 2px;
}

.lang-switcher-btn:focus:not(:focus-visible),
.lang-option:focus:not(:focus-visible) {
  outline: none;
}

/* ==============================================
   SMOOTH TRANSITIONS FOR CONTENT CHANGES
   ============================================== */
[data-i18n] {
  transition: opacity 0.2s ease;
}

.carego-language-switcher.transitioning [data-i18n] {
  opacity: 0.7;
}

/* ==============================================
   PRINT STYLES
   ============================================== */
@media print {
  .carego-language-switcher {
    display: none;
  }
}

