/**
 * Sepay Checkout — Frontend Styles.
 *
 * Horizontal two-column layout: QR on left, bank info on right.
 * Clean, professional design matching Vietnamese payment UX conventions.
 *
 * @package SupplierIntegration
 * @since   1.1.0
 */

/* =========================================================================
   Modal Backdrop
   ========================================================================= */
.si-sepay-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.si-sepay-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* =========================================================================
   Modal Box — Wide horizontal layout
   ========================================================================= */
.si-sepay-modal-content {
    background: #ffffff;
    border-radius: 12px;
    width: 94%;
    max-width: 780px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.2);
    transform: scale(0.92) translateY(16px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1e293b;
}

.si-sepay-modal-overlay.active .si-sepay-modal-content {
    transform: scale(1) translateY(0);
}

/* =========================================================================
   Header
   ========================================================================= */
.si-sepay-modal-header {
    padding: 20px 28px 14px;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
}

.si-sepay-modal-title {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: #1e293b;
}

.si-sepay-modal-subtitle {
    font-size: 13px;
    color: #2563eb;
    margin: 0;
    font-weight: 500;
}

/* =========================================================================
   Body
   ========================================================================= */
.si-sepay-modal-body {
    padding: 20px 28px;
}

/* =========================================================================
   Horizontal Two-Column Layout
   ========================================================================= */
.si-sepay-layout-horizontal {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

/* Column heading */
.si-sepay-col-heading {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 14px;
    text-align: center;
}

/* Left: QR Column */
.si-sepay-col-qr {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-right: 24px;
    border-right: 1px solid #e5e7eb;
}

.si-sepay-qr-wrapper {
    position: relative;
    padding: 8px;
    background: #ffffff;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    animation: pulse-ring 2.5s infinite;
}

@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.2); }
    70% { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

.si-sepay-qr-wrapper img {
    display: block;
    width: 220px;
    height: 220px;
    border-radius: 6px;
    object-fit: contain;
}

/* Right: Bank Info Column */
.si-sepay-col-info {
    flex: 1;
    min-width: 0;
}

/* Bank header */
.si-sepay-bank-header {
    text-align: center;
    margin-bottom: 16px;
}

.si-sepay-bank-name-display {
    font-size: 16px;
    font-weight: 700;
    color: #1e40af;
    letter-spacing: 0.3px;
}

/* =========================================================================
   Payment Info Grid
   ========================================================================= */
.si-sepay-info-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.si-sepay-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

.si-sepay-info-row:last-child {
    border-bottom: none;
}

.si-sepay-info-label {
    color: #64748b;
    font-weight: 500;
    flex-shrink: 0;
    margin-right: 12px;
}

.si-sepay-info-value-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.si-sepay-info-value {
    font-weight: 700;
    color: #0f172a;
    font-size: 14px;
}

.si-sepay-info-value.amount {
    color: #dc2626;
    font-size: 15px;
}

.si-sepay-info-value.code {
    background: #eff6ff;
    color: #1e40af;
    padding: 3px 10px;
    border-radius: 4px;
    font-family: "SF Mono", "Cascadia Code", "Consolas", monospace;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

/* Notice Box */
.si-sepay-notice-box {
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 12px;
    color: #92400e;
    line-height: 1.5;
    margin-top: 14px;
}

/* =========================================================================
   Copy Button
   ========================================================================= */
.si-sepay-copy-btn {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    font-size: 13px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
    flex-shrink: 0;
}

.si-sepay-copy-btn:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.si-sepay-copy-btn.si-sepay-copied {
    background: #dcfce7;
    border-color: #86efac;
    color: #15803d;
}

/* =========================================================================
   Bottom Bar: Status + Timer
   ========================================================================= */
.si-sepay-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    gap: 16px;
}

/* Status Indicator */
.si-sepay-status-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

/* Spinner */
.si-sepay-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid #94a3b8;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: si-spin 0.8s linear infinite;
}

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

/* Timer Badge */
.si-sepay-timer-container {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    flex-shrink: 0;
}

.si-sepay-countdown {
    color: #ef4444;
    font-variant-numeric: tabular-nums;
}

.si-sepay-countdown.si-sepay-timer-warning {
    animation: text-pulse 1s infinite alternate;
}

@keyframes text-pulse {
    from { opacity: 1; }
    to { opacity: 0.4; }
}

/* =========================================================================
   Footer
   ========================================================================= */
.si-sepay-modal-footer {
    padding: 0 28px 20px;
    display: flex;
    justify-content: center;
}

.si-sepay-btn {
    border: none;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 28px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.si-sepay-btn-cancel {
    background: #ffffff;
    color: #ef4444;
    border: 1.5px solid #fca5a5;
}

.si-sepay-btn-cancel:hover {
    background: #fef2f2;
    border-color: #ef4444;
}

/* =========================================================================
   Success Screen
   ========================================================================= */
.si-sepay-modal-success-screen {
    display: none;
    text-align: center;
    padding: 48px 24px;
}

.si-sepay-success-icon {
    font-size: 52px;
    margin-bottom: 16px;
    animation: pop-scale 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes pop-scale {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.si-sepay-success-title {
    font-size: 22px;
    font-weight: 700;
    color: #15803d;
    margin: 0 0 8px 0;
}

.si-sepay-success-text {
    font-size: 14px;
    color: #475569;
    margin: 0;
}

/* =========================================================================
   Checkout Embed Button
   ========================================================================= */
.fluent-cart-checkout_embed_payment_container_sepay {
    margin-top: 16px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.si-sepay-embed-info {
    font-size: 13px;
    color: #475569;
    margin: 0 0 16px 0;
    line-height: 1.5;
}

.si-sepay-submit-btn {
    display: block;
    width: 100%;
    background-color: #1e40af;
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(30, 64, 175, 0.2);
}

.si-sepay-submit-btn:hover {
    background-color: #1d4ed8;
}

.si-sepay-submit-btn:active {
    transform: scale(0.98);
}

.si-sepay-submit-btn:disabled {
    background-color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
}

/* =========================================================================
   Responsive: Stack vertically on mobile
   ========================================================================= */
@media (max-width: 640px) {
    .si-sepay-modal-content {
        max-width: 100%;
        width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 95vh;
    }

    .si-sepay-layout-horizontal {
        flex-direction: column;
        gap: 20px;
    }

    .si-sepay-col-qr {
        padding-right: 0;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        padding-bottom: 20px;
        width: 100%;
    }

    .si-sepay-qr-wrapper img {
        width: 180px;
        height: 180px;
    }

    .si-sepay-col-info {
        width: 100%;
    }

    .si-sepay-bottom-bar {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .si-sepay-modal-body {
        padding: 16px 20px;
    }

    .si-sepay-modal-header {
        padding: 16px 20px 12px;
    }

    .si-sepay-modal-footer {
        padding: 0 20px 16px;
    }
}
