/* ============================================================
   version-switch.css
   Portable version-switching UI for MySpending sites.
   Drop this file + version-switch.js into any instance.
   ============================================================ */

/* ─── TopBar Center Section ─── */
.top-bar-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ─── Switch Button (sits in the top bar) ─── */
.version-switch-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.4;
}

.version-switch-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.55);
}

.version-switch-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}

/* Light variant — for pages with white/light backgrounds */
.version-switch-btn.vs-light {
    color: #333;
    border-color: rgba(0, 0, 0, 0.2);
    background: rgba(0, 0, 0, 0.05);
}

.version-switch-btn.vs-light:hover {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.35);
}

.version-switch-btn.vs-light:focus {
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.15);
}

/* White variant — for pages with colored/dark backgrounds */
.version-switch-btn.vs-white {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
}

.version-switch-btn.vs-white:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.7);
}

.version-switch-btn.vs-white:focus {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.version-switch-btn i {
    font-size: 11px;
}

/* ─── Modal Overlay ─── */
.version-switch-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.version-switch-overlay.active {
    display: flex;
}

/* ─── Modal Card ─── */
.version-switch-modal {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 420px;
    overflow: hidden;
    animation: vsModalIn 0.2s ease-out;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

@keyframes vsModalIn {
    from { opacity: 0; transform: translateY(-16px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── Modal Header ─── */
.version-switch-modal-header {
    padding: 20px 24px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid #eee;
    position: relative;
}

.version-switch-modal-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(25, 118, 210, 0.1);
    flex-shrink: 0;
}

.version-switch-modal-icon i {
    font-size: 18px;
    color: var(--button-bg-color, #1976D2);
}

.version-switch-modal-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #1a1a2e;
}

/* Close (X) button */
.version-switch-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #999;
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.version-switch-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* ─── Modal Body ─── */
.version-switch-modal-body {
    padding: 20px 24px 20px;
}

.version-switch-modal-body p {
    margin: 0 0 8px;
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

/* Warning note box */
.version-switch-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #FFF9E6;
    border: 1px solid #FFE082;
    border-radius: 8px;
    padding: 10px 14px;
    margin-top: 12px;
    font-size: 13px;
    color: #7a6200;
    line-height: 1.4;
}

.version-switch-note i {
    color: #f0a500;
    margin-top: 2px;
    flex-shrink: 0;
}

/* ─── Modal Footer ─── */
.version-switch-modal-footer {
    padding: 0 24px 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.version-switch-modal-footer button {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.vs-btn-cancel {
    background: #f5f5f5;
    border: 1px solid #d0d0d0;
    color: #333;
}

.vs-btn-cancel:hover {
    background: #e8e8e8;
}

.vs-btn-continue {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--button-bg-color, #1976D2);
    border: 1px solid var(--button-bg-color, #1565C0);
    color: #ffffff;
}

.vs-btn-continue:hover {
    filter: brightness(0.9);
}

.vs-btn-continue i {
    font-size: 12px;
    transition: transform 0.15s ease;
}

.vs-btn-continue:hover i {
    transform: translateX(2px);
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .version-switch-btn span {
        display: none;
    }

    .version-switch-btn {
        padding: 6px 10px;
    }

    .version-switch-modal {
        width: 95%;
        margin: 0 10px;
    }
}

@media (max-width: 480px) {
    .version-switch-modal-header {
        padding: 16px 18px 14px;
    }

    .version-switch-modal-header h3 {
        font-size: 15px;
        padding-right: 24px;
    }

    .version-switch-modal-body {
        padding: 14px 18px 16px;
    }

    .version-switch-modal-footer {
        padding: 0 18px 16px;
        flex-direction: column-reverse;
    }

    .version-switch-modal-footer button {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}
