.language-switcher {
  margin-left: 5px;
  margin-right: 15px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 30px;
  padding: 3px 10px;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

/* Animation effect when switching languages */
.language-switch-animating {
  animation: pulse 0.4s ease;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.95); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

.language-btn {
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 14px;
  background: transparent;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 4px 3px;
  transition: all 0.3s ease;
  position: relative;
  opacity: 0.7;
  letter-spacing: 0.3px;
  min-width: 20px;
  text-align: center;
  margin-bottom: 1px; /* Account for border line */
}

.language-btn:hover {
  color: #ffffff;
  opacity: 1;
  transform: translateY(-1px);
}

.language-btn:focus {
  outline: none;
  opacity: 1;
  color: #ffffff;
  text-shadow: 0 0 1px rgba(255, 255, 255, 0.5);
}

.language-btn:focus-visible {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
  border-radius: 4px;
}

.language-btn.active {
  color: #ffffff;
  font-weight: 600;
  opacity: 1;
}

.language-btn.active::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  background: var(--color-primary, #0ea2bd);
  bottom: 0;
  left: 0;
  border-radius: 2px;
}

.language-divider {
  color: rgba(255, 255, 255, 0.4);
  margin: 0 3px;
  font-size: 12px;
  font-weight: 300;
  display: inline-block;
  vertical-align: middle;
}

/* Language-specific styles */
body.lang-en .lang-specific-en,
body.lang-pl .lang-specific-pl {
  display: block;
}

body.lang-en .lang-specific-pl,
body.lang-pl .lang-specific-en {
  display: none;
}

/* Hover effect */
.language-switcher:hover {
  background-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Dark mode styles */
body.dark .language-switcher {
  background-color: rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark .language-btn {
  color: var(--text-white-color, #ffffff);
}

body.dark .language-btn:hover,
body.dark .language-btn.active {
  color: var(--color-secondary, #f8a556);
}

body.dark .language-btn.active::after {
  background: var(--color-secondary, #f8a556);
}

body.dark .language-divider {
  color: rgba(255, 255, 255, 0.3);
}

body.dark .language-switcher:hover {
  background-color: rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Styles for scrolled header */
.header.sticked .language-switcher {
  background-color: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
}

.header.sticked .language-btn {
  color: var(--color-default, #212529);
  opacity: 0.8;
}

.header.sticked .language-btn:hover,
.header.sticked .language-btn.active {
  color: var(--color-primary, #0ea2bd);
  opacity: 1;
}

.header.sticked .language-btn.active::after {
  background: var(--color-primary, #0ea2bd);
}

.header.sticked .language-divider {
  color: rgba(0, 0, 0, 0.3);
}

.header.sticked .language-switcher:hover {
  background-color: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.15);
}

/* Stickied header on dark mode */
body.dark .header.sticked .language-switcher {
  background-color: rgba(30, 30, 30, 0.7);
  border-color: rgba(255, 255, 255, 0.15);
}

body.dark .header.sticked .language-btn {
  color: rgba(255, 255, 255, 0.8);
}

body.dark .header.sticked .language-btn:hover,
body.dark .header.sticked .language-btn.active {
  color: var(--color-secondary, #f8a556);
}

body.dark .header.sticked .language-divider {
  color: rgba(255, 255, 255, 0.3);
}

/* Sticky header with light background */
.header.stikcy-menu .language-switcher {
  background-color: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
}

.header.stikcy-menu .language-btn {
  color: var(--color-default, #212529);
  opacity: 0.8;
}

.header.stikcy-menu .language-btn:hover,
.header.stikcy-menu .language-btn.active {
  color: var(--color-primary, #0ea2bd);
  opacity: 1;
}

.header.stikcy-menu .language-btn.active::after {
  background: var(--color-primary, #0ea2bd);
}

.header.stikcy-menu .language-divider {
  color: rgba(0, 0, 0, 0.3);
}

/* Mobile styles */
@media (max-width: 991px) {
  .language-switcher {
    margin: 15px auto;
    padding: 6px 15px;
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    justify-content: center;
  }
  
  .header.sticked .language-switcher,
  .header.stikcy-menu .language-switcher {
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
  }
  
  .language-btn {
    font-size: 15px;
    padding: 6px 8px;
  }
  
  .language-divider {
    margin: 0 6px;
  }
  
  body.dark .language-switcher {
    background-color: rgba(0, 0, 0, 0.4);
  }
  
  .mobile-nav-active .header-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-top: 20px;
  }
  
  .mobile-nav-active .language-switcher {
    display: flex;
    justify-content: center;
    margin: 20px auto;
    padding: 8px 16px;
    background-color: rgba(255, 255, 255, 0.15);
    width: fit-content;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    position: relative;
    z-index: 1000;
  }
  
  .mobile-nav-active #darkmode-button {
    margin: 15px auto;
  }
  
  /* Active language indicator for mobile */
  .mobile-nav-active .language-btn.active {
    position: relative;
  }
  
  .mobile-nav-active .language-btn.active::before {
    content: '•';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--color-primary, #0ea2bd);
    font-size: 18px;
  }
  
  body.dark .mobile-nav-active .language-btn.active::before {
    color: var(--color-secondary, #f8a556);
  }
}