/* ==========================================
   백테스트 기록 피드
   ========================================== */



.backtest-record-ticker {
    position: relative;

    display: flex;
    align-items: center;

    width: 100%;
    max-width: 1500px;

    height: 52px;

    margin: 0 auto 9px;
    padding: 0 18px;

    box-sizing: border-box;

    background:
        linear-gradient(90deg,
            var(--card-orange-bg) 0%,
            var(--panel) 38%,
            var(--panel) 100%);

    border:
        1px solid var(--card-orange-border);

    border-radius: 12px;

    box-shadow:
        var(--shadow);

    cursor: pointer;
    overflow: hidden;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}


/* 왼쪽 포인트 라인 */
.backtest-record-ticker::before {
    content: "";

    position: absolute;
    left: 0;
    top: 9px;
    bottom: 9px;

    width: 3px;

    border-radius: 0 3px 3px 0;

    background: #f97316;
}


/* hover */
.backtest-record-ticker:hover {
    border-color: rgba(249, 115, 22, 0.32);

    box-shadow:
        0 4px 14px rgba(15, 23, 42, 0.07);

    transform: translateY(-1px);
}


/* ==========================================
   🔥 아이콘
   ========================================== */

.backtest-record-ticker-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    width: 30px;
    height: 30px;

    margin-right: 12px;

    background: rgba(249, 115, 22, 0.10);

    border-radius: 8px;

    font-size: 16px;
}


/* ==========================================
   텍스트 영역
   ========================================== */

.backtest-record-ticker-window {
    position: relative;

    flex: 1;
    height: 52px;

    overflow: hidden;
}


.backtest-record-ticker-item {
    position: absolute;
    left: 0;
    top: 0;

    display: flex;
    align-items: center;

    width: 100%;
    height: 52px;

    color: var(--text-secondary);

    font-size:
        calc(var(--font-size) * 0.93);
    font-weight: 500;

    white-space: nowrap;
}


.backtest-record-ticker-item strong {
    color: var(--text);
    font-weight: 700;
}


/* ==========================================
   오른쪽 화살표
   ========================================== */

.backtest-record-ticker-more {
    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    width: 28px;
    height: 28px;

    margin-left: 12px;

    color: var(--text-muted);

    border-radius: 7px;

    font-size:
        calc(var(--font-size) * 1.5);
    line-height: 1;

    transition:
        color 0.2s ease,
        background 0.2s ease,
        transform 0.2s ease;
}


.backtest-record-ticker:hover .backtest-record-ticker-more {
    color: #f97316;
    background: rgba(249, 115, 22, 0.08);

    transform: translateX(2px);
}


/* ==========================================
   기록 전환 애니메이션
   ========================================== */

.backtest-record-enter {
    animation:
        backtestRecordEnter 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}


.backtest-record-leave {
    animation:
        backtestRecordLeave 0.35s ease forwards;
}


@keyframes backtestRecordEnter {

    from {
        transform: translateY(70%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }

}


@keyframes backtestRecordLeave {

    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(-70%);
        opacity: 0;
    }

}


/* ==========================================
   모바일
   ========================================== */

@media (max-width: 768px) {

    .backtest-record-ticker {
        height: 48px;

        padding:
            0 12px;
    }


    .backtest-record-ticker-window,
    .backtest-record-ticker-item {
        height: 48px;
    }


    .backtest-record-ticker-item {
        font-size:
        calc(var(--font-size) * 0.86);

        overflow: hidden;
        text-overflow: ellipsis;
    }


    .backtest-record-ticker-icon {
        width: 27px;
        height: 27px;

        margin-right: 9px;

        font-size: 14px;
    }

}


/* ==========================================
   최근 백테스트 기록 패널
   ========================================== */

   .backtest-record-panel {
    width: 100%;
    max-width: 1500px;
    max-height: 0;

    margin: -5px auto 9px;

    padding: 0 18px;

    box-sizing: border-box;

    background: var(--panel);

    border:
        1px solid
        transparent;

    border-radius: 12px;

    opacity: 0;
    overflow: hidden;

    transform: translateY(-8px);

    pointer-events: none;

    transition:
        max-height 0.35s ease,
        padding 0.35s ease,
        opacity 0.25s ease,
        transform 0.35s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}


/* 열림 */
.backtest-record-panel.open {
    max-height: 520px;

    padding: 18px;

    border-color: var(--border-soft);

    box-shadow: var(--shadow);

    opacity: 1;

    transform: translateY(0);

    pointer-events: auto;
}


/* ==========================================
   헤더
   ========================================== */

.backtest-record-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 16px;
}


.backtest-record-panel-title {
    color: var(--text);

    font-size:
        var(--font-size);
    font-weight: 700;
}


.backtest-record-panel-description {
    margin-top: 5px;

    color: var(--text-muted);

    font-size:
        calc(var(--font-size) * 0.79);
}


/* 닫기 */
.backtest-record-panel-close {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 28px;
    height: 28px;

    padding: 0;

    background: transparent;
    border: 0;
    border-radius: 7px;

    color: var(--text-muted);

    font-size:
        calc(var(--font-size) * 1.5);
    line-height: 1;

    cursor: pointer;

    transition:
        color 0.2s ease,
        background 0.2s ease;
}


.backtest-record-panel-close:hover {
    color: var(--text);

    background: var(--panel-soft);
}



/* ==========================================
   테이블
   ========================================== */

.backtest-record-table-wrap {
    width: 100%;

    overflow-x: auto;
}


.backtest-record-table {
    width: 100%;

    border-collapse: collapse;

    font-size:
        calc(var(--font-size) * 0.86);
}

.backtest-record-table th {
    padding:
        9px
        12px;

    color: var(--text-muted);

    background: var(--panel-soft);

    border-bottom:
        1px solid
        var(--border-soft);

        font-size:
        calc(var(--font-size) * 0.79);
    font-weight: 600;

    text-align: left;
}


.backtest-record-table td {
    padding:
        12px;

    color: var(--text-secondary);

    border-bottom:
        1px solid
        var(--border-soft);

    vertical-align: middle;
}


.backtest-record-table tbody tr:hover {
    background: var(--panel-soft);
}


.backtest-record-list-user {
    color: var(--text);

    font-weight: 700;
}


.backtest-record-list-return {
    color: var(--text-secondary);

    font-weight: 700;
}


.backtest-record-list-cards {
    color: var(--text-muted);
}


.backtest-record-table tbody tr:last-child td {
    border-bottom: 0;
}


/* 행 hover */
.backtest-record-table tbody tr {
    transition:
        background 0.15s ease;
}



/* ==========================================
   순위
   ========================================== */

.backtest-record-rank {
    display: inline-block;

    width: 25px;

    font-size:
        var(--font-size);
}



.backtest-record-list-monthly {
    display: inline-block;

    padding:
        4px
        8px;

    color: var(--card-orange-accent);

    background: var(--card-orange-bg);

    border:
        1px solid
        var(--card-orange-border);

    border-radius: 6px;

    font-weight: 800;
}

