﻿/* ===== Upcoming Earnings Volatility ===== */
.vol-page {
    max-width: 1240px;
    margin: 0 auto;
    padding: 8px 16px 40px;
}

.vol-head {
    margin: 12px 0 20px;
}

.vol-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.vol-title-icon {
    color: var(--ew-gold, #DDB785);
    flex: none;
}


.vol-sub {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
    max-width: 760px;
}

.vol-locked {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px;
    text-align: center;
    background: var(--surface);
}

    .vol-locked p {
        color: var(--text-muted);
        margin: 0 0 14px;
    }

.vol-upgrade {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 8px;
    background: var(--ew-gold, #DDB785);
    color: #23324a;
    font-weight: 700;
    text-decoration: none;
}

.vol-section-title {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    margin: 0 0 10px;
}

/* ---- highest-volatility grid ----
   EW2023 cell: ticker + day/session, faded logo watermark, and BOTH the average
   move and the options implied move. Ranked by implied move. auto-fill lands on
   10 columns at the 1240px page width and reflows down on its own. */
.vol-high-section {
    margin-bottom: 22px;
}

.vol-high-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 2px;
}

.vol-high-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 128px;
    padding: 8px 9px 9px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    background: var(--surface-alt, #f6f7f9);
    background: color-mix(in srgb, var(--ew-gold, #DDB785) 22%, var(--surface));
    transition: background-color 0.12s;
}

    .vol-high-card:hover {
        background: color-mix(in srgb, var(--ew-gold, #DDB785) 42%, var(--surface));
    }

    .vol-high-card:focus-visible {
        outline: 2px solid var(--ew-gold, #DDB785);
        outline-offset: -2px;
    }

/* header row: ticker left, day + session right */
.vol-high-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 5px;
}

.vol-high-ticker {
    font-family: "Arial Black", "Arial Bold", Gadget, sans-serif;
    font-size: 17px;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.vol-high-when {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 10px;
    line-height: 1.25;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    white-space: nowrap;
}

.vol-high-rel {
    font-weight: 700;
}

/* logo sits behind the numbers as a watermark, like EW2023 */
.vol-high-logo {
    position: absolute;
    top: 34px;
    left: 50%;
    transform: translateX(-50%);
    width: 74%;
    max-height: 38px;
    object-fit: contain;
    opacity: 0.38;
    pointer-events: none;
}

/* the two numbers */
.vol-high-row {
    position: relative;
    display: flex;
    flex-direction: column;
}

    .vol-high-row:first-of-type {
        margin-top: auto;
    }

    .vol-high-row + .vol-high-row {
        margin-top: 5px;
    }

.vol-high-lbl {
    font-size: 9.5px;
    line-height: 1.2;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vol-high-val {
    align-self: flex-end;
    font-family: "Arial Black", "Arial Bold", Gadget, sans-serif;
    font-size: 16px;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

/* implied move is the ranking column, so it carries the emphasis */
.vol-high-row.is-implied .vol-high-val {
    font-size: 19px;
}

@media (max-width: 520px) {
    .vol-high-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ---- week nav ---- */
.vol-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 14px;
}

.vol-nav-btn {
    padding: 7px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
}

    .vol-nav-btn:hover:not(:disabled) {
        background: var(--surface-alt, #f6f7f9);
        border-color: var(--ew-gold, #DDB785);
    }

    .vol-nav-btn:disabled {
        opacity: 0.4;
        cursor: default;
    }

.vol-week-label {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 210px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* ---- bubble chart ---- */
.vol-chart-wrap {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    padding: 10px;
}

.vol-bubbles {
    overflow: visible;
}

.vol-bubble-link {
    cursor: pointer;
    outline: none;
}

    .vol-bubble-link:focus-visible .vol-bubble {
        stroke: var(--text);
        stroke-width: 2;
        fill-opacity: 1;
    }

.vol-bubble {
    fill: var(--ew-gold, #DDB785);
    fill-opacity: 0.82;
    stroke: var(--surface);
    stroke-width: 1;
    cursor: pointer;
}

    .vol-bubble:hover {
        fill-opacity: 1;
    }

.vol-bubble-label {
    fill: #3a2c14;
    font-weight: 800;
    pointer-events: none;
}

.vol-grid {
    stroke: var(--border);
    stroke-width: 1;
    stroke-dasharray: 3 4;
}

.vol-axis-label {
    fill: var(--text-muted);
    font-size: 11px;
}

.vol-axis-title {
    fill: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}

.vol-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 50px 0;
    font-size: 14px;
}

/* ---- hover detail card ---- */
.vol-card {
    position: absolute;
    z-index: 20;
    width: 230px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    padding: 12px 14px;
    pointer-events: auto;
}

.vol-card-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.vol-card-logo-wrap {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface-alt, #f6f7f9);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: none;
}

.vol-card-logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.vol-card-id {
    display: flex;
    flex-direction: column;
}

.vol-card-ticker {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
}

.vol-card-company {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.2;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vol-card-date {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    color: var(--text-muted);
}

.vol-card-confirm.is-confirmed {
    color: var(--positive, #0F8A3B);
}

.vol-card-confirm.is-unconfirmed {
    color: #c99a2e;
}

.vol-card-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
}

.vol-card-metric {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.vol-card-mlabel {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    font-weight: 700;
}

.vol-card-mval {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

    .vol-card-mval.is-pos {
        color: var(--negative, #c62828);
    }
    /* elevated implied vol = pricier options */
    .vol-card-mval.is-neg {
        color: var(--positive, #0F8A3B);
    }
/* implied below historical = cheaper */

/* ---- loader ---- */
.vol-loader {
    display: flex;
    justify-content: center;
    padding: 60px 0;
}

.vol-spinner {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 4px solid var(--border);
    border-top-color: var(--ew-gold, #DDB785);
    animation: vol-spin 0.8s linear infinite;
}

@keyframes vol-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .vol-high-card {
        transition: none;
    }

    .vol-spinner {
        animation-duration: 2.4s;
    }
}
