/* ==========================================================
   mod_currency_popup — Stylesheet
   ========================================================== */

/* ── Trigger anchor ──────────────────────────────────────── */
a.open_conversion_popup {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: underline;
    cursor: pointer;
    outline: none;
}

a.open_conversion_popup:not(.btn):hover,
a.open_conversion_popup:not(.btn):focus {
    color: #DE2924;
}

/* ── Overlay ─────────────────────────────────────────────── */
#conv-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 10, 22, 0.62);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
    font-family: inherit;
    margin-top: 0;
}

#conv-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* ── Popup card ──────────────────────────────────────────── */
#conv-popup {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 700px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
    transform: translateY(28px) scale(0.96);
    transition: transform 0.32s cubic-bezier(0.34, 1.5, 0.64, 1);
    overflow: hidden;
}

#conv-overlay.active #conv-popup {
    transform: translateY(0) scale(1);
}

/* ── Loading ─────────────────────────────────────────────── */
#conv-loading {
    padding: 3.5rem 2rem;
    text-align: center;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

#conv-loading.show {
    display: flex;
}

.conv-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid #e8eaf2;
    border-top-color: #1c1f2e;
    border-radius: 50%;
    animation: conv-spin 0.75s linear infinite;
}

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

.conv-loading-text {
    font-size: 0.85rem;
    color: #9ea3b8;
}

/* ── Error ───────────────────────────────────────────────── */
.conv-error {
    padding: 2.5rem 2rem;
    text-align: center;
    color: #c0392b;
    font-size: 0.88rem;
    display: none;
}

.conv-error.show {
    display: block;
}

.conv-error strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

/* ── Content ─────────────────────────────────────────────── */
#conv-content {
    display: none;
}

#conv-content.show {
    display: block;
}

/* ── Header ──────────────────────────────────────────────── */
.conv-header {
    background: #9B1921;
    padding: 1.05rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.conv-header-left {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.conv-header-title {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.conv-header-date {
    color: #ffffff;
    font-family: inherit;
    font-size: 0.9rem;
}

.conv-close-btn {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.7);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
    line-height: 1;
}

.conv-close-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

/* ── Body grid ───────────────────────────────────────────── */
.conv-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

/* ── Left panel ──────────────────────────────────────────── */
.conv-left {
    padding: 1.6rem 1.5rem;
    border-right: 1px solid #eef0f6;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.conv-field {
    background: #f8f9fd;
    border: 1.5px solid #e8eaf2;
    border-radius: 10px;
    padding: 0.8rem 1rem;
}

.conv-field-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: #adb2c8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.4rem;
}

.conv-currency-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1c1f2e;
}

.conv-select-wrap {
    position: relative;
}

.conv-select-wrap::after {
    content: '';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #9ea3b8;
    pointer-events: none;
}

#conv-to-select {
    width: 100%;
    background: #f8f9fd;
    border: 1.5px solid #e8eaf2;
    border-radius: 10px;
    padding: 0.8rem 2.5rem 0.8rem 1rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1c1f2e;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#conv-to-select:focus {
    border-color: #1c1f2e;
    box-shadow: 0 0 0 3px rgba(28, 31, 46, 0.08);
}

/* ── Right panel ─────────────────────────────────────────── */
.conv-right {
    padding: 1.6rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.3rem;
}

.conv-amount-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: #adb2c8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.15rem;
}

.conv-amount-value {
    font-family: inherit;
    font-size: 1.45rem;
    font-weight: 500;
    color: #1c1f2e;
    margin-bottom: 1rem;
}

.conv-equals-label {
    font-size: 0.82rem;
    color: #adb2c8;
    font-weight: 400;
    margin-bottom: 0.2rem;
}

.conv-result-row {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    flex-wrap: wrap;
    min-height: 2.6rem;
}

.conv-result-int,
.conv-result-dot,
.conv-result-dec-main {
    font-family: inherit;
    font-size: 2.1rem;
    font-weight: 500;
    color: #1c1f2e;
    letter-spacing: -0.025em;
}

.conv-result-dec-fade {
    font-family: inherit;
    font-size: 2.1rem;
    font-weight: 500;
    color: #c8cad8;
    letter-spacing: -0.025em;
}

.conv-result-unit {
    font-size: 1.15rem;
    font-weight: 600;
    color: #1c1f2e;
    margin-left: 0.25rem;
}

.conv-rate-lines {
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
    margin-top: 0.6rem;
}

.conv-rate-line {
    font-family: inherit;
    font-size: 0.72rem;
    color: #565758;
}

.conv-na {
    font-size: 0.85rem;
    color: #9B1921;
    font-style: italic;
    margin-top: 0.5rem;
}

/* ── Notice ──────────────────────────────────────────────── */
.conv-notice {
    border-top: 1px solid #eef0f6;
    padding: 0.95rem 1.5rem;
    background: #fffcf5;
}

.conv-notice p {
    font-size: 1rem;
    color: #9B1921;
    line-height: 1.65;
    text-align: center;
}

.conv-notice strong {
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ── Footer ──────────────────────────────────────────────── */
.conv-footer {
    border-top: 1px solid #eef0f6;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: center;
}

.conv-exit-btn {
    border: 1.5px solid #9B1921;
    background: transparent;
    color: #9B1921;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    padding: 0.6rem 3.2rem;
    border-radius: 8px;
    cursor: pointer;
    letter-spacing: 0.03em;
    transition: background 0.2s, color 0.2s;
}

.conv-exit-btn:hover {
    background: #9B1921;
    color: #fff;
}

.conversion_poppup {
    margin-top: 10px;
    text-align: left;
    font-size: 13px;
    font-weight: 500;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 580px) {
    .conv-body {
        grid-template-columns: 1fr;
    }

    .conv-left {
        border-right: none;
        border-bottom: 1px solid #eef0f6;
        padding-bottom: 1.2rem;
    }

    .conv-result-int,
    .conv-result-dot,
    .conv-result-dec-main,
    .conv-result-dec-fade {
        font-size: 1.65rem;
    }

    .conv-result-unit {
        font-size: 1rem;
    }

    #conv-popup {
        max-height: 500px;
        overflow-y: scroll;
    }
}