/* Indicator Page Styles - Slate 기반 플랫 디자인 */

/* Chart Section */
.chart-section {
    padding: 1rem 0;
    margin-bottom: 0;
    border-bottom: 1px solid var(--color-border);
}

.date-range-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.data-range-button {
    padding: 6px 12px;
    border: 1px solid var(--color-border-strong);
    background: transparent;
    color: var(--color-text-secondary);
    border-radius: 16px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.data-range-button:hover {
    border-color: var(--slate-400);
    color: var(--color-text);
}

.data-range-button:active {
    transform: scale(0.95);
}

/* Active 버튼 - Slate 기반 (파란색 제거) */
.data-range-button.active {
    border-color: var(--slate-700);
    background: var(--slate-700);
    color: white;
    font-weight: 600;
}

#chart-container {
    width: 100%;
    min-height: 280px;
    max-height: 400px;
    background: var(--color-bg-secondary);
    border-radius: 4px;
    border: 1px solid var(--color-border);
}

#chart-container svg {
    display: block;
    width: 100%;
    height: auto;
}

/* Chart Axis Styles */
.axis path,
.axis line {
    stroke: var(--color-border-strong);
}

.axis text {
    fill: var(--color-text-secondary);
    font-size: 11px;
}

/* Chart Line Styles */
.line {
    fill: none;
    stroke-width: 1.5px;
}

/* Grid Lines */
.grid-x,
.grid-y {
    stroke: var(--color-border);
    stroke-width: 1px;
}

/* Tooltip */
.tooltip {
    position: absolute;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--color-border-strong);
    border-radius: 6px;
    pointer-events: none;
    font-size: 12px;
    color: var(--color-text);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    z-index: 1000;
}

/* Mouse Interaction */
.mouse-line {
    stroke: var(--slate-400);
    stroke-width: 1px;
}

.mouse-per-line circle {
    stroke-width: 2px;
}

/* Slider Container */
.chart-slider-container {
    padding: 12px 0;
}

/* Custom Range Slider - Slate 기반 */
.custom-range {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--slate-200);
    outline: none;
    opacity: 0.8;
    transition: opacity 0.2s, background 0.2s;
}

.custom-range:hover {
    opacity: 1;
    background: var(--slate-300);
}

.custom-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--slate-600);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.custom-range::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--slate-600);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    border: none;
    transition: background 0.2s, transform 0.1s;
}

.custom-range::-webkit-slider-thumb:hover {
    background: var(--slate-700);
    transform: scale(1.1);
}

.custom-range::-moz-range-thumb:hover {
    background: var(--slate-700);
    transform: scale(1.1);
}

.custom-range::-webkit-slider-runnable-track {
    border-radius: 3px;
    height: 6px;
}

.custom-range::-moz-range-track {
    border-radius: 3px;
    height: 6px;
}

/* Legend Container */
.legend-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 0;
}

/* Legend Item */
.legend-item {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 6px;
    background-color: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    box-sizing: border-box;
}

.legend-item:hover {
    background-color: var(--slate-100);
    border-color: var(--slate-300);
}

/* Legend Color Indicator */
.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    margin-right: 8px;
    flex-shrink: 0;
}

/* Legend Name */
.legend-name {
    flex: 1;
    font-size: 12px;
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Legend Checkbox - Slate 기반 */
.legend-checkbox {
    margin-right: 8px;
    flex-shrink: 0;
    accent-color: var(--slate-600);
}

/* Category Container (hidden) */
#category-container {
    display: none;
}

.category-item {
    margin-bottom: 4px;
}

/* Responsive Legend Layout */
@media (min-width: 768px) {
    .legend-item {
        width: calc(33.33% - 6px);
        flex: 0 0 calc(33.33% - 6px);
    }
}

@media (max-width: 767px) and (min-width: 480px) {
    .legend-item {
        width: calc(50% - 4px);
        flex: 0 0 calc(50% - 4px);
    }
}

@media (max-width: 479px) {
    .legend-item {
        width: 100%;
        flex: 0 0 100%;
    }
}

/* Section Titles */
.section-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--color-text);
}

/* Indicator Section - 플랫 디자인 */
.indicator-section {
    padding: 1rem 0;
    margin-bottom: 0;
    border-bottom: 1px solid var(--color-border);
}

.indicator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

/* Indicator Card - 플랫 스타일 */
.indicator-card {
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
}

.indicator-card:last-child {
    border-bottom: none;
}

.indicator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.indicator-symbol {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text);
}

.indicator-date {
    font-size: 10px;
    color: var(--color-text-muted);
}

