/**
 * [Purpose] : 홈 화면의 오른쪽 사이드바(엔티티 리스트, 상세 정보 패널), 커스텀 오버레이 및 날씨 카드의 UI를 정의하는 스타일시트
 * [Dependencies] : index.html (템플릿), home_panels.js (패널 전환), home_data.js (날씨 정보 업데이트)
 * [Data Flow] : N/A (상수 및 스타일 정의)
 * [Side Effects] : 
 *   - UI (DOM) 스타일링: 사이드바(#sidebar), 엔티티 리스트(#entity-list-panel), 상세 정보 패널(#entity-panel) 및 탭(.ep-tabs) 제어
 *   - 지도 오버레이: .custom-overlay 클래스를 통한 지도 위 풍선 도움말 스타일링
 *   - 마커 애니메이션: .e-dot 마커 호버 시 scale(1.3) 확대 효과 적용
 * [Constraints / Notes] : 
 *   - 사이드바 폭: width: 320px로 고정되어 있으며 flex-shrink: 0 속성이 부여되어 레이아웃 유지
 *   - 오버레이 높이: .ev-content(72px) 및 상세 섹션의 스크롤바 커스터마이징을 통해 한정된 공간 내 정보 표시 최적화
 *   - 배지 구분: .el-sub-label의 클래스(ev, attr, data)에 따라 배경색을 다르게 적용하여 정보 유형 시각화
 */

/* ─── Entity 마커 ─────────────────────────────── */
.e-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: transform .1s;
}

.e-dot:hover {
  transform: scale(1.3);
}

.e-dot-private {
  opacity: 0.55;
}

/* ─── 기사 팝업 ───────────────────────────────── */
.custom-overlay {
  position: absolute;
  background: white;
  border-radius: 10px;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.2);
  padding: 12px 14px;
  font-size: 13px;
  min-width: 220px;
  max-width: 280px;
}

.custom-overlay .ov-close {
  position: absolute;
  top: 7px;
  right: 9px;
  cursor: pointer;
  font-size: 16px;
  color: #999;
}

.custom-overlay h6 {
  font-size: 13px;
  font-weight: 600;
  margin: 4px 0 8px;
  line-height: 1.4;
}

.custom-overlay .ov-meta {
  font-size: 12px;
  color: #555;
  margin-bottom: 6px;
}

.custom-overlay .ov-btn {
  display: block;
  text-align: center;
  padding: 5px;
  border: 1px solid #1a73e8;
  border-radius: 5px;
  color: #1a73e8;
  text-decoration: none;
  font-size: 12px;
  margin-top: 6px;
}

.custom-overlay .ov-btn:hover {
  background: #1a73e8;
  color: white;
}

/* ─── 사이드바 ────────────────────────────────── */
#sidebar {
  width: 320px;
  min-width: 320px;
  align-self: stretch;
  background: #ffffff;
  border-left: 1px solid #e8eaed;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: hidden;
  flex-shrink: 0;
}

#sidebar::-webkit-scrollbar {
  width: 5px;
}

#sidebar::-webkit-scrollbar-track {
  background: transparent;
}

#sidebar::-webkit-scrollbar-thumb {
  background: #d0d7de;
  border-radius: 3px;
}

#sidebar::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}

.sidebar-logo {
  padding: 16px 18px 14px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  flex-direction: column;
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  color: #2d3748;
  letter-spacing: -0.5px;
}

.logo-text span {
  color: #1a73e8;
}

.logo-sub {
  font-size: 11px;
  color: #888;
  margin-top: 1px;
}

.sidebar-auth a {
  font-size: 12px;
  color: #666;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 5px;
  border: 1px solid #ddd;
}

.sidebar-auth a:hover {
  background: #f5f5f5;
}

.sidebar-auth .sep {
  color: #ccc;
  margin: 0 4px;
}

/* ─── 날씨 카드 ───────────────────────────────── */
.weather-card {
  margin: 12px 16px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
  border-radius: 10px;
  border-left: 4px solid #1a73e8;
  font-size: 13px;
  font-weight: 500;
  color: #1a237e;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.weather-card i {
  font-size: 16px;
  color: #1a73e8;
}

#weather-text,
#dust-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Entity List Panel ────────────────────────── */
#entity-list-panel {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.el-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px 6px;
  border-bottom: 1px solid #f0f0f0;
  background: #fafafa;
  flex-shrink: 0;
}

#side-list-container {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#el-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.el-item {
  border-bottom: 1px solid #f0f0f0;
  padding: 8px 14px;
  cursor: pointer;
  transition: background .12s;
}

.el-item:hover {
  background: #f0f6ff;
}

.el-item-name {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 2px;
}

.el-item-type {
  font-size: 10px;
  color: #888;
  margin-bottom: 4px;
}

.el-sub-item {
  font-size: 11px;
  color: #4a5568;
  padding: 2px 0 2px 8px;
  border-left: 2px solid #e2e8f0;
  margin-bottom: 2px;
  line-height: 1.4;
}

