/* ══════════════════════════════════════════════════
   widgets.css
   Fear & Greed + 히트맵
══════════════════════════════════════════════════ */

/* ════════════════════════
   Fear & Greed Card
════════════════════════ */

.fng-card {
    cursor: default !important;
    min-width: 120px;
}

.fng-card:hover {
    border-color: var(--border-color) !important;
    box-shadow: none !important;
    transform: none !important;
}

.fng-gauge-wrap {
    width: 80px;
    margin: 4px auto 2px;
}

.fng-gauge {
    width: 100%;
    height: auto;
    display: block;
    overflow: visible;
}

/* 트랙 (회색 반원) */
.fng-track {
    fill: none;
    stroke: #2a3441;
    stroke-width: 8;
    stroke-linecap: round;
}

/* 채워지는 반원 */
.fng-fill {
    fill: none;
    stroke: #3fb950;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 0 125.66;
    transition: stroke-dasharray 0.8s cubic-bezier(0.4,0,0.2,1), stroke 0.6s;
}

/* 숫자 */
.fng-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 18px;
    font-weight: 700;
    text-anchor: middle;
    dominant-baseline: auto;
    fill: #e6edf3;
    transition: fill 0.6s;
}

/* 라벨 */
.fng-label {
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    color: #8b95a8;
    letter-spacing: 0.3px;
    transition: color 0.6s;
    margin-top: 2px;
}

/* ════════════════════════
   히트맵 섹션
════════════════════════ */

.heatmap-section {
    margin-bottom: 20px;
}

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

.heatmap-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
}

.heatmap-legend {
    display: flex;
    gap: 12px;
    align-items: center;
}

.hm-leg-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-tertiary);
}

.hm-leg-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* 히트맵 그리드 */
.heatmap-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    width: 100%;
}

/* 타일 */
.hm-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 52px;
    height: 56px;
    border-radius: 5px;
    cursor: default;
    transition: background 0.6s, filter 0.2s;
    flex-basis: 52px;
    overflow: hidden;
    padding: 4px 2px;
}

.hm-tile:hover {
    filter: brightness(1.15);
    z-index: 1;
}

.hm-symbol {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    line-height: 1;
}

.hm-change {
    font-size: 10px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1;
}

/* ════════════════════════
   모바일
════════════════════════ */

@media (max-width: 768px) {
    .fng-card {
        min-width: 100px;
    }

    .fng-gauge-wrap {
        width: 64px;
    }

    .fng-num {
        font-size: 15px;
    }

    .hm-tile {
        height: 48px;
        min-width: 44px;
        flex-basis: 44px;
    }

    .hm-symbol { font-size: 10px; }
    .hm-change { font-size: 9px; }
}

@media (max-width: 480px) {
    .heatmap-section {
        margin-bottom: 14px;
    }

    .hm-tile {
        height: 44px;
        min-width: 40px;
        flex-basis: 40px;
    }
}

/* ════════════════════════
   PC: market-overview 6개 일렬
════════════════════════ */
@media (min-width: 769px) {
    .market-overview {
        grid-template-columns: repeat(6, 1fr);
    }

    /* 카드 내부 패딩 살짝 줄여서 공간 확보 */
    .market-card {
        padding: 12px 12px;
    }

    .market-name {
        font-size: 10px;
    }

    .market-price {
        font-size: 17px;
    }

    .fng-gauge-wrap {
        width: 68px;
    }
}

/* ════════════════════════
   모바일: 거래소 1줄 / 검색+버튼 2줄
════════════════════════ */
@media (max-width: 768px) {
    /* controls: flex wrap 2줄 */
    .controls {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center;
        gap: 6px !important;
        margin-bottom: 0px;
    }

    /* 1줄: 거래소 선택 2개 → flex 0 auto */
    .controls .control-group {
        flex: 0 0 auto !important;
    }

    /* 2줄: 검색창이 줄바꿈 후 flex-grow */
    .controls #search {
        flex: 1 1 0 !important;
        width: 0 !important;
        min-width: 80px !important;
        order: 10;  /* 거래소 다음 줄로 */
    }

    /* 계산기 버튼들도 2줄로 */
    .kimp-calc-btn {
        order: 11;
        flex: 0 0 auto !important;
        margin-left: 0 !important;
    }

    .liq-calc-btn {
        order: 12;
        flex: 0 0 auto !important;
    }

    /* 아이콘만 표시 */
    .kimp-calc-btn span,
    .liq-calc-btn span {
        display: none !important;
    }

    .kimp-calc-btn,
    .liq-calc-btn {
        padding: 8px 10px !important;
        gap: 0 !important;
        min-width: 36px;
        justify-content: center;
    }

    .kimp-calc-btn svg,
    .liq-calc-btn svg {
        width: 15px !important;
        height: 15px !important;
    }
}
