/**
 * Language Switcher Styles
 * 
 * Responsive styles for the language switcher component with flag icons.
 * Includes active state highlighting, hover effects, and mobile optimization.
 *
 * @package Guns_Planet
 * @since 1.0.0
 */

/* ===============================================
   Base Container Styles
   =============================================== */
.lang-switcher {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  z-index: 10;
}

.lang-switcher__list {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
}

/* ===============================================
   Item & Link Styles
   =============================================== */
.lang-switcher__item {
  position: relative;
  margin: 0;
  padding: 0;
  display: inline-block;
}

.lang-switcher__link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.5rem;
  border-radius: 0.25rem;
  text-decoration: none;
  transition: all 0.2s ease-in-out;
  background-color: transparent;
  border: 1px solid transparent;
  color: inherit;
  min-height: 32px;
}

.lang-switcher__link:hover {
  background-color: rgba(255, 178, 14, 0.1); /* #ffb20e with 10% opacity */
  border-color: rgba(255, 178, 14, 0.3);
}

.lang-switcher__link:focus {
  outline: 2px solid #ffb20e;
  outline-offset: 2px;
}

/* ===============================================
   Active State
   =============================================== */
.lang-switcher__item--active .lang-switcher__link {
  background-color: #ffb20e;
  border-color: #ffb20e;
  cursor: default;
  pointer-events: none;
}

.lang-switcher__item--active .lang-switcher__link:hover {
  background-color: #ffb20e;
}

.lang-switcher__item--active .lang-switcher__code {
  color: #000;
  font-weight: 700;
}

/* ===============================================
   Flag Icon
   =============================================== */
.lang-switcher__flag {
  display: inline-block !important;
  width: 24px;
  height: 18px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  vertical-align: middle;
  flex-shrink: 0;
}

.lang-switcher__link:hover .lang-switcher__flag {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

/* ===============================================
   Country Code & Name
   =============================================== */
.lang-switcher__code {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  transition: color 0.2s ease-in-out;
}

.lang-switcher__name {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ===============================================
   Responsive Styles
   =============================================== */

/* Tablet and below - hide country codes, keep flags only */
@media (max-width: 768px) {
  .lang-switcher__list {
    gap: 0.375rem;
  }

  .lang-switcher__link {
    padding: 0.25rem;
    gap: 0;
  }

  .lang-switcher__code {
    display: none;
  }

  .lang-switcher__flag {
    width: 20px;
    height: 15px;
  }
}

/* Mobile - compact layout */
@media (max-width: 480px) {
  .lang-switcher {
    margin-left: auto;
  }

  .lang-switcher__list {
    gap: 0.25rem;
  }

  .lang-switcher__link {
    padding: 0.125rem;
  }

  .lang-switcher__flag {
    width: 18px;
    height: 13px;
  }
}

/* ===============================================
   Accessibility Enhancements
   =============================================== */

/* High contrast mode support */
@media (prefers-contrast: high) {
  .lang-switcher__link {
    border: 2px solid currentColor;
  }

  .lang-switcher__item--active .lang-switcher__link {
    background-color: #000;
    color: #fff;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .lang-switcher__link,
  .lang-switcher__code,
  .lang-switcher__flag {
    transition: none;
  }
}

/* Focus visible for keyboard navigation */
.lang-switcher__link:focus-visible {
  outline: 3px solid #ffb20e;
  outline-offset: 3px;
}

/* ===============================================
   Dark Mode Support (Optional)
   =============================================== */
@media (prefers-color-scheme: dark) {
  .lang-switcher__code {
    color: #e5e5e5;
  }

  .lang-switcher__link:hover {
    background-color: rgba(255, 178, 14, 0.2);
    border-color: rgba(255, 178, 14, 0.4);
  }

  .lang-switcher__item--active .lang-switcher__code {
    color: #000;
  }
}

/* ===============================================
   RTL Support
   =============================================== */
[dir='rtl'] .lang-switcher__list {
  flex-direction: row-reverse;
}

[dir='rtl'] .lang-switcher__link {
  flex-direction: row-reverse;
}
