/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* ========================================
   점포모아 - Stores 페이지 스타일
   ======================================== */

/* 모바일 스크롤바 숨김 */
.mobile-scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.mobile-scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/* 커스텀 스크롤바 (데스크톱) */
.scrollbar-thin {
  scrollbar-width: thin;
  scrollbar-color: #475569 #1e293b;
}
.scrollbar-thin::-webkit-scrollbar {
  width: 8px;
}
.scrollbar-thin::-webkit-scrollbar-track {
  background: #1e293b;
  border-radius: 4px;
}
.scrollbar-thin::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 4px;
}
.scrollbar-thin::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* 메뉴 버튼 활성 상태 스타일 */
.menu-btn.active .left-indicator {
  height: 32px;
}
.menu-btn.active .top-indicator {
  width: 32px;
}
.menu-btn.active .bg-glow,
.menu-btn.active .mobile-bg {
  opacity: 100;
}
.menu-btn.active {
  color: white;
}

/* 패널 표시/숨김 */
#listPanel.show,
#mobileListPanel.show,
#mobileListFilterPanel.show {
  display: flex !important;
  pointer-events: auto;
}

/* 데스크톱: 패널 애니메이션 없음 (이미 relative 위치로 배치됨) */
@media (min-width: 768px) {
  #listPanel {
    display: flex !important;
    pointer-events: auto;
  }
  #listPanel:not(.show) {
    display: none !important;
  }
  /* 모바일 전용 패널은 데스크톱에서 완전히 숨김 */
  #mobileListPanel,
  #mobileListFilterPanel {
    display: none !important;
  }
}

/* 모바일: 바텀시트 설정 */
@media (max-width: 767px) {
  #listPanel {
    /* 바텀시트 높이 트랜지션 활성화 */
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  #listPanel.show {
    /* 초기 애니메이션 제거 (바텀시트가 높이 제어) */
    animation: none;
  }

  /* 모바일 전용 패널들 */
  #mobileListPanel,
  #mobileListFilterPanel {
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  #mobileListPanel.show,
  #mobileListFilterPanel.show {
    animation: none;
  }
}

/* 애니메이션 정의 */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translate(-50%, -20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes slideUp {
  from {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -20px);
  }
}

@keyframes slideUpPanel {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slide-down {
  animation: slideDown 0.3s ease-out;
}

.animate-slide-up {
  animation: slideUp 0.3s ease-out;
}

/* ========================================
   클러스터 선택 스타일 (성능 최적화)
   ======================================== */

/* 읍/면/동 클러스터 선택 상태 */
.eummyeondong-cluster-selected .cluster-label {
  background-color: white !important;
  color: #1d4ed8 !important;
  border: 2px solid #3b82f6 !important;
}

.eummyeondong-cluster-selected .cluster-count {
  background-color: white !important;
  border: 3px solid #3b82f6 !important;
  transform: none !important;
}

.eummyeondong-cluster-selected .cluster-count span {
  color: #2563eb !important;
}

/* MarkerClusterer 군집 클러스터 선택 상태 */
.marker-cluster-selected {
  background-color: white !important;
  border: 3px solid #3b82f6 !important;
  color: #3b82f6 !important;
  z-index: 1000 !important;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4) !important;
}

/* GPU 가속 활성화 (성능 향상) */
.eummyeondong-cluster-selected,
.marker-cluster-selected {
  will-change: transform;
  transform: translateZ(0);
}

/* ========================================
   모바일 바텀시트 스타일
   ======================================== */

/* 모바일 헤더/사이드바 자동 숨김 (모바일 전용) */
@media (max-width: 767px) {
  /* 헤더/사이드바 트랜지션 */
  .mobile-header {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
  }

  /* 기본: 상단 헤더 숨김 (위로 슬라이드) */
  .mobile-header.header-hidden-up {
    transform: translateY(-100%) !important;
  }

  /* 예외: 하단 사이드바 숨김 (아래로 슬라이드) */
  .mobile-header.header-hidden-up.bottom-0 {
    transform: translateY(100%) !important;
  }
}

/* 바텀시트 Full 모드 스타일 */
.bottom-sheet-full {
  border-radius: 0 !important;  /* 상단 모서리 각지게 */
}

/* 드래그 커서 */
.cursor-grab {
  cursor: grab;
}

.cursor-grab:active {
  cursor: grabbing;
}
