/* ==========================================================
   [역대 통계 - 1. 회차별 당첨 목록 전용 스타일]
========================================================== */
.list-info-note {
  font-size: 13px;
  color: #93C5FD;
}

.search-bar-box {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.history-search-input {
  width: 320px;
  max-width: 100%;
  flex: none;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--card-border);
  color: white;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14.5px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.history-search-input:focus {
  border-color: #38BDF8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.btn-history-search {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-history-search:hover {
  background: #2563EB;
  transform: translateY(-1px);
}

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

.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: 42px;
  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;
}

.pagesize-control-box {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.pagesize-label {
  font-size: 13px;
  color: #94A3B8;
  white-space: nowrap;
}

/* ==========================================================
   회차 테이블 및 당첨번호 가로 플렉스 정렬 스타일
   ========================================================== */
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  display: block;
}

.history-table {
  width: 100%;
  min-width: 820px;
  table-layout: fixed;
  border-collapse: collapse;
}

.history-table th,
.history-table td {
  padding: 12px 10px;
  text-align: center;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 당첨번호 6개 + 보너스번호 가로 나열 (flex) */
.draw-balls-row,
.balls-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  white-space: nowrap !important;
}

.mini-ball {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13.5px;
  font-weight: 800;
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
  user-select: none;
}

.bonus-ball {
  border: 2px solid #F59E0B;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.bonus-plus {
  color: var(--text-muted);
  font-weight: 900;
  font-size: 14px;
  margin: 0 3px;
  display: inline-flex;
  align-items: center;
  user-select: none;
}

/* 고정 너비 테이블 컬럼 디자인 (데이터 길이에 상관없이 불변) */
.col-round-num {
  width: 10%;
  min-width: 90px;
  font-weight: 800;
  color: var(--accent-gold);
  font-size: 14.5px;
  white-space: nowrap;
}

.col-date {
  width: 14%;
  min-width: 110px;
  color: var(--text-muted);
  font-size: 13px;
  white-space: nowrap;
}

.col-draw-balls {
  width: 36%;
  min-width: 320px;
}

.col-winner-cnt {
  width: 14%;
  min-width: 110px;
  font-size: 13.5px;
  color: #93C5FD;
  white-space: nowrap;
  font-weight: 600;
}

.col-prize {
  width: 14%;
  min-width: 130px;
  font-weight: 700;
  color: var(--text-main);
  font-size: 13.5px;
  white-space: nowrap;
}

.col-detail {
  width: 12%;
  min-width: 100px;
  white-space: nowrap;
}

.btn-detail-view {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #93C5FD;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-detail-view:hover {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

/* 모달 상세 스타일 */
.modal-title-wrap {
  display: flex;
  flex-direction: column;
}

.modal-round-title {
  font-size: 18px;
  font-weight: 800;
  color: #F1F5F9;
  margin: 0;
}

.modal-round-date {
  font-size: 13px;
  color: #94A3B8;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.2s;
}

.btn-close-modal:hover {
  color: #FFFFFF;
}

.modal-balls-summary {
  background: rgba(255, 255, 255, 0.03);
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.modal-field-label {
  font-size: 12px;
  color: #94A3B8;
  margin-bottom: 6px;
}

.modal-balls-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.modal-prize-box {
  text-align: right;
}

.modal-prize-amount {
  font-size: 16px;
  font-weight: 800;
  color: var(--accent-gold);
}

/* 모달 레이아웃 & 배경 */
.history-modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.history-modal-box {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  width: 100%;
  max-width: 960px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
  color: #F8FAFC;
}

.history-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(17, 24, 39, 0.95);
  position: sticky;
  top: 0;
  z-index: 10;
}

.history-modal-body {
  padding: 20px 24px;
}

/* 15대 조건 상세 그리드 & 카드 */
.history-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.detail-attr-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.2s, background 0.2s;
}

.detail-attr-card:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(59, 130, 246, 0.4);
}

.detail-attr-card .attr-label {
  font-size: 12px;
  font-weight: 600;
  color: #94A3B8;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.detail-attr-card .attr-val {
  font-size: 14px;
  font-weight: 700;
  color: #F1F5F9;
  word-break: break-all;
}

/* ==========================================================
   역대 회차 페이징 컨트롤러 스타일
   ========================================================== */
.history-pagination-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}

.history-page-btn,
.btn-page-nav,
.btn-page-num {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94A3B8;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.history-page-btn:hover:not(:disabled),
.btn-page-nav:hover:not(:disabled),
.btn-page-num:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.history-page-btn.active,
.btn-page-num.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);
}

.history-page-btn:disabled,
.btn-page-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
}

.history-page-info {
  font-size: 13px;
  color: #94A3B8;
  margin: 0 8px;
  font-weight: 600;
}

.history-page-jump-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.history-page-jump-input {
  width: 56px;
  height: 32px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #60A5FA;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  outline: none;
  box-sizing: border-box;
  -moz-appearance: textfield;
  appearance: textfield;
  transition: all 0.2s;
}

.history-page-jump-input::-webkit-outer-spin-button,
.history-page-jump-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.history-page-jump-input:focus {
  border-color: #3B82F6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.btn-history-page-jump {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid #3B82F6;
  color: #93C5FD;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-history-page-jump:hover {
  background: #3B82F6;
  color: #FFFFFF;
}
