/* 다국어 언어 선택기 스타일 */

/* 현재 언어 표시기 스타일 */
.current-language-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(102, 126, 234, 0.1);
  border: 1px solid rgba(102, 126, 234, 0.2);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #667eea;
  margin-right: 10px;
  transition: all 0.2s ease;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}

.current-language-indicator:hover {
  background: rgba(102, 126, 234, 0.15);
  transform: scale(1.05);
}

.current-language-indicator:active {
  transform: scale(0.98);
}

body.dark-mode .current-language-indicator {
  background: rgba(102, 126, 234, 0.2);
  border-color: rgba(102, 126, 234, 0.3);
  color: #a5b4fc;
}

/* 언어 선택기 스타일 - 우측 하단 플로팅 버튼 */
.language-selector {
  position: fixed;
  bottom: 110px; /* 하단 탭바 위에 위치 - 더 위로 이동 */
  right: 20px;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50px; /* 원형 플로팅 버튼 */
  padding: 12px 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(102, 126, 234, 0.1);
  transition: all 0.3s ease;
  min-width: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.language-selector:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.current-language {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-size: 1rem; /* iOS zoom fix */
  font-weight: 500;
  color: #333;
}

.current-language:hover {
  background: rgba(102, 126, 234, 0.1);
}

.current-language .flag {
  font-size: 1.1rem;
}

.current-language .name {
  min-width: 60px;
}

.current-language i {
  font-size: 0.7rem;
  transition: transform 0.2s ease;
}

.language-selector.open .current-language i {
  transform: rotate(180deg);
}

.language-dropdown {
  position: absolute;
  bottom: 100%;
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(102, 126, 234, 0.1);
  min-width: 200px;
  max-height: 300px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s ease;
  z-index: 1001;
}

.language-selector.open .language-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(-5px);
}

.language-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.language-option:last-child {
  border-bottom: none;
}

.language-option:hover {
  background: rgba(102, 126, 234, 0.1);
}

.language-option .flag {
  font-size: 1.2rem;
}

.language-option .name {
  font-size: 1rem; /* iOS zoom fix */
  font-weight: 500;
  color: #333;
}

/* 다크모드 언어 선택기 */
body.dark-mode .language-selector {
  background: rgba(44, 52, 64, 0.95);
  border-color: rgba(165, 180, 252, 0.2);
}

body.dark-mode .current-language {
  color: #e0e0e0;
}

body.dark-mode .current-language:hover {
  background: rgba(165, 180, 252, 0.2);
}

body.dark-mode .language-dropdown {
  background: #2c3440;
  border-color: rgba(165, 180, 252, 0.2);
}

body.dark-mode .language-option {
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .language-option:hover {
  background: rgba(165, 180, 252, 0.2);
}

body.dark-mode .language-option .name {
  color: #e0e0e0;
}

/* 모바일 언어 선택기 */
@media (max-width: 1024px) {
  /* Mobile language indicator improvements */
  .current-language-indicator {
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
    margin-right: 0.3rem;
    border-radius: 15px;
    min-height: 28px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(102, 126, 234, 0.2);
  }
  
  .language-selector {
    bottom: 100px !important; /* 하단 탭바 위에 위치 - 더 위로 이동 */
    right: 15px !important;
    padding: 10px 14px;
    border-radius: 40px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    z-index: 999 !important; /* 헤더(z-index: 1000)보다 낮게 */
    position: fixed !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-width: 50px;
  }

  .current-language {
    padding: 6px 10px;
    font-size: 1rem; /* iOS zoom fix */
    min-height: 32px;
  }

  .current-language .name {
    min-width: 50px;
  }

  .language-dropdown {
    min-width: 160px;
    right: -10px;
    max-height: 250px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
  }

  .language-option {
    padding: 10px 14px;
    min-height: 40px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(102, 126, 234, 0.1);
  }

  .language-option .name {
    font-size: 1rem; /* iOS zoom fix */
  }
}

/* Very small mobile screens language selector */
@media (max-width: 480px) {
  .current-language-indicator {
    font-size: 0.65rem;
    padding: 0.25rem 0.5rem;
    min-height: 24px;
    gap: 4px;
  }
  
  .language-selector {
    bottom: 90px !important; /* 초소형 화면에서 하단 탭바 위 - 더 위로 이동 */
    right: 10px;
    padding: 8px 12px;
    border-radius: 30px !important;
    z-index: 9999 !important;
    position: fixed !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-width: 45px;
  }

  .current-language {
    padding: 4px 8px;
    font-size: 0.75rem;
    gap: 6px;
  }

  .current-language .name {
    min-width: 45px;
  }

  .language-dropdown {
    min-width: 140px;
    right: -15px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
  }

  .language-option {
    padding: 8px 12px;
    min-height: 36px;
  }

  .language-option .name {
    font-size: 0.75rem;
  }
}

/* 한국어 전용 모달 스타일 */
.korean-only-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.korean-only-modal.show {
  opacity: 1;
  pointer-events: all;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: white;
  border-radius: 16px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.korean-only-modal.show .modal-content {
  transform: scale(1);
}

.modal-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-header i {
  color: #ff6b6b;
  font-size: 1.2rem;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
}

.modal-body {
  padding: 20px 24px;
}

.modal-body p {
  margin: 0;
  color: #666;
  line-height: 1.5;
}

.modal-footer {
  padding: 16px 24px 24px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  font-size: 1rem; /* iOS zoom fix */
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: #667eea;
  color: white;
}

.btn-primary:hover {
  background: #5a67d8;
}

.btn-secondary {
  background: #e2e8f0;
  color: #4a5568;
}

.btn-secondary:hover {
  background: #cbd5e0;
}

/* 다크모드 모달 */
body.dark-mode .modal-content {
  background: #2c3440;
}

body.dark-mode .modal-header {
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .modal-header h3 {
  color: #e0e0e0;
}

body.dark-mode .modal-body p {
  color: #a0a0a0;
}

body.dark-mode .btn-secondary {
  background: #4a5568;
  color: #e0e0e0;
}

body.dark-mode .btn-secondary:hover {
  background: #2d3748;
}