/* Object Filter Panel Styles */

/* 언어 안내 메시지 */
.localization-notice {
  background: rgba(0, 0, 0, 0.9);
  color: rgba(255, 255, 255, 0.3);
  font-size: 10px;
  line-height: 1.3;
  padding: 6px 8px;
  margin-top: 12px;
  margin-bottom: 8px;
  border-radius: 0 4px 4px 0;
  text-align: center;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.localization-notice:hover {
  opacity: 1;
  color: rgba(255, 255, 255, 0.5);
}

#object-filter-panel {
  position: absolute;
  top: 80px;
  left: 30px;
  width: 280px;
  max-height: calc(100vh - 40px);
  background: rgba(0, 0, 0, 0.85);
  padding: 20px;
  border-radius: 0px;
  color: white;
  z-index: 1000;
  overflow-y: auto;
  clip-path: polygon(
    calc(-1% + var(--random-x-1)) calc(-1% + var(--random-y-1)),
    calc(101% + var(--random-x-2)) calc(-1% + var(--random-y-2)),
    calc(101% + var(--random-x-3)) calc(101% + var(--random-y-3)),
    calc(-1% + var(--random-x-4)) calc(101% + var(--random-y-4))
  );
  box-shadow: -8px 8px 0px 0px rgba(220, 38, 38, 0.8);
}

#object-filter-panel h2 {
  margin-bottom: 15px;
  font-size: 18px;
  font-weight: 600;
}

@media screen and (min-width: 1201px) {
  #object-filter-panel h2 { display: none; }
}

/* 필터 컨트롤 버튼 */
.filter-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
}

.filter-control-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 8px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

.filter-control-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.filter-control-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}


#filter-container {
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

.filter-item {
  position: relative;
  cursor: pointer;
  padding: 8px;
  padding-bottom: 18px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  transition: background 0.2s;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0; /* 그리드 항목 축소 허용 */
  box-sizing: border-box;
}

.filter-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* 개수 표시 */
.filter-count {
  position: absolute;
  bottom: 2px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  line-height: 1;
}

.filter-count.all-collected {
  color: rgba(76, 175, 80, 0.9);
}

.filter-count .collected {
  color: #fff;
  font-weight: 600;
}

.filter-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
}

.filter-checkmark {
  position: absolute;
  top: 0;
  right: 0;
  width: auto;
  height: 12px;
  min-width: 12px;
  background: rgba(76, 175, 80, 0.9);
  border-radius: 0 0 0 4px;
  padding: 2px 4px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.control-group {
  margin-bottom: 15px;
  display: none;
}

.control-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: bold;
}

.zoom-controls {
  display: flex;
  gap: 10px;
}

.zoom-btn {
  flex: 1;
  padding: 8px;
  background: #7e1919;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.zoom-btn:hover {
  background: #9a1f1f;
}

.info-text {
  font-size: 12px;
  color: #aaa;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.info-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.7;
}

