.snappypay-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 999999; /* Ensure it's above WooCommerce blocks */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.snappypay-overlay.active {
    opacity: 1;
    visibility: visible;
}

.snappypay-overlay-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 400px;
    width: 90%;
    text-align: center;
    color: #333;  /* Dark text for white background */
}

.snappypay-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 2rem;
}

.snappypay-title {
    color: #2c3e50;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #333;  /* Dark text for white background */
}

.snappypay-message {
    color: #7f8c8d;
    font-size: 1rem;
    margin: 0;
    min-height: 1.5em;
    transition: opacity 0.2s ease;
    color: #666;  /* Slightly lighter text for messages */
}

.snappypay-spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 1rem 0;
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin: 1rem auto;
}

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

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

.snappypay-close {
    position: absolute;
    top: 15px;
    right: 15px;
    cursor: pointer;
    font-size: 24px;
    color: #666;
    line-height: 1;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.snappypay-close:hover {
    background-color: #f5f5f5;
}

.snappypay-notification {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #3498db;
    color: white;
    padding: 15px;
    text-align: center;
    z-index: 999998;
    display: none;
    transform: translateY(-100%);
    transition: transform 0.3s ease-in-out;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.snappypay-notification.active {
    display: block;
    transform: translateY(0);
}

/* Payment method styles */
.wc_payment_method.payment_method_snappypay label img {
    max-height: 24px;
    margin-left: 10px;
    vertical-align: middle;
    transition: opacity 0.2s;
}

.wc_payment_method.payment_method_snappypay label:hover img {
    opacity: 0.8;
}

.snappypay-description {
    padding: 1rem 0;
    color: #666;
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.snappypay-description-wrapper {
    margin: 0.5rem 0;
}

.snappypay-content {
    padding: 1rem 0;
}

/* Payment method description */
.wc-payment-method-content {
    padding: 1rem 0;
}

.wc-payment-method-description {
    margin: 0.5rem 0;
}

.wc-payment-method-description p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Overlay styles */

/* SnappyPay Payment Gateway Styles */

#snappypay-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.snappypay-loading-content {
    text-align: center;
    padding: 2rem;
    border-radius: 8px;
    background: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    width: 90%;
}

.snappypay-spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.snappypay-loading-content h2 {
    color: #2c3e50;
    margin: 1rem 0;
    font-size: 1.5rem;
}

.snappypay-status {
    color: #7f8c8d;
    margin: 0.5rem 0;
    font-size: 1rem;
    line-height: 1.4;
}

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

/* Payment method logo */
.payment_method_snappypay img {
    max-height: 35px;
    vertical-align: middle;
    margin-left: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .snappypay-loading-content {
        width: 95%;
        padding: 1.5rem;
    }
    
    .snappypay-loading-content h2 {
        font-size: 1.2rem;
    }
    
    .snappypay-status {
        font-size: 0.9rem;
    }
}

/* Blocks-specific styles */
.snappypay-cards {
    max-width: 300px;
    height: auto;
    margin: 1rem 0;
    display: block;
}

/* Responsive adjustments for blocks */
@media (max-width: 480px) {
    .snappypay-cards {
        max-width: 240px;
    }
    
    .snappypay-overlay-content {
        padding: 1rem;
    }
    
    .snappypay-logo {
        max-width: 150px;
    }
}

/* Fix for WooCommerce blocks */
.wc-block-components-express-payment__event-buttons {
    position: relative; /* Ensure our overlay appears above payment buttons */
}

/* Ensure proper stacking in blocks checkout */
.wp-block-woocommerce-checkout {
    position: relative;
}

/* Force overlay above all block elements */
body.woocommerce-checkout .snappypay-overlay {
    z-index: 999999 !important;
}
