/**
 * Bilingual Translation System Styles
 * Loading states, transitions, and language switcher enhancements
 */

/* Language Switcher Styling */
.language-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 15px;
}

.lang-btn {
  background: transparent;
  border: 2px solid #dc2626;
  color: #dc2626;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.lang-btn:hover {
  background: #dc2626;
  color: #fff;
  transform: translateY(-1px);
}

.lang-btn.active {
  background: #dc2626;
  color: #fff;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.lang-separator {
  color: #6b7280;
  font-size: 14px;
  font-weight: 300;
}

/* Translation Loading State */
body.translating {
  cursor: wait;
  pointer-events: none;
}

body.translating::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 9998;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

body.translating::after {
  content: 'Translating... 번역 중...';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  color: #212529;
  padding: 20px 40px;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  font-size: 16px;
  font-weight: 600;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(1.05);
  }
}

/* Smooth transition for translated elements */
[data-en], [data-ko] {
  transition: opacity 0.2s ease;
}

body.translating [data-en],
body.translating [data-ko] {
  opacity: 0.6;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .language-switcher {
    margin-right: 10px;
    gap: 6px;
  }
  
  .lang-btn {
    padding: 5px 10px;
    font-size: 12px;
  }
  
  .lang-separator {
    font-size: 12px;
  }
  
  body.translating::after {
    padding: 15px 30px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .language-switcher {
    margin-right: 5px;
    gap: 4px;
  }
  
  .lang-btn {
    padding: 4px 8px;
    font-size: 11px;
  }
}

/* Header Actions Alignment Fix */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Ensure language buttons don't wrap */
.language-switcher {
  white-space: nowrap;
  flex-shrink: 0;
}

/* Korean Font Support */
html[lang="ko"],
html[lang="kr"] {
  font-family: -apple-system, BlinkMacSystemFont, 'Malgun Gothic', '맑은 고딕', 'Noto Sans KR', sans-serif;
}

/* Better Korean text rendering */
html[lang="ko"] *,
html[lang="kr"] * {
  word-break: keep-all;
  line-height: 1.6;
}

/* Accessibility improvements */
.lang-btn:focus {
  outline: 2px solid #dc2626;
  outline-offset: 2px;
}

.lang-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Translation indicator for elements */
.translating-element {
  position: relative;
}

.translating-element::after {
  content: '...';
  position: absolute;
  right: 0;
  top: 0;
  color: #dc2626;
  font-weight: bold;
  animation: blink 0.8s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}
