/**
 * WashDrop PromptPay Styles
 *
 * @package WashStripe_PromptPay
 */

/* Loading Overlay */
.wd-pp-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: wd-pp-fadein 0.2s ease-out;
}

@keyframes wd-pp-fadein {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modal */
.wd-pp-modal {
    background: white;
    padding: 40px 30px;
    border-radius: 12px;
    text-align: center;
    max-width: 320px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: wd-pp-slideup 0.3s ease-out;
}

@keyframes wd-pp-slideup {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Spinner */
.wd-pp-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: wd-pp-spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes wd-pp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Text */
.wd-pp-modal p {
    margin: 10px 0;
    font-size: 16px;
    color: #1e2022;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.wd-pp-modal p:first-of-type {
    font-weight: 500;
    font-size: 18px;
}

.wd-pp-hint {
    font-size: 14px !important;
    color: #6b7280 !important;
    margin-top: 5px !important;
}

/* Test Badge */
.wd-pp-test-badge {
    font-size: 10px;
    background: #635bff;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 5px;
    vertical-align: middle;
}

/* Test Notice in Panel */
.wd-pp-test-notice {
    color: #635bff;
    font-size: 13px;
    margin-top: 10px;
    padding: 8px 12px;
    background: #f0f0ff;
    border-radius: 6px;
    border-left: 3px solid #635bff;
}

/* Ensure PromptPay panel visibility */
#wd-panel-promptpay {
    animation: wd-pp-fadein 0.2s ease-out;
}

/* Show PromptPay panel when PromptPay radio is checked */
.wd-payment-methods:has(input[value="promptpay"]:checked) ~ #wd-panel-promptpay,
.wd-payment-methods:has(input[value="promptpay"]:checked) ~ * #wd-panel-promptpay,
input[value="promptpay"]:checked ~ * #wd-panel-promptpay {
    display: block !important;
}

/* Hide PromptPay panel when PromptPay is not checked */
input[value="promptpay"]:not(:checked) ~ * #wd-panel-promptpay {
    display: none !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .wd-pp-modal {
        max-width: 90%;
        padding: 30px 20px;
    }

    .wd-pp-modal p {
        font-size: 14px;
    }

    .wd-pp-modal p:first-of-type {
        font-size: 16px;
    }
}

/* QR Code Modal */
.wd-pp-qr-modal {
    max-width: 400px;
}

.wd-pp-qr-modal h3 {
    margin: 0 0 20px;
    font-size: 20px;
    color: #1e2022;
}

.wd-pp-qr-container {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    display: inline-block;
}

.wd-pp-qr-image {
    width: 200px;
    height: 200px;
    display: block;
}

.wd-pp-instructions {
    text-align: left;
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
    margin: 15px 0;
}

.wd-pp-amount {
    font-size: 24px;
    font-weight: 700;
    color: #1e2022;
    margin: 15px 0;
}

.wd-pp-waiting {
    color: #635bff;
    font-weight: 500;
    margin: 10px 0;
}

.wd-pp-cancel-btn {
    margin-top: 20px;
    background: #f3f4f6;
    color: #6b7280;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.wd-pp-cancel-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

/* Test mode badge on QR modal */
.wd-pp-qr-modal .wd-pp-test-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 11px;
    padding: 4px 8px;
}
