/**
 * OPC Loading Overlay Styles
 * Extracted from single-product-one-page-checkout.php
 *
 * @package OnePageCheckoutAflah
 */

/* Loading overlay */
.opc-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(2px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.opc-form-container.is-loading .opc-loading-overlay {
    display: flex;
    opacity: 1;
}

.opc-spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.opc-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f0f0f0;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: opcSpin 1s linear infinite;
    position: relative;
}

.opc-spinner::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    border: 2px solid transparent;
    border-top: 2px solid #28a745;
    border-radius: 50%;
    animation: opcSpinReverse 0.7s linear infinite;
}

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

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

.opc-loading-text {
    color: #333;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    margin: 0;
    animation: opcPulse 2s ease-in-out infinite;
}

@keyframes opcPulse {
    0%,
    100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

.opc-form-container {
    position: relative;
    overflow: hidden;
}

@media (max-width: 768px) {
    .opc-spinner {
        width: 40px;
        height: 40px;
        border-width: 3px;
    }

    .opc-spinner::before {
        border-width: 2px;
    }

    .opc-loading-text {
        font-size: 14px;
    }
}

.opc-processing-message,
.opc-error-message {
    animation: fadeInDown 0.5s ease-out;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.opc-processing-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #28a745, #20c997);
    animation: progressBar 3s ease-in-out;
}

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

@keyframes progressBar {
    to {
        left: 100%;
    }
}
