/* Multi-language support styles */

/* Header actions container for language toggle and GitHub link */
.header-actions {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.language-toggle {
  display: flex;
  align-items: center;
}

.language-switch {
  display: inline-block;
  padding: 0.5rem 0.5rem;
  background-color: #268bd2;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.3s ease;
  border: 2px solid #268bd2;
}

.language-switch:hover {
  background-color: #1e6ba8;
  border-color: #1e6ba8;
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.language-switch:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(38, 139, 210, 0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .header-actions {
    position: relative;
    top: auto;
    right: auto;
    justify-content: center;
    margin: 0.5rem 0;
    gap: 1rem;
  }
  
  .language-toggle {
    display: flex;
    align-items: center;
  }
  
  .masthead-title {
    text-align: center;
  }
  
  .masthead .container {
    position: relative;
  }
}

/* Language indicator for posts */
.post-language {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 3px;
  font-size: 0.75rem;
  color: #6c757d;
  margin-bottom: 0.5rem;
}

.post-language.lang-en {
  background-color: #e3f2fd;
  border-color: #2196f3;
  color: #1976d2;
}

.post-language.lang-vi {
  background-color: #fff3e0;
  border-color: #ff9800;
  color: #f57c00;
}

/* Smooth transitions for language switching */
.content-wrapper {
  transition: opacity 0.3s ease;
}

.content-wrapper.switching {
  opacity: 0.7;
}

.content.switching {
  opacity: 0.7;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

/* Language switch notification */
.language-switch-notification {
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Sidebar language status */
.sidebar-nav-item.language-status {
  font-size: 0.8em;
  color: #999;
  font-style: italic;
  padding: 0.25rem 0;
}

.sidebar-nav-item.language-link {
  color: #268bd2 !important;
  font-weight: 500;
}

.sidebar-nav-item.language-link:hover {
  color: #1e6ba8 !important;
  text-decoration: underline;
}

/* Language-specific typography adjustments */
html[lang="vi"] {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

html[lang="en"] {
  font-family: "PT Serif", Georgia, "Times New Roman", serif;
}

/* Accessibility improvements */
.language-switch[aria-pressed="true"] {
  background-color: #0d47a1;
  border-color: #0d47a1;
}

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