/* language selector */
.language-selector-container {
  margin-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

.custom-select {
  position: relative;
  width: 100%;
}

.selected-option {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background-color: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.selected-option:hover {
  background-color: #2c2c2c;
  border-color: rgba(255, 255, 255, 0.4);
}

.selected-option .flag-icon {
  width: 16px;
  height: 16px;
  margin-right: 8px;
}

.options-container {
  position: absolute;
  bottom: 100%;
  left: 0;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  border-radius: 4px 4px 0 0;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
  z-index: 10;
  margin-bottom: 4px;
}

.options-container.active {
  max-height: 200px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-bottom: none;
}

.option {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.option:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.option.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.option.disabled:hover {
  background-color: transparent;
}

.option.selected {
  background-color: rgba(0, 0, 0, 0.5);
  color: #d3bc8e;
  font-weight: 700;
}

.option .flag-icon {
  width: 16px;
  height: 16px;
  margin-right: 8px;
}

/* 반응형 - 1200px 이하에서 모바일 UI */
@media screen and (max-width: 1200px) {
  /* 모바일에서 필터 패널 숨김 (바텀시트로만 동작) */
  #object-filter-panel {
    display: none;
    width: 100%;
    max-height: 60vh;
    padding: 0;
    background: rgba(0, 0, 0, 0.95);
    border-radius: 0;
  }

  /* 바텀시트 모드 */
  #object-filter-panel.mobile-bottomsheet {
    display: flex;
    flex-direction: column;
    padding: 0 16px;
    padding-bottom: 100px; /* 하단 플로팅 버튼과 겹치지 않도록 */
  }

  #object-filter-panel.mobile-bottomsheet .bottomsheet-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px 16px;
  }

  /* 타이틀 숨김 (바텀시트 헤더에서 표시) */
  #object-filter-panel.mobile-bottomsheet h2 {
    display: none;
  }

  /* 필터 컨트롤 */
  #object-filter-panel.mobile-bottomsheet .filter-controls {
    margin-bottom: 12px;
  }

  #object-filter-panel.mobile-bottomsheet .filter-control-btn {
    padding: 10px 12px;
    font-size: 14px;
  }

  /* 필터 그리드 - 모바일에서 5열 */
  #object-filter-panel.mobile-bottomsheet #filter-container {
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 16px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  #object-filter-panel.mobile-bottomsheet .filter-item {
    padding: 6px;
    padding-bottom: 16px;
  }

  #object-filter-panel.mobile-bottomsheet .filter-count {
    font-size: 9px;
    bottom: 1px;
  }

  /* 줌 컨트롤 표시 */
  /*
  #object-filter-panel.mobile-bottomsheet .control-group {
    display: block;
    margin-bottom: 12px;
  }*/

  #object-filter-panel.mobile-bottomsheet .zoom-controls {
    gap: 8px;
  }

  #object-filter-panel.mobile-bottomsheet .zoom-btn {
    padding: 10px;
    font-size: 16px;
  }

  /* 도움말 텍스트 */
  #object-filter-panel.mobile-bottomsheet .info-text {
    display: none;
  }

  /* 언어 선택기 */
  #object-filter-panel.mobile-bottomsheet .language-selector-container {
    margin-top: 16px;
    padding-top: 12px;
    padding-bottom: 20px;
  }

  #object-filter-panel.mobile-bottomsheet .selected-option {
    padding: 10px 12px;
    font-size: 14px;
  }

  #object-filter-panel.mobile-bottomsheet .options-container {
    bottom: auto;
    top: 100%;
    margin-top: 4px;
    margin-bottom: 0;
    border-radius: 0 0 4px 4px;
  }

  #object-filter-panel.mobile-bottomsheet .options-container.active {
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-top: none;
  }
}

/* 맵 진행도 프로그레스 바 */
.map-progress-container {
  margin-top: 0;
  margin-bottom: 24px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.progress-title {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
}

.progress-text {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
}

.progress-text.complete {
  color: rgba(76, 175, 80, 0.9);
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #980000, #f10000);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.progress-bar.complete {
  background: linear-gradient(90deg, #22c55e, #4ade80);
}

/* 모바일 진행도 바 */
@media screen and (max-width: 1200px) {
  #object-filter-panel.mobile-bottomsheet .map-progress-container {
    margin-bottom: 16px;
    padding: 10px;
    width: 100%;
    box-sizing: border-box;
  }

  #object-filter-panel.mobile-bottomsheet .progress-title {
    font-size: 11px;
  }

  #object-filter-panel.mobile-bottomsheet .progress-text {
    font-size: 12px;
  }

  #object-filter-panel.mobile-bottomsheet .progress-bar-container {
    height: 5px;
  }
}

/* 백업/복원 컨테이너 (PC 전용) */
.backup-restore-container {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.backup-restore-title {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 10px;
  text-align: center;
}

.backup-restore-buttons {
  display: flex;
  gap: 8px;
}

.backup-btn,
.restore-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

.backup-btn:hover,
.restore-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.backup-btn svg,
.restore-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* 토스트 애니메이션 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes fadeOutDown {
  from {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
}
