/* =========================================================
MockVest Market Games — IntraX My Performance
Matches the IntraX Trading Hub design language
========================================================= */

/* ---- Container ---- */
#mv-intrax-my-performance.mv-intrax-container {
    width: 100%;
    margin: 0 auto;
    padding: 28px 32px;
    background: #f0f1f5;
    color: #151519;
    font-family: inherit;
}

/* ---- Performance wrapper ---- */
.intrax-performance {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* =========================================================
HEADER (now includes the Total Realized P&L hero)
========================================================= */
.intrax-performance__header {
    position: relative;
    padding: 36px 40px 32px;
    border-radius: 22px;
    background: linear-gradient(135deg, #0f0a1f 0%, #1a1035 50%, #2d1b69 100%);
    color: #ffffff;
    overflow: hidden;
}

.intrax-performance__header::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.4), transparent 70%);
    pointer-events: none;
}

.intrax-performance__header::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 200'%3E%3Cpath d='M0 150 Q150 120 300 140 T600 100 T900 130 T1200 90' stroke='rgba(167,139,250,0.3)' stroke-width='2' fill='none'/%3E%3Cpath d='M0 170 Q200 140 400 160 T800 120 T1200 140' stroke='rgba(167,139,250,0.15)' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat bottom/cover;
    pointer-events: none;
}

.intrax-performance__header > div {
    position: relative;
    z-index: 1;
}

.intrax-performance__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #ffffff;
}

.intrax-performance__eyebrow::after {
    content: "";
    width: 40px;
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
}

.intrax-performance__header h2 {
    margin: 10px 0 0;
    font-size: 52px;
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #ffffff;
}

.intrax-performance__header p {
    margin: 8px 0 0;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.6);
}

/* =========================================================
HERO — TOTAL REALIZED P&L (inside the header)
========================================================= */

/* Top row: eyebrow on the left, hero P&L on the right */
.intrax-performance__header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
}

.intrax-performance__hero {
    position: relative;
    z-index: 1;
    text-align: right;
    flex-shrink: 0;
}

.intrax-performance__hero-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
}

.intrax-performance__hero-label::after {
    content: "";
    width: 34px;
    height: 1px;
    background: rgba(255, 255, 255, 0.28);
}

.intrax-performance__hero-value {
    margin-top: 8px;
    font-size: 48px;
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
    color: #ffffff;
}

.intrax-performance__hero-value.is-positive {
    color: #4ade80 !important;
    text-shadow: 0 0 36px rgba(74, 222, 128, 0.35);
}

.intrax-performance__hero-value.is-negative {
    color: #fb7185 !important;
    text-shadow: 0 0 36px rgba(251, 113, 133, 0.35);
}

.intrax-performance__hero-value.is-neutral {
    color: #ffffff;
}

.intrax-performance__hero-note {
    margin-top: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
}

/* =========================================================
SECTIONS
========================================================= */
.intrax-performance__section {
    padding: 24px;
    border-radius: 22px;
    background: #ffffff;
    border: 1px solid #e7e7eb;
}

.intrax-performance__section h3 {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 800;
    color: #151519;
}

.intrax-performance__section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.intrax-performance__section-heading h3 {
    margin: 0;
}

.intrax-performance__section-heading p {
    margin: 4px 0 0;
    font-size: 13px;
    color: #777780;
}

/* =========================================================
STATS GRID
========================================================= */
.intrax-performance__stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0;
}

/* ---- Stat card ---- */
.intrax-performance__stat-card {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 4px 0 4px 18px;
    border-left: 1px solid #e7e7eb;
    min-width: 0;
}

.intrax-performance__stat-card:first-child {
    padding-left: 0;
    border-left: 0;
}

.intrax-performance__stat-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #8d8d98;
}

.intrax-performance__stat-value {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    color: #151519;
    white-space: nowrap;
}

.intrax-performance__stat-value.is-positive {
    color: #16a34a;
}

.intrax-performance__stat-value.is-negative {
    color: #dc2626;
}

.intrax-performance__stat-description {
    font-size: 12px;
    color: #8d8d98;
    line-height: 1.4;
}

/* =========================================================
HIGHLIGHTS — BEST / WORST DAY
========================================================= */
.intrax-performance__highlights {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.intrax-performance__highlight-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 22px 24px;
    border-radius: 16px;
    background: linear-gradient(180deg, #faf8ff 0%, #ffffff 100%);
    border: 1.5px solid #e9d5ff;
    overflow: hidden;
}

.intrax-performance__highlight-card::before {
    content: "";
    position: absolute;
    top: -40px;
    right: -40px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.1), transparent 70%);
    pointer-events: none;
}

.intrax-performance__highlight-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.intrax-performance__highlight-top > span:first-child {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8d8d98;
}

