/* --- Animations --- */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes modalPop { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.pay-fragment-wrapper { padding: 25px 15px; }

/* --- Section Header --- */
.pay-sec-head { 
    background: #0A66C2; color: white; padding: 20px 25px; 
    border-radius: 24px 24px 0 0; display: flex; justify-content: space-between; 
    align-items: center; font-size: 1.1rem; font-weight: 700; 
}

/* --- List Container & Items --- */
.pay-list-box { 
    background: white; border-radius: 0 0 24px 24px; overflow: hidden; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.05); border: 1px solid #edf2f7; 
    margin-bottom: 20px; 
}

.pay-item { 
    display: flex; align-items: center; padding: 22px; 
    transition: all 0.2s ease; opacity: 0; 
    animation: fadeInUp 0.5s ease forwards; 
}
.pay-item:nth-child(even) { background-color: #f8fafc; }
.pay-item:hover { background-color: #f0f7ff; }

.pay-item-content { flex: 1; }
.pay-chit-id { font-weight: 800; color: #0A66C2; font-size: 1.05rem; display: block; margin-bottom: 4px; }
.pay-scheme { font-size: 0.85rem; color: #64748b; font-weight: 500; display: block; }
.pay-amount-val { font-size: 1.15rem; font-weight: 900; color: #1e293b; margin-top: 8px; display: block; }

/* --- Checkbox Styling --- */
.pay-checkbox-container { position: relative; cursor: pointer; display: block; width: 30px; height: 30px; }
.pay-checkbox-container input { opacity: 0; width: 0; height: 0; }
.pay-checkmark { 
    position: absolute; top: 0; left: 0; height: 30px; width: 30px; 
    background-color: #fff; border: 2px solid #cbd5e1; border-radius: 10px; transition: 0.3s; 
}
.pay-checkbox-container input:checked ~ .pay-checkmark { background-color: #0A66C2; border-color: #0A66C2; transform: scale(1.1); }
.pay-checkmark:after { 
    content: ""; position: absolute; display: none; left: 10px; top: 5px; 
    width: 7px; height: 13px; border: solid white; border-width: 0 3.5px 3.5px 0; transform: rotate(45deg); 
}
.pay-checkbox-container input:checked ~ .pay-checkmark:after { display: block; }

/* --- Info Card --- */
.pay-info-card { display: flex; align-items: center; gap: 12px; padding: 15px; background: #fffbeb; border-radius: 15px; color: #92400e; font-size: 0.85rem; margin-top: 10px; }

/* --- Slim Footer Summary Bar --- */
.pay-summary-slim { 
    position: fixed; bottom: 95px; left: 15px; right: 15px; 
    background: #fff; height: 75px; border-radius: 20px; 
    display: flex; align-items: center; justify-content: space-between; 
    padding: 0 10px 0 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); z-index: 1001; 
}
.pay-summary-left { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.pay-total-mini { display: flex; flex-direction: column; }
.pay-lbl-tiny { font-size: 0.7rem; color: #64748b; font-weight: 600; text-transform: uppercase; }
.pay-val-main { font-size: 1.3rem; font-weight: 900; color: #0A66C2; }
.pay-btn-slim { 
    background: linear-gradient(135deg, #1f78d6 0%, #0A66C2 100%); 
    color: white; border: none; height: 55px; padding: 0 25px; 
    border-radius: 15px; font-weight: 700; display: flex; align-items: center; gap: 10px; 
}
.pay-btn-slim:disabled { opacity: 0.5; filter: grayscale(1); }

/* --- Bottom Sheet Overlay --- */
.pay-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 2000; display: none; align-items: flex-end; }
.pay-overlay.active { display: flex; }
.pay-overlay-content { background: white; width: 100%; padding: 25px; border-radius: 30px 30px 0 0; animation: slideUp 0.3s ease-out; }
.pay-overlay-handle { width: 40px; height: 5px; background: #e2e8f0; border-radius: 10px; margin: 0 auto 20px; }

/* --- Confirmation Modal --- */
.pay-modal-overlay { 
    position: fixed; top: 0; left: 0; right: 0; bottom: 0; 
    background: rgba(10, 102, 194, 0.4); backdrop-filter: blur(8px); 
    z-index: 3000; display: none; align-items: center; justify-content: center; padding: 20px; 
}
.pay-modal-overlay.active { display: flex; }
.pay-modal-content { 
    background: white; width: 100%; max-width: 400px; 
    border-radius: 30px; padding: 30px; box-shadow: 0 25px 50px rgba(0,0,0,0.2); 
    text-align: center; animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}

/* --- Timer --- */
.pay-timer-circle { position: relative; width: 80px; height: 80px; margin: 0 auto 15px; }
.pay-timer-svg { transform: rotate(-90deg); }
.pay-timer-path-bg { fill: none; stroke: #f1f5f9; stroke-width: 8; }
.pay-timer-path-remaining { 
    fill: none; stroke: #0A66C2; stroke-width: 8; stroke-linecap: round; 
    stroke-dasharray: 283; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear; 
}
#pay-timer-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-weight: 800; color: #0A66C2; }

/* --- Itemized List in Modal --- */
.pay-modal-item-list { 
    max-height: 140px; overflow-y: auto; background: #f8fafc; 
    border-radius: 15px; padding: 12px; margin: 15px 0; border: 1px solid #e2e8f0; 
}
.pay-modal-item-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed #e2e8f0; font-size: 0.85rem; }
.pay-modal-item-row:last-child { border-bottom: none; }
.pay-modal-item-id { font-weight: 700; color: #1e293b; }
.pay-modal-item-amt { font-weight: 600; color: #64748b; }

.pay-confirm-box { background: #f0f7ff; border-radius: 15px; padding: 15px; margin-top: 10px; }
.pay-confirm-row { display: flex; justify-content: space-between; align-items: center; }

.pay-modal-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 25px; }
.pay-btn-cancel { background: #f1f5f9; border: none; padding: 15px; border-radius: 15px; font-weight: 700; color: #64748b; }
.pay-btn-now { background: #0A66C2; border: none; padding: 15px; border-radius: 15px; font-weight: 700; color: white; }

/* Scroll Spacer */
.pay-list-bottom-spacer { height: 180px; }

/* ========== PERFECT PAYMENT GATEWAY MODAL ========== */
#pg-gateway-modal .shell-modal {
    background: white;
    border-radius: 24px;
    width: 420px;
    max-width: 90vw;
    max-height: 70vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    position: relative;
}

/* FIXED HEADER - NO CLOSE BUTTON, CLEAN LAYOUT */
#pg-gateway-modal .shell-modal-header {
    flex-shrink: 0;
    padding: 20px 25px;
    background: linear-gradient(135deg, #0A66C2 0%, #0d4b8a 100%);
    color: white;
    border-radius: 24px 24px 0 0;
    display: flex;
    align-items: center;
    gap: 15px;
    min-height: 80px;
    position: relative;
    overflow: hidden;
}

/* Extend background to cover corners perfectly */
#pg-gateway-modal .shell-modal-header::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: 0;
    background: linear-gradient(135deg, #0A66C2 0%, #0d4b8a 100%);
    z-index: 1;
}

/* Icon container */
#pg-gateway-modal .shell-modal-header .sm-icon-container {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

/* Title - aligned with icon */
#pg-gateway-modal .shell-modal-header h3 {
    color: white;
    font-size: 1.3rem;
    margin: 0;
    font-weight: 700;
    position: relative;
    z-index: 2;
    flex: 1;
}

/* Remove close button completely */
#pg-gateway-modal .shell-modal-header .sm-close {
    display: none !important;
}

/* Modal body - consistent for all states */
#pg-gateway-modal .shell-modal-body {
    flex: 1;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 250px;
    text-align: center;
}

/* Content wrapper */
#pg-gateway-modal .status-content {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
}

/* Consistent icon sizes */
#pg-gateway-modal .status-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: block;
}

/* Consistent text sizes */
#pg-gateway-modal .status-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 10px;
}

#pg-gateway-modal .status-message {
    font-size: 0.95rem;
    color: #64748b;
    margin-bottom: 25px;
    line-height: 1.5;
}

/* Transaction details box */
#pg-gateway-modal .transaction-box {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid #e2e8f0;
    width: 100%;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.detail-row:last-child {
    margin-bottom: 0;
}

.detail-label {
    font-size: 0.9rem;
    color: #64748b;
}

.detail-value {
    font-size: 0.9rem;
    color: #1e293b;
    font-weight: 600;
    text-align: right;
    max-width: 200px;
    word-break: break-word;
}

.detail-value.amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0A66C2;
}

/* Action buttons */
#pg-gateway-modal .action-button {
    background: #10b981;
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    transition: all 0.2s;
    margin-top: 20px;
}

#pg-gateway-modal .action-button:hover {
    background: #0da371;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Footer - clean layout */
#pg-gateway-modal .sm-footer {
    flex-shrink: 0;
    padding: 20px 25px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

#pg-gateway-modal .footer-button {
    padding: 16px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    transition: all 0.2s;
}

#pg-gateway-modal .footer-button.primary {
    background: #10b981;
    color: white;
}

#pg-gateway-modal .footer-button.secondary {
    background: white;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

/* Responsive */
@media (max-width: 480px) {
    #pg-gateway-modal .shell-modal {
        width: 90vw;
        max-height: 80vh;
    }
    
    #pg-gateway-modal .shell-modal-body {
        padding: 20px;
    }
    
    #pg-gateway-modal .status-icon {
        font-size: 2.5rem;
    }
    
    #pg-gateway-modal .status-title {
        font-size: 1.2rem;
    }
    
    .detail-value {
        max-width: 150px;
    }
}