/* ================================================
   3195 - 국내주식 저평가 종목 찾기
   3176.css 구조 기반 + 저평가점수/상승률 스타일 추가
   ================================================ */

/* 반응형 컨테이너 너비 설정 */
@media (min-width: 1320px) {
  .postid-3195 #stock-table-header-3195,
  .postid-3195 #stock-table-container-3195,
  .postid-3195 .list-title-container {
    width: 1720px !important;
    max-width: 1720px !important;
    margin: 0 auto !important;
    position: relative !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
  }
}
@media (max-width: 1319px) {
  .postid-3195 #stock-table-header-3195,
  .postid-3195 #stock-table-container-3195,
  .postid-3195 .list-title-container {
    width: 100% !important;
    max-width: unset !important;
  }
}

/* 제목 및 헤더 컨트롤 */
.list-title-container { text-align: center; margin-bottom: 20px; }
.list-title-container h2 { font-size: 32px; font-weight: bold; color: #333; }

#stock-table-header-3195 {
  display: flex; justify-content: space-between; align-items: center;
  background: #f8f9fa; padding: 16px; border-radius: 10px; margin-bottom: 16px;
  flex-wrap: wrap; gap: 10px;
}
#stock-table-header-3195 select {
  padding: 10px 14px; border: none; border-radius: 30px;
  background: linear-gradient(135deg, #6fb1fc, #4364f7);
  color: #fff; font-weight: bold; cursor: pointer;
  box-shadow: 0 4px 10px rgba(67, 100, 247, 0.4);
}
#stock-table-header-3195 select.filter-active {
  background: linear-gradient(135deg, #ffc371, #ff5f6d);
}
#stock-search-input-3195 {
  padding: 10px 16px; border: 1px solid #ccc; border-radius: 30px; min-width: 200px;
}

/* --- [핵심] 테이블 스크롤 및 헤더 고정 --- */
#stock-table-container-3195 {
  overflow-x: auto;
  max-height: 900px;
  overflow-y: auto;
  border: 1px solid #dee2e6; border-radius: 10px;
  background-color: #fff;
  position: relative;
}

.stock-table {
  width: 100%; min-width: 1550px; border-collapse: separate;
  border-spacing: 0;
}

/* 헤더 고정 스타일 */
.stock-table th {
  background: #4a69bd; color: #fff; padding: 12px;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 2px solid #ccc;
}

.stock-table td {
  padding: 12px; border-bottom: 1px solid #e9ecef;
  white-space: nowrap; font-size: 15px;
}
.stock-table tr:hover { background-color: #e8f0ff; }

/* ── 3176 기본 컬럼 스타일 ── */
.align-right { text-align: right !important; }
.align-center { text-align: center !important; }
.highlight-blue { color: #3498db; font-weight: bold; }
.positive-text { color: #e74c3c !important; font-weight: bold; }

/* ── JS 동적 주입 클래스 ── */

/* 정렬 */
.ar { text-align: right !important; }
.ac { text-align: center !important; }

/* 시장 배지 */
.badge-market {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}
.badge-kospi {
  background: #e3f2fd;
  color: #1565c0;
}
.badge-kosdaq {
  background: #fff3e0;
  color: #e65100;
}

/* 기업명 */
.company-name-3195 {
  font-weight: 600;
  color: #333;
}

/* 종목코드 */
.ticker-code {
  color: #999;
  font-size: 13px;
  font-family: 'SF Mono', 'Consolas', monospace;
}

/* 시가총액 강조 */
.mcap-value {
  font-weight: 700;
  color: #555;
}

/* 자사주비율 강조 */
.treasury-highlight {
  color: #7b1fa2;
  font-weight: 700;
}

/* 수익률 색상 */
.return-pos { color: #e74c3c !important; font-weight: bold; }
.return-neg { color: #3498db !important; font-weight: bold; }
.return-zero { color: #999; }

/* ── [추가] 상승률 3개 컬럼 글자 크기 축소 ── */
.return-col {
  font-size: 13px !important;
}

/* ── [추가] 저평가 점수 등급별 색상 ── */
.score-top {
  font-weight: 900 !important;
  color: #d32f2f !important;
  font-size: 16px !important;
}
.score-high {
  font-weight: 800 !important;
  color: #7b1fa2 !important;
  font-size: 15px !important;
}
.score-mid {
  font-weight: 700 !important;
  color: #1565c0 !important;
}
.score-low {
  font-weight: 600;
  color: #888;
}

/* 모바일 대응 */
@media (max-width: 768px) {
  #stock-table-header-3195 { flex-direction: column; align-items: stretch; }
  .filter-controls { display: flex; flex-wrap: wrap; gap: 5px; justify-content: space-between; }
  #stock-table-header-3195 select { flex-grow: 1; }
}
