/**
 * customdetail.css
 * 맞춤 상세 분석 (카테고리 다중 선택형 회차 목록 분석기) 전용 스타일시트
 */

.custom-detail-card {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  margin-bottom: 24px;
}

.custom-detail-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  background: rgba(30, 41, 59, 0.4);
}

.custom-detail-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.custom-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.custom-title-badge {
  background: linear-gradient(135deg, #3B82F6, #8B5CF6);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.custom-detail-desc {
  margin: 0;
  font-size: 13px;
  color: #94A3B8;
  line-height: 1.5;
}

.custom-detail-desc strong {
  color: #60A5FA;
}

/* 프리셋 & 초기화 버튼 */
.custom-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-custom-preset {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #CBD5E1;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-custom-preset:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(96, 165, 250, 0.4);
  color: #93C5FD;
}

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

.btn-custom-reset {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #F87171;
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 13px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-custom-reset:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #EF4444;
  color: #FCA5A5;
}

/* 본문 레이아웃 */
.custom-detail-content {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* 1. 카테고리 셀렉터 영역 */
.custom-selector-container {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 상단: select 박스와 카운터/초기화 버튼 행 */
.custom-select-top-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.custom-select-box-wrap {
  flex-shrink: 0;
  width: 250px;
}

.custom-condition-select {
  width: 100%;
  background: #0F172A;
  border: 1.5px solid rgba(59, 130, 246, 0.5);
  color: #FFFFFF;
  padding: 9px 14px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 700;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.custom-condition-select:hover {
  border-color: #60A5FA;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.35);
}

.custom-condition-select:focus {
  border-color: #3B82F6;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.45);
}

.custom-condition-select option {
  background: #0F172A;
  color: #F8FAFC;
  font-weight: 600;
  padding: 7px 10px;
  font-size: 13px;
}

.custom-condition-select option:disabled {
  color: #475569;
  background: #0B1120;
}

.selector-counter-box {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  flex-wrap: wrap;
  flex: 1;
}

.counter-label {
  color: #94A3B8;
  font-weight: 600;
}

.counter-badge {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(96, 165, 250, 0.4);
  color: #60A5FA;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 13.5px;
}

.counter-hint {
  color: #64748B;
  font-size: 12px;
}

.btn-custom-reset-mini {
  margin-left: auto;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #F87171;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-custom-reset-mini:hover {
  background: rgba(239, 68, 68, 0.28);
  border-color: #EF4444;
  color: #FCA5A5;
}

/* 하단: 선택된 항목 태그 영역 (select 박스 아래) */
.selected-tags-container {
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.selected-tags-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 32px;
  align-items: center;
}

.selected-tag-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(139, 92, 246, 0.25));
  border: 1px solid rgba(96, 165, 250, 0.5);
  color: #E2E8F0;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  animation: tagPop 0.2s ease-out;
}

@keyframes tagPop {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.tag-remove-btn {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  line-height: 1;
}

.tag-remove-btn:hover {
  color: #EF4444;
}

/* 2. 컨트롤 바 (검색 / 정렬 버튼 / 개수) */
.custom-control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 10px 18px;
  border-radius: 12px;
}

.custom-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  flex-wrap: wrap;
}

.custom-search-input {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  width: 280px;
  max-width: 100%;
  flex: none;
  outline: none;
  transition: border-color 0.2s;
}

.custom-search-input:focus {
  border-color: #3B82F6;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}

.btn-custom-search {
  background: #2563EB;
  border: none;
  color: #FFFFFF;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
  height: 35px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-custom-search:hover {
  background: #1D4ED8;
}

.custom-sort-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-custom-sort {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #CBD5E1;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 18px;
  min-width: 120px;
  height: 35px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

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

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

.btn-custom-sort .sort-icon {
  font-size: 11px;
}

.custom-total-text {
  font-size: 13px;
  font-weight: 700;
  color: #F59E0B;
}

/* 3. 테이블 영역 & 무한 스크롤 */
.custom-table-container {
  max-height: 640px;
  overflow-y: auto;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.6);
  -webkit-overflow-scrolling: touch;
}

.custom-analysis-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

.custom-analysis-table th {
  background: rgba(30, 41, 59, 0.98);
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 11px 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: #94A3B8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
  white-space: nowrap;
}

.custom-analysis-table td {
  padding: 9px 8px;
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 13px;
  white-space: nowrap;
}

.custom-analysis-table tbody tr:hover {
  background: rgba(59, 130, 246, 0.08);
}

/* 기본 고정 컬럼 */
.col-c-round {
  width: 68px;
  color: #60A5FA;
  font-weight: 800;
}

.col-c-balls {
  width: 178px;
  min-width: 178px;
}

.col-c-balls .reg-balls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.col-c-balls .mini-ball {
  width: 21px;
  height: 21px;
  font-size: 10.5px;
}

.col-c-balls .bonus-plus {
  font-size: 10px;
  margin: 0 1px;
}

/* 동적 속성 컬럼 셀 뱃지/텍스트 */
.col-dynamic-attr {
  width: 95px;
  min-width: 80px;
  max-width: 110px;
  font-size: 12.5px;
}

.custom-attr-badge {
  display: inline-block;
  padding: 2.5px 7px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-blue {
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(96, 165, 250, 0.4);
  color: #93C5FD;
}

.badge-purple {
  background: rgba(139, 92, 246, 0.18);
  border: 1px solid rgba(167, 139, 250, 0.4);
  color: #C4B5FD;
}

.badge-emerald {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: #6EE7B7;
}

.badge-amber {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #FCD34D;
}

.badge-rose {
  background: rgba(244, 63, 94, 0.18);
  border: 1px solid rgba(251, 113, 133, 0.4);
  color: #FDA4AF;
}

/* 무한 스크롤 인디케이터 */
.infinite-scroll-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  color: #94A3B8;
  font-size: 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(15, 23, 42, 0.4);
}

.scroll-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(96, 165, 250, 0.2);
  border-top-color: #60A5FA;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 900px) {
  .custom-detail-content {
    padding: 14px 16px;
  }
  .custom-select-top-bar {
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }
  .custom-select-box-wrap {
    width: 220px;
  }
  .custom-search-input {
    width: 180px;
  }
  .btn-custom-sort {
    min-width: 110px;
    padding: 8px 12px;
  }
}

@media (max-width: 600px) {
  .custom-select-top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .custom-select-box-wrap {
    width: 100%;
  }
  .selector-counter-box {
    width: 100%;
  }
  .custom-search-wrap {
    width: 100%;
  }
  .custom-search-input {
    flex: 1;
    width: auto;
    min-width: 140px;
  }
}
