body {
  margin: 0;
  padding: 10px;
  font-family: '맑은 고딕', Arial, sans-serif;
  background-color: #f8f9fa;
}

.main-container {
  display: flex;
  gap: 15px;
  height: calc(100vh - 220px); /* 헤더/패딩 고려해 여유 */
  min-height: 600px;
  min-width: 0; /* 자식 flex 오버플로 방지 */
}

.graph-container {
  flex: 6;
  min-width: 0px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 10px 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 440px;
  max-height: 675px;     /* 그래프가 너무 길어지지 않도록 상한 */
}

.graph-container .dash-graph {
  flex: 1;
  min-height: 0;
}


/* 전체 컨트롤 바 컨테이너 */
.controls-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

/* 각 블록(기간 / 봉 타입 / 보조지표) 카드 */
.control-card {
    background: #f8f9fb;
    border-radius: 8px;
    padding: 10px 14px;
    border: 1px solid #e1e4ea;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* 마지막 카드(삼성자산운용 박스)를 오른쪽 끝으로 밀기 */
.controls-container .control-card:last-child {
    border: none;
    background: transparent;
    box-shadow: none;
    padding-left: 0;
    padding-right: 0;
    margin-left: auto;
}


/* 카드 제목 (기간 / 봉 타입 / 보조지표) */
.control-title {
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    letter-spacing: 1px;
    text-transform: uppercase;
}


/* 공통: 인풋은 숨기고 라벨을 버튼처럼 사용 */
.button-group-input, .pill-group-input {
    display: none;
}


/* 기간/봉 타입 버튼 그룹 라벨 기본 스타일 */
.button-group-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    margin-right: 6px;
    font-size: 13px;
    border-radius: 6px;
    border: 1px solid #d0d4dc;
    background-color: #ffffff;
    color: #495057;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    user-select: none;
}

.button-group-label:last-child {
    margin-right: 0;
}


/* hover 시 */
.button-group-label:hover {
    background-color: #f1f3f5;
}


/* 선택된 라디오(기간/봉) */
.button-group .button-group-input:checked + .button-group-label {
    background-color: #2c7be5;
    color: #ffffff;
    border-color: #2c7be5;
    font-weight: 600;
}


/* 보조지표 pill 스타일 */
.pill-group-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    margin-right: 6px;
    font-size: 12px;
    border-radius: 999px;
    border: 1px solid #d0d4dc;
    background-color: #ffffff;
    color: #495057;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    user-select: none;
}

.pill-group-label:last-child {
    margin-right: 0;
}

.pill-group-label:hover {
    background-color: #f1f3f5;
}


/* 선택된 보조지표 pill */
.pill-group .pill-group-input:checked + .pill-group-label {
    background-color: #20c997;
    color: #ffffff;
    border-color: #20c997;
    font-weight: 600;
}

.indicator-logo {
    height: 22px;
    width: auto;
    margin-left: 12px;
    opacity: 0.9;
}

.indicator-logo:hover {
    opacity: 1.0;
}

.right-sidebar {
  flex: 4;
  min-width: 350px;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-height: 0; /* 내부 스크롤 정상화 */
}

.prediction-box-container {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  overflow: hidden;
  flex-shrink: 0;
}

.table-container {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  overflow: auto;
}

/* 반응형 */
@media (max-width: 1200px) {
  .main-container {
      flex-direction: column;
      height: auto;
      min-height: 0;
  }
  .graph-container {
      min-width: unset;
      max-height: 480px;
  }
  .right-sidebar {
      min-width: unset;
      max-width: unset;
  }
}

@media (max-width: 768px) {
  body { padding: 5px; }
  .main-container { gap: 10px; }
  .graph-container { max-height: 420px; }
  .right-sidebar { gap: 10px; }
  .prediction-box-container, .table-container { padding: 10px; }
}


/* 스크롤바 */
.table-container::-webkit-scrollbar { width: 6px; height: 6px; }
.table-container::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 3px; }
.table-container::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }
.table-container::-webkit-scrollbar-thumb:hover { background: #a1a1a1; }


/* 갱신 애니매이션 */
@keyframes highlight-flash {
    0% {
        background-color: #fff7e6;
    }
    50% {
        background-color: #ffe0b2;
    }
    100% {
        background-color: #ffffff;
    }
}

.prediction-highlight {
    animation: highlight-flash 2s ease-out;
}

@keyframes cell-highlight-flash {
    0% {
        background-color: #fff7e6;  /* 시작: 연노랑 */
    }
    50% {
        background-color: #ffe0b2;  /* 중간: 더 진한 노랑/오렌지 */
    }
    100% {
        background-color: #fafafa;  /* 끝: 흰색 */
    }
}

.dash-cell {
    /* 기본 스타일 건드리지 않음 */
}

.dash-cell[style*="background-color: #fafafa"],
.dash-cell[style*="background-color:#fafafa"],
.dash-cell[style*="background-color: rgb(250, 250, 250)"] {
    animation: cell-highlight-flash 2s ease-out;
}