.indicator-value {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

/* 상승/하락 색상 - Slate 기반 */
.indicator-value.red {
    color: #dc2626;
}

.indicator-value.blue {
    color: var(--slate-600);  /* 파란색 대신 Slate */
}

.indicator-value.gray {
    color: var(--color-text-secondary);
}

.indicator-meta {
    display: flex;
    gap: 4px;
    font-size: 10px;
}

.meta-label {
    color: var(--color-text-muted);
}

.meta-value {
    color: var(--color-text);
}

/* Canary Section - 플랫 디자인 */
.canary-section {
    padding: 1rem 0;
    margin-bottom: 0;
    border-bottom: 1px solid var(--color-border);
}

.canary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

/* Canary Card - 플랫 스타일 */
.canary-card {
    overflow: hidden;
}

.canary-header {
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.canary-header h3 {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin: 0;
}

.canary-total {
    font-size: 12px;
    font-weight: 600;
}

.canary-total.positive {
    color: #dc2626;
}

.canary-total.negative {
    color: var(--slate-600);  /* 파란색 대신 Slate */
}

/* 카나리아 바디 */
.canary-body {
    padding: 0;
}

/* 행 스타일 */
.canary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
}

.canary-row:last-child {
    border-bottom: none;
}

/* 심볼 */
.canary-symbol {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
    min-width: 55px;
}

/* 합계 값 */
.canary-sum {
    font-size: 13px;
    font-weight: 600;
    min-width: 45px;
    text-align: right;
    margin-right: 12px;
}

.canary-sum.positive {
    color: #dc2626;
}

.canary-sum.negative {
    color: var(--slate-600);  /* 파란색 대신 Slate */
}

/* 기간별 지표 컨테이너 */
.canary-periods {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* 개별 기간 박스 - Slate 기반 */
.canary-period {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 46px;
    padding: 4px 5px;
    border-radius: 4px;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
}

.canary-period.up {
    background: #fef2f2;
    border-color: #fecaca;
}

.canary-period.down {
    background: var(--slate-50);   /* 파란색 대신 Slate */
    border-color: var(--slate-200);
}

/* 기간 레이블 */
.period-label {
    font-size: 9px;
    font-weight: 500;
    color: var(--color-text-muted);
    margin-bottom: 1px;
}

/* 기간 값 */
.period-value {
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.period-value.up {
    color: #dc2626;
}

.period-value.down {
    color: var(--slate-600);  /* 파란색 대신 Slate */
}

/* Links Section - 플랫 디자인 */
.links-section {
    padding: 1rem 0;
    font-size: 12px;
}

.link-group {
    margin-bottom: 8px;
}

.link-group:last-child {
    margin-bottom: 0;
}

.link-label {
    color: var(--color-text-muted);
    margin-right: 8px;
}

.links-section a {
    color: var(--color-text);
    text-decoration: none;
    margin-right: 8px;
    transition: color var(--transition);
}

/* 링크 호버 - Slate 기반 (파란색 제거) */
.links-section a:hover {
    color: var(--slate-600);
    text-decoration: underline;
    text-decoration-color: var(--slate-400);
}

/* 모바일 반응형 */
@media (max-width: 600px) {
    .indicator-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .canary-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .chart-section,
    .indicator-section,
    .canary-section,
    .links-section {
        padding: 0.75rem 0;
    }

    /* 모바일 차트 컨테이너 - 높이 줄임 */
    #chart-container {
        min-height: 180px;
        max-height: 240px;
        border-radius: 4px;
    }

    .chart-slider-container {
        padding: 8px 0;
    }

    .legend-container {
        padding: 8px 0;
        gap: 6px;
    }

    .indicator-grid {
        gap: 0;
    }

    .indicator-card {
        padding: 8px 0;
    }

    .canary-grid {
        gap: 8px;
    }

    .date-range-buttons {
        margin-bottom: 12px;
        gap: 6px;
    }

    .data-range-button {
        padding: 5px 10px;
        font-size: 11px;
    }
}

@media (max-width: 479px) {
    /* 더 작은 모바일에서 차트 높이 추가 조정 */
    #chart-container {
        min-height: 160px;
        max-height: 200px;
    }

    .canary-row {
        padding: 8px 0;
    }

    .canary-periods {
        gap: 3px;
    }

    .canary-period {
        min-width: 38px;
        padding: 3px 4px;
    }

    .period-label {
        font-size: 8px;
    }

    .period-value {
        font-size: 10px;
    }

    .canary-symbol {
        font-size: 12px;
        min-width: 45px;
    }

    .canary-sum {
        font-size: 11px;
        min-width: 38px;
        margin-right: 8px;
    }

    .indicator-value {
        font-size: 16px;
    }
}