.el-sub-date {
  color: #999;
  font-size: 10px;
  margin-left: 5px;
}

.el-sub-label {
  display: inline-block;
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 3px;
  margin-right: 4px;
  font-weight: 600;
}

.el-sub-label.ev {
  background: #e8f4fd;
  color: #1a73e8;
}

.el-sub-label.attr {
  background: #f0fdf4;
  color: #16a34a;
}

.el-sub-label.data {
  background: #fef9e7;
  color: #d97706;
}

.ep-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.ep-back {
  background: none;
  border: none;
  color: #1a73e8;
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
}

.ep-back:hover {
  text-decoration: underline;
}

/* ─── Entity 패널 ─────────────────────────────── */
#entity-panel {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#ep-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.ep-section {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.ep-section::-webkit-scrollbar {
  width: 5px;
}

.ep-section::-webkit-scrollbar-track {
  background: transparent;
}

.ep-section::-webkit-scrollbar-thumb {
  background: #d0d7de;
  border-radius: 3px;
}

.ep-section::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}

.panel-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: #bbb;
  font-size: 13px;
  padding: 40px 20px;
  text-align: center;
}

.panel-empty i {
  font-size: 36px;
  color: #ddd;
}

.ep-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid #f0f0f0;
  background: #fafafa;
}

.ep-header .ep-name {
  font-size: 15px;
  font-weight: 700;
  color: #222;
  margin-bottom: 2px;
}

.ep-header .ep-type {
  font-size: 11px;
  color: #999;
}

.ep-header .ep-close {
  background: none;
  border: none;
  color: #aaa;
  font-size: 16px;
  cursor: pointer;
}

.ep-header .ep-close:hover {
  color: #555;
}

.ep-tabs {
  display: flex;
  border-bottom: 1px solid #eee;
}

.ep-tab {
  flex: 1;
  padding: 9px 0;
  font-size: 12px;
  font-weight: 600;
  color: #999;
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all .15s;
}

.ep-tab.active {
  color: #1a73e8;
  border-bottom-color: #1a73e8;
}

.attr-table {
  width: 100%;
  font-size: 13px;
  border-collapse: collapse;
}

.attr-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #f5f5f5;
  vertical-align: top;
}

.attr-table td:first-child {
  font-weight: 600;
  color: #444;
  white-space: nowrap;
  width: 40%;
}

.ev-card {
  border-left: 3px solid #e8eaed;
  padding: 8px 12px;
  margin-bottom: 8px;
  font-size: 13px;
}

.ev-card:hover {
  border-left-color: #1a73e8;
  background: #fafcff;
}

.ev-cat {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  background: #e8f0fe;
  color: #1a73e8;
  margin-right: 5px;
  font-weight: 600;
}

.ev-title {
  font-weight: 600;
  line-height: 1.4;
}

.ev-meta {
  font-size: 11px;
  color: #aaa;
  margin-top: 3px;
}

.ev-content {
  font-size: 12px;
  color: #666;
  margin-top: 5px;
  white-space: pre-wrap;
  max-height: 72px;
  overflow-y: auto;
  line-height: 1.5;
}

/* ─── 페이저 ──────────────────────────────────── */
.mini-pager {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-top: 1px solid #f0f0f0;
  font-size: 12px;
}

.mini-pager button {
  padding: 2px 9px;
  font-size: 11px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 4px;
  cursor: pointer;
}

.mini-pager button:disabled {
  opacity: 0.4;
  cursor: default;
}

.mini-pager button:not(:disabled):hover {
  background: #f5f5f5;
}

.mini-pager .pager-info {
  flex: 1;
  text-align: center;
  color: #888;
}

.per-select {
  font-size: 11px;
  padding: 2px 4px;
  border-radius: 4px;
  border: 1px solid #ddd;
}

.ep-section {
  padding: 12px 14px;
  flex: 1;
}

/* ─── 스크롤바 ────────────────────────────────── */
#entity-panel::-webkit-scrollbar {
  width: 4px;
}

#entity-panel::-webkit-scrollbar-track {
  background: #f5f5f5;
}

#entity-panel::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 4px;
}

/* ─── 원래대로 버튼 활성화/비활성화 애니메이션 ─── */
#btn-revert-panel4 {
  /* 상태가 변할 때 부드럽게 전환되도록 애니메이션 추가 */
  transition: all 0.3s ease-in-out !important;
}

#btn-revert-panel4:not(:disabled) {
  /* 버튼이 활성화(disabled가 아님) 되었을 때의 스타일 */
  background: #1a73e8 !important;
  border-color: #1a73e8 !important;
  color: #ffffff !important;
  font-weight: 600 !important;

  /* 파랗게 빛나는 네온사인(Glow) 효과 */
  box-shadow: 0 0 10px rgba(26, 115, 232, 0.6) !important;
}