/* ========================================
   LANGUAGE SWITCHER STYLES
   ======================================== */

/* Language Switcher Container */
.language-switcher {
  position: relative;
  display: inline-block;
}

/* Language Button */
.language-button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 14px;
  font-weight: 500;
  color: #222222;
}

.language-button:hover {
  background: #f5f5f5;
  border-color: #d93b3b;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(217, 59, 59, 0.15);
}

.language-button:hover .lang-code {
  color: #ffffff;
}

.language-button .flag-icon {
  width: 20px;
  height: 20px;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.language-button .lang-code {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.5px;
  color: #222222; /* Màu đen cho chữ VI, EN, JP */
}

.language-button .material-symbols-outlined {
  font-size: 18px;
  transition: transform 0.3s;
}

.language-switcher.active .language-button .material-symbols-outlined {
  transform: rotate(180deg);
}

/* Dropdown Menu */
.language-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  overflow: hidden;
}

.language-switcher.active .language-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.language-dropdown::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 20px;
  width: 12px;
  height: 12px;
  background: white;
  border-left: 1px solid #e0e0e0;
  border-top: 1px solid #e0e0e0;
  transform: rotate(45deg);
}

/* Dropdown Header */
.language-dropdown-header {
  padding: 12px 16px;
  background: linear-gradient(135deg, #f5f5f5 0%, #fafafa 100%);
  border-bottom: 1px solid #e0e0e0;
}

.language-dropdown-header h4 {
  font-size: 12px;
  font-weight: 700;
  color: #888888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

/* Language Option */
.language-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: #222222;
  border-left: 3px solid transparent;
}

.language-option:hover {
  background: #f8f9fa;
  border-left-color: #d93b3b;
  padding-left: 20px;
}

.language-option.active {
  background: linear-gradient(90deg, #fff5f5 0%, #ffffff 100%);
  border-left-color: #d93b3b;
  font-weight: 600;
}

.language-option .flag-icon {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  object-fit: cover;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.language-option .lang-info {
  flex: 1;
}

.language-option .lang-name {
  font-size: 14px;
  font-weight: 500;
  display: block;
  color: #222222;
}

.language-option .lang-native {
  font-size: 12px;
  color: #888888;
  margin-top: 2px;
  display: block;
}

.language-option .checkmark {
  color: #d93b3b;
  font-size: 20px;
  opacity: 0;
  transition: opacity 0.2s;
}

.language-option.active .checkmark {
  opacity: 1;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  .language-button {
    color: #e0e0e0;
    border-color: #333333;
  }

  .language-button:hover {
    background: #242424;
    border-color: #d93b3b;
  }

  .language-dropdown {
    background: #242424;
    border-color: #333333;
  }

  .language-dropdown::before {
    background: #242424;
    border-color: #333333;
  }

  .language-dropdown-header {
    background: linear-gradient(135deg, #1a1a1a 0%, #242424 100%);
    border-color: #333333;
  }

  .language-dropdown-header h4 {
    color: #aaaaaa;
  }

  .language-option {
    color: #e0e0e0;
  }

  .language-option:hover {
    background: #1a1a1a;
  }

  .language-option.active {
    background: linear-gradient(90deg, #2a1515 0%, #242424 100%);
  }

  .language-option .lang-name {
    color: #e0e0e0;
  }

  .language-option .lang-native {
    color: #aaaaaa;
  }
}

/* Mobile Responsive */
@media (max-width: 1023px) {
  .language-dropdown {
    right: auto;
    left: 0;
    min-width: 200px;
  }

  .language-dropdown::before {
    right: auto;
    left: 20px;
  }
}

/* Mobile Menu Language Switcher */
.mobile-language-switcher {
  padding: 16px !important;
  border-top: 3px solid #d93b3b !important;
  background: #fff5f5 !important;
  margin: 12px 0 !important;
  border-radius: 8px;
  display: block !important; /* Force hiển thị */
  visibility: visible !important;
}

.mobile-language-switcher h4 {
  font-size: 13px !important;
  font-weight: 700;
  color: #d93b3b !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 12px 0 !important;
  text-align: center;
  display: block !important;
}

.mobile-language-options {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 8px;
  visibility: visible !important;
}

.mobile-language-option {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px !important;
  border: 2px solid #e0e0e0 !important;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  background: white !important;
  visibility: visible !important;
}

.mobile-language-option:hover {
  border-color: #d93b3b;
  background: #fff5f5;
  transform: translateY(-2px);
}

.mobile-language-option.active {
  border-color: #d93b3b;
  background: linear-gradient(135deg, #fff5f5 0%, #ffffff 100%);
  box-shadow: 0 2px 8px rgba(217, 59, 59, 0.15);
}

.mobile-language-option .flag-icon {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  object-fit: cover;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mobile-language-option .lang-code {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: #222222;
}

.mobile-language-option.active .lang-code {
  color: #d93b3b;
}

@media (prefers-color-scheme: dark) {
  .mobile-language-switcher {
    border-color: #333333;
  }

  .mobile-language-switcher h4 {
    color: #aaaaaa;
  }

  .mobile-language-option {
    background: #1a1a1a;
    border-color: #333333;
  }

  .mobile-language-option:hover {
    background: #242424;
    border-color: #d93b3b;
  }

  .mobile-language-option.active {
    background: linear-gradient(135deg, #2a1515 0%, #1a1a1a 100%);
  }

  .mobile-language-option .lang-code {
    color: #e0e0e0;
  }

  .mobile-language-option.active .lang-code {
    color: #d93b3b;
  }
}
