/* Map Select Panel Styles */

#map-select-panel {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 400px;
  max-height: calc(100vh - 40px);
  background: rgba(0, 0, 0, 0.85);
  border-radius: 8px;
  color: white;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 탭 */
#map-tabs {
  display: flex;
  border-bottom: 2px solid #333;
  padding: 0;
}

.map-tab {
  flex: 1;
  padding: 15px 20px;
  background: transparent;
  color: #aaa;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
}

.map-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.map-tab.active {
  color: #fff;
  border-bottom-color: #800000;
  background: rgba(128, 0, 0, 0.1);
}

/* 카테고리 드롭다운 */
#category-select-container {
  padding: 15px 20px;
  border-bottom: 1px solid #333;
}

.category-select {
  width: 100%;
  padding: 10px;
  background: #1a1a1a;
  color: white;
  border: 1px solid #444;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.category-select:focus {
  outline: none;
  border-color: #800000;
}

/* 맵 리스트 컨테이너 */
#map-list-container {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
}

#map-list {
  padding: 0 10px;
}

/* 맵 아이템 스타일 */
.map-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: #ffffff;
  text-decoration: none;
  transition: all 0.3s ease;
  width: 100%;
  box-sizing: border-box;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  background-color: #121212;
  border-top: 1px solid transparent;
  border-bottom: 1px solid transparent;
  cursor: pointer;
  position: relative;
}

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

.map-item.active {
  background-color: #800000;
  border-top-color: rgba(255, 255, 255, 0.1);
  border-bottom-color: rgba(255, 255, 255, 0.1);
  animation: subtle-liquid 2s infinite linear;
}

.map-item.active span {
  color: #ffffff;
  font-weight: 600;
}

.map-item span {
  font-size: 14px;
  margin-left: 0;
}

.map-item.has-submaps {
  padding-right: 50px;
}

.map-item-toggle {
  position: absolute;
  right: 16px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: 12px;
  transition: transform 0.3s ease;
}

.map-item.expanded .map-item-toggle {
  transform: rotate(90deg);
}

.map-sub-list {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-in-out;
  background-color: #0a0a0a;
  width: 100%;
}

.map-item.expanded + .map-sub-list,
.map-sub-item.expanded + .map-sub-list {
  max-height: 1000px;
}

.map-sub-item {
  display: flex;
  align-items: center;
  padding: 12px 20px 12px 48px;
  color: #ffffff;
  text-decoration: none;
  transition: all 0.3s ease;
  width: 100%;
  box-sizing: border-box;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  background-color: #0f0f0f;
  border-top: 1px solid transparent;
  border-bottom: 1px solid transparent;
  cursor: pointer;
  position: relative;
}

.map-sub-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.map-sub-item.active {
  background-color: #800000;
  border-top-color: rgba(255, 255, 255, 0.1);
  border-bottom-color: rgba(255, 255, 255, 0.1);
  animation: subtle-liquid 2s infinite linear;
}

.map-sub-item.active span {
  color: #ffffff;
  font-weight: 600;
}

.map-sub-item span {
  font-size: 13px;
  margin-left: 0;
}

/* 활성 애니메이션 */
@keyframes subtle-liquid {
  0% { clip-path: polygon(0% 2%, 99% 9%, 94% 99%, 4% 94%);}
  10% { clip-path: polygon(1% 1%, 98% 7%, 93% 100%, 5% 95%);}
  20% { clip-path: polygon(-1% 3%, 100% 5%, 95% 98%, 3% 93%);}
  30% { clip-path: polygon(0% 3%, 98% 2%, 93% 96%, 5% 95%);}
  40% { clip-path: polygon(1% 1%, 99% -1%, 95% 98%, 4% 93%);}
  50% { clip-path: polygon(0% 0%, 100% 2%, 93% 100%, 3% 95%);}
  60% { clip-path: polygon(-1% 3%, 98% 1%, 94% 98%, 5% 94%);}
  70% { clip-path: polygon(1% 2%, 99% -1%, 95% 96%, 4% 95%);}
  80% { clip-path: polygon(0% 1%, 100% 2%, 93% 98%, 3% 93%);}
  90% { clip-path: polygon(-1% 3%, 98% 4%, 94% 100%, 5% 95%);}
  100% { clip-path: polygon(0% 2%, 99% 7%, 94% 99%, 4% 94%);}
}

/* 반응형 */
@media screen and (max-width: 1024px) {
  #map-select-panel {
    width: 350px;
  }
}

@media screen and (max-width: 768px) {
  #map-select-panel {
    width: 300px;
  }
  
  .map-tab {
    padding: 12px 15px;
    font-size: 14px;
  }
}
