/**
 * Language Switcher Styles
 */

.language-switcher {
  display: inline-flex;
  align-items: center;
  margin-left: 15px;
  margin-right: 15px;
}

.lang-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 2px solid #828282;
  border-radius: 20px;
  background-color: transparent;
  color: #424242;
  font-size: 14px;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
}

.lang-toggle-btn:hover {
  background-color: #f0f0f0;
  border-color: #424242;
  transform: translateY(-1px);
}

.lang-toggle-btn:active {
  transform: translateY(0);
}

.lang-toggle-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(66, 66, 66, 0.2);
}

.lang-icon {
  font-size: 16px;
  line-height: 1;
}

.lang-text {
  font-size: 13px;
  letter-spacing: 0.5px;
  line-height: 1;
}

/* Active state styling */
.lang-toggle-btn.lang-zh {
  border-color: #2a7ae2;
  color: #2a7ae2;
}

.lang-toggle-btn.lang-zh:hover {
  background-color: #e8f2ff;
  border-color: #1756bd;
  color: #1756bd;
}

.lang-toggle-btn.lang-en {
  border-color: #e67e22;
  color: #e67e22;
}

.lang-toggle-btn.lang-en:hover {
  background-color: #fef5e7;
  border-color: #d35400;
  color: #d35400;
}

/* Responsive adjustments */
@media screen and (max-width: 600px) {
  .language-switcher {
    margin-left: 10px;
    margin-right: 10px;
  }

  .lang-toggle-btn {
    padding: 5px 10px;
    font-size: 13px;
  }

  .lang-icon {
    font-size: 14px;
  }

  .lang-text {
    font-size: 12px;
  }
}

/* Integration with site header */
.site-header .wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.site-header .site-title {
  flex-shrink: 0;
}

.site-header .language-switcher {
  order: 2;
  flex-shrink: 0;
}

.site-header .site-nav {
  order: 3;
  flex: 1 1 auto;
}

@media screen and (max-width: 600px) {
  .site-header .wrapper {
    justify-content: flex-start;
  }

  .site-header .language-switcher {
    order: 1;
    margin-left: auto;
    margin-right: 10px;
  }

  .site-header .site-nav {
    order: 2;
  }
}

/* Language switch notice in post header */
.lang-switch-notice {
  margin: 10px 0;
  padding: 10px 15px;
  background-color: #f8f9fa;
  border-left: 3px solid #2a7ae2;
  border-radius: 4px;
  font-size: 14px;
}

.lang-switch-notice a {
  color: #2a7ae2;
  text-decoration: none;
  font-weight: 500;
}

.lang-switch-notice a:hover {
  text-decoration: underline;
}

/* Language unavailable notice */
.lang-unavailable-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 15px 0;
  padding: 12px 16px;
  background-color: #fff3cd;
  border-left: 4px solid #ffc107;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.6;
  color: #856404;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: opacity 0.3s ease;
  opacity: 1;
}

.lang-unavailable-notice .notice-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.lang-unavailable-notice .notice-text {
  flex: 1;
}

.lang-unavailable-notice .notice-close {
  flex-shrink: 0;
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: #856404;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.lang-unavailable-notice .notice-close:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

.lang-unavailable-notice .notice-close:focus {
  outline: 2px solid #ffc107;
  outline-offset: 2px;
}

@media screen and (max-width: 600px) {
  .lang-unavailable-notice {
    padding: 10px 12px;
    font-size: 13px;
  }

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

  .lang-unavailable-notice .notice-close {
    font-size: 20px;
    width: 20px;
    height: 20px;
  }
}
