/* ══════════════════════════════════════════════════
   market-chart-panel.css
   - Market Overview 카드 클릭 시 나타나는 인라인 차트 패널
   - chart-panel.css 디자인 언어와 동일
══════════════════════════════════════════════════ */

/* 카드 클릭 가능 표시 */
.mkt-clickable {
    cursor: pointer;
    transition: border-color 0.18s, box-shadow 0.18s, transform 0.15s;
}

.mkt-clickable:hover {
    border-color: #39d0d8;
    box-shadow: 0 0 0 1px rgba(57, 208, 216, 0.4);
    transform: translateY(-1px);
}

.mkt-card-active {
    border-color: #39d0d8 !important;
    box-shadow: 0 0 0 2px rgba(57, 208, 216, 0.25) !important;
}

/* ══════════════════════════════════════════════════
   패널 래퍼
══════════════════════════════════════════════════ */
.mkt-chart-panel {
    width: 100%;
    overflow: hidden;
    max-height: 0;
    border-radius: 10px;
    background: #0d1117;
    border: 1px solid #1e2a38;
    border-bottom: 2px solid #39d0d8;
    margin-bottom: 16px;
    box-sizing: border-box;
    transition: max-height 0.38s cubic-bezier(0.4, 0, 0.2, 1),
                opacity    0.3s ease;
    opacity: 0;
}

.mkt-chart-panel.mkt-panel-open {
    max-height: 480px;
    opacity: 1;
}

/* ══════════════════════════════════════════════════
   헤더
══════════════════════════════════════════════════ */
.mkt-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #131722;
    border-bottom: 1px solid #1e2a38;
    height: 48px;
    box-sizing: border-box;
}

.mkt-chart-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mkt-chart-name {
    font-size: 14px;
    font-weight: 700;
    color: #e6edf3;
}

/* 닫기 버튼 */
.mkt-chart-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: #1c2333;
    border-radius: 50%;
    cursor: pointer;
    color: #636e7c;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}

.mkt-chart-close:hover {
    background: #2a3441;
    color: #e6edf3;
}

.mkt-chart-close svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    stroke-width: 2.5;
    fill: none;
    stroke-linecap: round;
    display: block;
}

/* ══════════════════════════════════════════════════
   차트 body
══════════════════════════════════════════════════ */
.mkt-chart-body {
    position: relative;
    width: 100%;
    height: 380px;
    background: #131722;
}

.mkt-chart-body > div,
.mkt-chart-body iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none;
}

/* 로딩 */
.mkt-chart-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #131722;
    z-index: 2;
}

.mkt-chart-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #2a3441;
    border-top-color: #39d0d8;
    border-radius: 50%;
    animation: mktSpin 0.75s linear infinite;
}

.mkt-chart-loading span {
    font-size: 12px;
    color: #636e7c;
}

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

/* ══════════════════════════════════════════════════
   모바일
══════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .mkt-chart-panel.mkt-panel-open { max-height: 460px; }
    .mkt-chart-body { height: 400px; }
}

@media (max-width: 480px) {
    .mkt-chart-panel.mkt-panel-open { max-height: 420px; }
    .mkt-chart-body { height: 360px; }
    .mkt-chart-header { padding: 8px 12px; }
}

/* 외부링크 카드 - 새창 아이콘 힌트 */
.mkt-clickable[data-mkt-id="sp500"]::after,
.mkt-clickable[data-mkt-id="nasdaq"]::after,
.mkt-clickable[data-mkt-id="kospi"]::after {
    content: '↗';
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 11px;
    color: #636e7c;
    opacity: 0;
    transition: opacity 0.2s;
}
.mkt-clickable[data-mkt-id="sp500"],
.mkt-clickable[data-mkt-id="nasdaq"],
.mkt-clickable[data-mkt-id="kospi"] {
    position: relative;
}
.mkt-clickable[data-mkt-id="sp500"]:hover::after,
.mkt-clickable[data-mkt-id="nasdaq"]:hover::after,
.mkt-clickable[data-mkt-id="kospi"]:hover::after {
    opacity: 1;
}
