/**
 * JetForm Loading Overlay Styles
 *
 * Professional loading overlay with spinner, progress bar, and messages
 *
 * @since 1.0.0
 */

/* Overlay Container */
.rcf-jetform-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
    backdrop-filter: blur(2px);
}

.rcf-jetform-loading-overlay.active {
    opacity: 1;
}

/* Content Container */
.rcf-jetform-loading-content {
    background: white;
    border-radius: 12px;
    padding: 48px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading Spinner */
.rcf-jetform-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 24px;
    position: relative;
}

/* Spinner animation - circular ring */
.rcf-jetform-spinner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 4px solid #f0f0f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Secondary spinner ring for depth */
.rcf-jetform-spinner::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    width: calc(100% - 16px);
    height: calc(100% - 16px);
    border: 3px solid #e5e7eb;
    border-right-color: #10b981;
    border-radius: 50%;
    animation: spin 2s linear infinite reverse;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Message Text */
.rcf-jetform-message {
    font-size: 16px;
    font-weight: 500;
    color: #1f2937;
    margin: 0 0 28px 0;
    line-height: 1.6;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rcf-jetform-message.fade-out {
    animation: fadeOut 0.3s ease-out;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0.3;
    }
}

/* Progress Bar Container */
.rcf-jetform-progress-container {
    position: relative;
    margin-top: 24px;
}

/* Progress Bar Background */
.rcf-jetform-progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

/* Progress Bar Fill */
.rcf-jetform-progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #3b82f6 0%, #10b981 100%);
    border-radius: 10px;
    transition: width 1s ease-out;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

/* Progress Percentage Text */
.rcf-jetform-progress-text {
    display: inline-block;
    margin-top: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #3b82f6;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 480px) {
    .rcf-jetform-loading-content {
        padding: 36px 24px;
        max-width: 320px;
    }

    .rcf-jetform-spinner {
        width: 50px;
        height: 50px;
        margin-bottom: 20px;
    }

    .rcf-jetform-spinner::before {
        border-width: 3px;
    }

    .rcf-jetform-spinner::after {
        border-width: 2px;
        top: 6px;
        left: 6px;
        width: calc(100% - 12px);
        height: calc(100% - 12px);
    }

    .rcf-jetform-message {
        font-size: 14px;
        min-height: 40px;
        margin-bottom: 20px;
    }

    .rcf-jetform-progress-container {
        margin-top: 18px;
    }

    .rcf-jetform-progress-bar {
        height: 6px;
    }

    .rcf-jetform-progress-text {
        font-size: 12px;
        margin-top: 8px;
    }
}

/* Larger screen adjustments */
@media (min-width: 768px) {
    .rcf-jetform-loading-content {
        padding: 56px 48px;
    }

    .rcf-jetform-spinner {
        width: 70px;
        height: 70px;
        margin-bottom: 32px;
    }

    .rcf-jetform-message {
        font-size: 18px;
        min-height: 54px;
        margin-bottom: 32px;
    }

    .rcf-jetform-progress-container {
        margin-top: 28px;
    }
}

/* Accessibility - Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .rcf-jetform-loading-overlay {
        transition: opacity 0.2s ease-in-out;
    }

    .rcf-jetform-loading-content {
        animation: none;
    }

    .rcf-jetform-spinner::before,
    .rcf-jetform-spinner::after {
        animation: none;
        border-top-color: #3b82f6;
    }

    .rcf-jetform-message.fade-out {
        animation: none;
    }

    .rcf-jetform-progress-bar::before {
        transition: width 0.2s ease-out;
    }
}
