/* Language Selector Styles */
.language-selector {
  position: relative;
  margin-right: 1rem;
  z-index: 10;
}

.language-button {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(191, 149, 63, 0.1);
  border: 1.5px solid rgba(191, 149, 63, 0.4);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  color: #BF953F;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
  height: 32px;
}

.language-button:hover {
  background: rgba(191, 149, 63, 0.2);
  border-color: #BF953F;
  box-shadow: 0 0 15px rgba(191, 149, 63, 0.3);
}

.language-button svg {
  width: 16px;
  height: 16px;
  stroke: #BF953F;
}

.lang-text {
  font-weight: 600;
  min-width: 20px;
  text-align: center;
  font-size: 12px;
}

.language-dropdown {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  background: linear-gradient(145deg, rgba(35, 35, 35, 0.98), rgba(25, 25, 25, 0.99));
  border: 1.5px solid #BF953F;
  border-radius: 6px;
  padding: 0.4rem;
  min-width: 160px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.language-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
  text-align: left;
}

.lang-option:hover {
  background: rgba(191, 149, 63, 0.15);
  color: #BF953F;
}

.lang-option.active {
  background: rgba(191, 149, 63, 0.2);
  color: #BF953F;
  font-weight: 600;
}

.lang-option .flag {
  font-size: 18px;
  line-height: 1;
}

/* Animazione per il cambio lingua */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

[data-i18n] {
  animation: fadeIn 0.3s ease;
}

/* Mobile Styles */
@media (max-width: 768px) {
  .language-selector {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 9998;
    margin-right: 0;
  }
  
  .language-button {
    padding: 0.4rem 0.7rem;
    font-size: 12px;
    height: 32px;
    min-width: 60px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  
  .language-button svg {
    width: 16px;
    height: 16px;
  }
  
  .lang-text {
    font-size: 12px;
    min-width: 20px;
    font-weight: 500;
  }
  
  .language-dropdown {
    left: 0;
    right: auto;
    min-width: 150px;
    padding: 0.4rem;
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .lang-option {
    padding: 0.6rem 0.8rem;
    font-size: 14px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  
  .lang-option .flag {
    font-size: 18px;
  }
  
  .lang-option:active {
    background: rgba(191, 149, 63, 0.3);
  }
}

/* Tablet Styles */
@media (min-width: 769px) and (max-width: 1024px) {
  .language-selector {
    margin-right: 1rem;
  }
}

/* Desktop Large */
@media (min-width: 1440px) {
  .language-button {
    padding: 0.6rem 1.2rem;
    font-size: 15px;
  }
  
  .language-dropdown {
    min-width: 200px;
  }
  
  .lang-option {
    padding: 0.8rem 1.2rem;
    font-size: 15px;
  }
}

/* Accessibilità */
.language-button:focus,
.lang-option:focus {
  outline: 2px solid #BF953F;
  outline-offset: 2px;
}

/* Smooth transitions per tutti gli elementi tradotti */
[data-i18n] {
  transition: opacity 0.2s ease;
}

/* Effetto hover per il selettore */
.language-selector:hover .language-button {
  transform: scale(1.05);
}

/* Stile per quando il dropdown è aperto */
.language-dropdown.show + .language-button {
  border-color: #BF953F;
  box-shadow: 0 0 15px rgba(191, 149, 63, 0.3);
}

