/* ==========================================================================
   Section 2 — GDP Chart (.bp-gdp-chart)
   Includes shared chart-header / chart-source / chart-container classes
   (currently used only by GDP — Section 4 spending uses its own classes).
   ========================================================================== */

/* --- Generic chart header (used by GDP) --- */
.bp-chart-header { text-align: center; margin-bottom: 32px; }
.bp-chart-header__title { font-size: 2rem; font-weight: 700; color: #E01C24; margin-bottom: 8px; }
.bp-chart-header__subtitle { font-size: 1.125rem; line-height: 1.6; opacity: 0.9; margin-bottom: 6px; }
.bp-chart-header__subtitle--red { color: #E01C24; font-weight: 700; font-size: 1.5rem; }
.bp-chart-header__note { font-size: 0.875rem; color: #ffffff; }

.bp-chart-container { position: relative; width: 100%; max-width: 900px; margin: 0 auto; }
.bp-chart-container canvas { width: 100% !important; height: auto !important; max-height: 450px; }
.bp-chart-source { text-align: center; font-size: 0.85rem; color: #ffffff; margin-top: 16px; }

@media (max-width: 768px) {
    .bp-chart-header__title { font-size: 1.5rem; }
    .bp-chart-container canvas { max-height: 360px; }
    .bp-gdp-chart__cta-wrap { margin-top: 16px; }
}

/* --- GDP custom HTML legend (pill items with checkbox + color swatch) --- */
.bp-gdp-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin: 0 auto 24px;
    padding: 0;
    list-style: none;
}
.bp-gdp-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 8px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    background-color: #000000;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.2;
    box-shadow:
        -1px -1px 1px 0.5px rgba(255, 255, 255, 0.5) inset,
        1px 1px 1px 0.5px rgba(255, 255, 255, 0.5) inset;
    opacity: 0.45;
    transition: opacity 0.2s ease;
}
.bp-gdp-legend__item.is-active { opacity: 1; }
.bp-gdp-legend__item:hover { opacity: 1; }

.bp-gdp-legend__check {
    position: relative;
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #ffffff;
    border-radius: 3px;
    flex-shrink: 0;
}
.bp-gdp-legend__check::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a1a;
    font-weight: 700;
    font-size: 12px;
    line-height: 1;
}
.bp-gdp-legend__item:not(.is-active) .bp-gdp-legend__check {
    background: transparent;
    border: 1.5px solid #ffffff;
}
.bp-gdp-legend__item:not(.is-active) .bp-gdp-legend__check::after { opacity: 0; }
.bp-gdp-legend__color {
    display: inline-block;
    width: 28px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .bp-gdp-legend { gap: 8px; }
    .bp-gdp-legend__item { padding: 5px 10px 5px 6px; font-size: 0.8rem; gap: 6px; }
    .bp-gdp-legend__check { width: 14px; height: 14px; }
    .bp-gdp-legend__check::after { font-size: 10px; }
    .bp-gdp-legend__color { width: 22px; height: 8px; }
}

/* --- GDP bottom CTA (revealed after all countries drawn) --- */
.bp-gdp-chart__cta-wrap {
    text-align: center;
    margin-top: 32px;
}
.bp-gdp-chart__cta {
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    padding: 14px 36px;
    font-size: 1.05rem;
    transition: opacity 0.5s ease, transform 0.5s ease, background-color 0.2s ease, color 0.2s ease;
}
.bp-gdp-chart__cta.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* --- GDP popup modal (lives outside #smooth-wrapper for position:fixed) --- */
.bp-gdp-popup {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.65);
    padding: 24px;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.bp-gdp-popup.is-visible {
    display: flex;
    opacity: 1;
}
.bp-gdp-popup__card {
    background: #ffffff;
    color: #1a1a1a;
    border-radius: 24px;
    padding: 32px 36px;
    width: 100%;
    max-width: 360px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    transform: scale(0.92);
    transition: transform 0.3s ease;
}
.bp-gdp-popup.is-visible .bp-gdp-popup__card { transform: scale(1); }
.bp-gdp-popup__image {
    display: block;
    max-width: 200px;
    height: auto;
    margin: 0 auto 20px;
}
.bp-gdp-popup__text {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 24px;
    color: #1a1a1a;
}
.bp-gdp-popup__btn { min-width: 120px; }

@media (max-width: 768px) {
    .bp-gdp-popup__card { padding: 24px 24px; max-width: 300px; border-radius: 20px; }
    .bp-gdp-popup__image { max-width: 160px; margin-bottom: 16px; }
    .bp-gdp-popup__text { font-size: 1.25rem; margin-bottom: 20px; }
    .bp-gdp-chart__cta { padding: 12px 28px; font-size: 0.95rem; }
}