.intrax-performance__highlight-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f5f3ff;
    font-size: 15px;
    font-weight: 800;
    color: #7c3aed;
}

.intrax-performance__highlight-value {
    position: relative;
    z-index: 1;
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    color: #151519;
    line-height: 1.1;
}

.intrax-performance__highlight-value.is-positive {
    color: #16a34a;
}

.intrax-performance__highlight-value.is-negative {
    color: #dc2626;
}

.intrax-performance__highlight-date {
    position: relative;
    z-index: 1;
    font-size: 12px;
    font-weight: 600;
    color: #8d8d98;
}

/* =========================================================
CHALLENGE HISTORY — TABLE
========================================================= */
.intrax-performance__table-wrap {
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid #e7e7eb;
}

.intrax-performance__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.intrax-performance__table thead {
    background: #f5f5f7;
}

.intrax-performance__table th {
    padding: 12px 18px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #8d8d98;
    text-align: left;
    white-space: nowrap;
}

.intrax-performance__table th:last-child,
.intrax-performance__table td:last-child {
    text-align: right;
}

.intrax-performance__table td {
    padding: 14px 18px;
    border-top: 1px solid #e8e8ec;
    color: #151519;
    font-weight: 600;
    vertical-align: middle;
}

.intrax-performance__table tbody tr {
    transition: background 0.15s ease;
}

.intrax-performance__table tbody tr:hover {
    background: #faf8ff;
}

.intrax-performance__history-date {
    font-weight: 700;
}

.intrax-performance__table-pl {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    background: #f5f5f7;
    font-size: 13px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: #777780;
}

.intrax-performance__table-pl.is-positive {
    color: #16a34a !important;
    background: #f0fdf4;
}

.intrax-performance__table-pl.is-negative {
    color: #dc2626 !important;
    background: #fef2f2;
}

.intrax-performance__table-pl.is-neutral {
    color: #777780;
    background: #f5f5f7;
}

/* ---- History footer ---- */
.intrax-performance__history-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    font-size: 12px;
    color: #8d8d98;
}

/* =========================================================
EMPTY STATE
========================================================= */
.intrax-performance__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 48px 20px;
    text-align: center;
}

.intrax-performance__empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #f5f3ff;
    font-size: 22px;
    color: #7c3aed;
}

.intrax-performance__empty h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    color: #151519;
}

.intrax-performance__empty p {
    margin: 0;
    font-size: 13px;
    color: #8d8d98;
    max-width: 320px;
    line-height: 1.5;
}

/* =========================================================
SIMPLE MESSAGE (guest / error)
========================================================= */
#mv-intrax-my-performance.mv-intrax-container > p {
    margin: 0;
    padding: 48px 20px;
    text-align: center;
    font-size: 14px;
    color: #777780;
}

/* =========================================================
RESPONSIVE — TABLET
========================================================= */
@media (max-width: 1024px) {
    .intrax-performance__stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* =========================================================
RESPONSIVE — MOBILE
========================================================= */
@media (max-width: 720px) {
    #mv-intrax-my-performance.mv-intrax-container {
        padding: 16px;
    }

    .intrax-performance__header {
        padding: 28px 24px 24px;
    }

    .intrax-performance__header h2 {
        font-size: 38px;
    }

    /* Stack the header top row on mobile */
    .intrax-performance__header-top {
        flex-direction: column;
        gap: 20px;
    }

    .intrax-performance__hero {
        text-align: left;
        width: 100%;
    }

    .intrax-performance__hero-value {
        font-size: 36px;
    }

    .intrax-performance__section {
        padding: 18px;
    }

    /* Stats: 2 x 2 grid */
    .intrax-performance__stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        row-gap: 16px;
    }

    .intrax-performance__stat-card {
        padding-left: 14px;
        border-left: 1px solid #e7e7eb;
    }

    .intrax-performance__stat-card:nth-child(1),
    .intrax-performance__stat-card:nth-child(3),
    .intrax-performance__stat-card:nth-child(5) {
        padding-left: 0;
        border-left: 0;
    }

    .intrax-performance__stat-value {
        font-size: 18px;
    }

    /* Highlights: stack */
    .intrax-performance__highlights {
        grid-template-columns: 1fr;
    }

    .intrax-performance__highlight-value {
        font-size: 26px;
    }

    /* Table: compact */
    .intrax-performance__table th,
    .intrax-performance__table td {
        padding: 12px 14px;
    }

    .intrax-performance__history-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

@media (max-width: 420px) {
    .intrax-performance__stats {
        grid-template-columns: 1fr;
    }

    .intrax-performance__stat-card,
    .intrax-performance__stat-card:nth-child(1),
    .intrax-performance__stat-card:nth-child(3),
    .intrax-performance__stat-card:nth-child(5) {
        padding-left: 0;
        border-left: 0;
    }
}