/* ==========================================================
   periods.css - 최근 N주 구간 빈도 통계 (Hot & Cold) 전용 스타일시트
   (HTML 인라인 CSS 전면 분리 및 반응형 최적화)
   ========================================================== */

/* 기간 헤더 컨트롤 */
.period-header-controls {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

/* 범례 박스 */
.period-legend-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.6);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.period-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
}

.period-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot-hot {
  background: #EF4444;
}

.dot-normal {
  background: #3B82F6;
}

.dot-cold {
  background: #334155;
}

.period-legend-sep {
  color: #475569;
  font-size: 11px;
}

/* 기간 선택 드롭다운 영역 */
.period-select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.period-select-label {
  font-size: 13.5px;
  color: #94A3B8;
  font-weight: 600;
  white-space: nowrap;
}

.period-week-select {
  min-width: 130px;
  background: #0F172A;
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  outline: none;
}

/* 정렬 버튼 그룹 */
.period-sort-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* 정렬 버튼 공통 스타일 (list.css 와 통일) */
.btn-history-sort {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94A3B8;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-history-sort:hover {
  background: rgba(51, 65, 85, 0.85);
  color: #F8FAFC;
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-history-sort.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3B82F6;
  color: #60A5FA;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.25);
}

.btn-history-sort .sort-icon {
  font-size: 11px;
  opacity: 0.8;
}

.btn-history-sort.active .sort-icon {
  opacity: 1;
  color: #93C5FD;
}

/* 기간 선택 탭 버튼 그룹 */
.period-tabs-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.period-tab-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94A3B8;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.period-tab-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.2);
}

.period-tab-btn.active {
  background: linear-gradient(135deg, #3B82F6, #1D4ED8);
  color: #FFFFFF;
  border-color: #60A5FA;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

/* Hot & Cold 요약 카드 그리드 */
.period-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.hot-card {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 12px;
  padding: 16px;
}

.hot-card-title {
  font-size: 15px;
  font-weight: 800;
  color: #F87171;
  margin-bottom: 10px;
}

.cold-card {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 12px;
  padding: 16px;
}

.cold-card-title {
  font-size: 15px;
  font-weight: 800;
  color: #60A5FA;
  margin-bottom: 10px;
}

.period-num-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.period-num-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.chip-hot-cnt {
  font-size: 12px;
  font-weight: 700;
  color: #FCA5A5;
}

.chip-cold-cnt {
  font-size: 12px;
  font-weight: 700;
  color: #93C5FD;
}

.period-empty-msg {
  font-size: 13px;
  color: #94A3B8;
}

/* 기간 빈도 리스트 */
.period-freq-list-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.period-badge-hot {
  font-size: 11px;
  font-weight: 800;
  color: #EF4444;
  background: rgba(239, 68, 68, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  border: 1px solid rgba(239, 68, 68, 0.25);
}
