/* ── V4 Container ────────────────────────────────── */

.wfcc-v4 {
    width: 100%;
    min-width: 327px;
    max-width: 1200px;
    margin: 0 0;
    font-family: Poppins, sans-serif;
    overflow: hidden;
    background: #fff;
    border: none;
    border-radius: 32px;
    background-image: none;
    display: flex;
    flex-direction: column;
    gap: 80px;
    padding: 32px 48px;
    box-sizing: border-box;
}

/* ── Header area ─────────────────────────────────── */

.wfcc-v4__header {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    padding: 0 24px;
    position: relative;
    min-width: 0;
}

/* ── Overlapping currency flags ──────────────────── */

.wfcc-v4__flags {
    position: relative;
    width: 61px;
    height: 60px;
    flex-shrink: 0;
    cursor: default;
}

.wfcc-v4 .wfcc-v4__flag-btn {
    all: unset;
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 100px;
    background: #fff;
    padding: 3px;
    box-sizing: content-box;
    cursor: default;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wfcc-v4 .wfcc-v4__flag-btn--static {
    cursor: default;
}

.wfcc-v4 .wfcc-v4__flag-btn--static:hover {
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wfcc-v4 .wfcc-v4__flag-btn--static:focus {
    outline: none;
}

.wfcc-v4 .wfcc-v4__flag-btn--send {
    top: 0;
    left: 0;
    z-index: 2;
}

.wfcc-v4 .wfcc-v4__flag-btn--receive {
    top: 22px;
    left: 23px;
    z-index: 1;
}

.wfcc-v4 .wfcc-v4__flag-btn--active {
    box-shadow: 0 0 0 2px #AA8DCC;
}

.wfcc-v4 .wfcc-v4__flag-img {
    width: 32px;
    height: 32px;
    border-radius: 100px;
    object-fit: cover;
}

.wfcc-v4 .wfcc-v4__flag-btn--send .wfcc-v4__flag-img {
    border: 1px solid rgba(211, 209, 204, 0.2);
}

/* ── Rate info ───────────────────────────────────── */

.wfcc-v4__rate-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.wfcc-v4 .wfcc-v4__rate-text {
    font-size: 24px;
    font-weight: 500;
    line-height: 1.2;
    color: #000;
    letter-spacing: -0.24px;
    white-space: nowrap;
}

.wfcc-v4 .wfcc-v4__rate-value {
    color: #000;
    font-weight: 500;
}

.wfcc-v4 .wfcc-v4__rate-loading {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-top-color: #000;
    border-radius: 50%;
    display: none;
    animation: wfcc-v4-spin 0.8s linear infinite;
}

@keyframes wfcc-v4-spin {
    to { transform: rotate(360deg); }
}

/* ── Rate change indicator (Up/Down by X%) ──────── */

.wfcc-v4 .wfcc-v4__rate-change {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-top: 4px;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: -0.18px;
}

.wfcc-v4 .wfcc-v4__rate-change--up {
    color: #00B388;
}

.wfcc-v4 .wfcc-v4__rate-change--down {
    color: #FF0051;
}

.wfcc-v4 .wfcc-v4__rate-change-icon {
    width: 10px;
    height: 14px;
    flex-shrink: 0;
    padding-bottom: 4px;
}

.wfcc-v4 .wfcc-v4__rate-change-text {
    font-size: 18px;
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: -0.18px;
}

/* ── Currency dropdown ──────────────────────────── */

.wfcc-v4 .wfcc-v4__currency-options {
    display: none;
    flex-direction: column;
    position: absolute;
    z-index: 20;
    top: 100%;
    left: 0;
    width: 260px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 16.74px rgba(0, 0, 0, 0.2);
    padding: 16px 4px 16px 16px;
    overflow: hidden;
}

.wfcc-v4 .wfcc-v4__currency-options.open {
    display: flex;
}

.wfcc-v4 .wfcc-v4__currency-options--receive {
    left: 23px;
}

.wfcc-v4 .wfcc-v4__currency-options label {
    padding-right: 12px;
}

.wfcc-v4 .wfcc-v4__currency-search {
    display: flex;
    padding: 20px 24px 16px 16px;
    width: 100%;
    border: none;
    border-radius: 12px;
    background-color: rgba(247, 247, 247, 1);
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

.wfcc-v4 .wfcc-v4__currency-items {
    display: flex;
    flex-direction: column;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 4px;
    margin-top: 6px;
}

.wfcc-v4 .wfcc-v4__currency-items::-webkit-scrollbar {
    width: 8px;
}

.wfcc-v4 .wfcc-v4__currency-items::-webkit-scrollbar-track {
    background: transparent;
    border: none;
}

.wfcc-v4 .wfcc-v4__currency-items::-webkit-scrollbar-thumb {
    background: #D9D9D9;
    border-radius: 56px;
    border: none;
}

.wfcc-v4 .wfcc-v4-currency-option {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 14px 24px 14px 16px;
    font-weight: 500;
    font-size: 16px;
    line-height: 1.25em;
    letter-spacing: -0.01em;
    color: #1F2323;
    text-decoration: none;
    cursor: pointer;
}

.wfcc-v4 .wfcc-v4-currency-option img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.wfcc-v4 .wfcc-v4-currency-option:hover {
    background-color: rgba(255, 0, 81, 0.04);
}

.wfcc-v4 .wfcc-v4-currency-option .wfcc-v4-country-name {
    color: rgba(168, 174, 181, 1);
    font-weight: 400;
    font-size: 14px;
    line-height: 1.25em;
}

/* ── Chart ──────────────────────────────────────── */

.wfcc-v4 .wfcc-v4__chart {
    padding: 0;
    min-width: 0;
}

.wfcc-v4 .wfcc-v4__chart-container {
    width: 100%;
    height: 350px;
    min-width: 0;
    overflow: hidden;
}

.wfcc-v4 .wfcc-v4__chart-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 350px;
    color: #90969A;
    font-size: 14px;
}

/* ── Footer ─────────────────────────────────────── */

.wfcc-v4 .wfcc-v4__footer {
    display: flex;
    flex-direction: column;
    padding: 0 0;
    gap: 32px;
}

.wfcc-v4 .wfcc-v4__time-range {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
}

.wfcc-v4 .wfcc-v4__time-btn {
    all: unset;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 20px;
    border: 1px solid #13002D;
    border-radius: 50px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 400;
    color: #1F2323;
    background: transparent;
    letter-spacing: -0.16px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    user-select: none;
    -webkit-user-select: none;
    box-sizing: border-box;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.wfcc-v4 .wfcc-v4__time-btn:hover {
    background: #EEEEF1;
}

.wfcc-v4 .wfcc-v4__time-btn:active,
.wfcc-v4 .wfcc-v4__time-btn:focus,
.wfcc-v4 .wfcc-v4__time-btn:focus-visible {
    background: #EEEEF1;
    color: #1F2323;
    outline: none;
    box-shadow: none;
}

.wfcc-v4 .wfcc-v4__time-btn--active {
    background: #1F2323;
    color: #fff;
    border-color: #1F2323;
}

.wfcc-v4 .wfcc-v4__time-btn--active:hover {
    background: #333;
}

.wfcc-v4 .wfcc-v4__time-btn--active:active,
.wfcc-v4 .wfcc-v4__time-btn--active:focus,
.wfcc-v4 .wfcc-v4__time-btn--active:focus-visible {
    background: #1F2323;
    color: #fff;
    outline: none;
    box-shadow: none;
}

/* ── Disclaimer ─────────────────────────────────── */

.wfcc-v4 .wfcc-v4__disclaimer {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 16px;
    color: #000;
    line-height: 125%;
    letter-spacing: -0.16px;
}

.wfcc-v4 .wfcc-v4__disclaimer-text {
    color: #000;
}

.wfcc-v4 .wfcc-v4__disclaimer-link {
    color: #FF0051;
    text-decoration: underline;
    text-decoration-skip-ink: auto;
    text-underline-position: from-font;
}

.wfcc-v4 .wfcc-v4__disclaimer-link:hover {
    color: #CC0041;
}

/* ── Error notice ───────────────────────────────── */

.wfcc-v4 .wfcc-v4__error-notice {
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    margin: 0 48px 12px;
    border-radius: 16px;
    background-color: #FFF5F8;
    font-weight: 400;
    font-size: 12px;
    line-height: 1.25em;
    color: #FF0051;
}

/* ── Responsive: tablet ─────────────────────────── */

@media (max-width: 1024px) {
    .wfcc-v4 {
        gap: 48px;
        padding: 24px;
        overflow: hidden;
    }

    .wfcc-v4__header {
        gap: 16px;
        padding: 0 16px;
    }

    .wfcc-v4 .wfcc-v4__flags {
        width: 52px;
        height: 50px;
    }

    .wfcc-v4 .wfcc-v4__flag-btn {
        width: 28px;
        height: 28px;
        padding: 2px;
    }

    .wfcc-v4 .wfcc-v4__flag-img {
        width: 28px;
        height: 28px;
    }

    .wfcc-v4 .wfcc-v4__flag-btn--receive {
        top: 18px;
        left: 20px;
    }

    .wfcc-v4 .wfcc-v4__rate-text {
        font-size: 20px;
    }

    .wfcc-v4 .wfcc-v4__rate-change {
        font-size: 20px;
    }

    .wfcc-v4 .wfcc-v4__rate-change-text {
        font-size: 18px;
    }

    .wfcc-v4 .wfcc-v4__chart-container {
        height: 350px;
        min-width: 0;
    }

    .wfcc-v4 .wfcc-v4__chart-placeholder {
        height: 350px;
    }

    .wfcc-v4 .wfcc-v4__footer {
        padding: 0 0;
        gap: 24px;
    }

    .wfcc-v4 .wfcc-v4__time-btn {
        font-size: 14px;
        padding: 3px 16px;
    }
}

/* ── Responsive: mobile ─────────────────────────── */

@media (max-width: 767px) {
    .wfcc-v4 {
        min-width: 100%;
        max-width: 100%;
        gap: 32px;
        padding: 16px;
        border-radius: 24px;
        overflow: hidden;
    }

    .wfcc-v4__header {
        gap: 12px;
        padding: 0 8px;
    }

    .wfcc-v4 .wfcc-v4__flags {
        width: 46px;
        height: 44px;
    }

    .wfcc-v4 .wfcc-v4__flag-btn {
        width: 24px;
        height: 24px;
        padding: 2px;
    }

    .wfcc-v4 .wfcc-v4__flag-img {
        width: 24px;
        height: 24px;
    }

    .wfcc-v4 .wfcc-v4__flag-btn--receive {
        top: 16px;
        left: 18px;
    }

    .wfcc-v4 .wfcc-v4__rate-text {
        font-size: 16px;
    }

    .wfcc-v4 .wfcc-v4__rate-change {
        font-size: 16px;
        gap: 6px;
        margin-top: 2px;
    }

    .wfcc-v4 .wfcc-v4__rate-change-icon {
        width: 8px;
        height: 11px;
        padding-bottom: 2px;
    }

    .wfcc-v4 .wfcc-v4__rate-change-text {
        font-size: 16px;
    }

    .wfcc-v4 .wfcc-v4__chart-container {
        height: 182px;
        min-width: 0;
    }

    .wfcc-v4 .wfcc-v4__chart-placeholder {
        height: 182px;
    }

    .wfcc-v4 .wfcc-v4__footer {
        padding: 0 0;
        gap: 16px;
    }

    .wfcc-v4 .wfcc-v4__time-range {
        gap: 10px;
    }

    .wfcc-v4 .wfcc-v4__time-btn {
        font-size: 14px;
        padding: 3px 12px;
    }

    .wfcc-v4 .wfcc-v4__disclaimer {
        font-size: 14px;
        letter-spacing: -0.14px;
    }

    .wfcc-v4 .wfcc-v4__error-notice {
        margin: 0 16px 8px;
    }

    .wfcc-v4 .wfcc-v4__currency-options {
        width: 220px;
        border-radius: 10px;
    }

    .wfcc-v4 .wfcc-v4-currency-option {
        padding: 10px 16px;
        font-size: 14px;
    }

    .wfcc-v4 .wfcc-v4-currency-option .wfcc-v4-country-name {
        font-size: 12px;
    }
}
