﻿/* ===================================
   PROGRESSIVE FORM LOADER STYLES
   =================================== */

/* Main overlay container */
#recipe-progress-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 999999 !important;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    background: transparent;
    backdrop-filter: none;
}

/* Backdrop layer - transparent */
.progress-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    backdrop-filter: none;
}

/* Main content container */
.progress-content {
    position: relative;
    text-align: center;
    padding: 2.5rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    margin: 1rem;
    border: 1px solid #e5e7eb;
    z-index: 1;
}

/* Header section with spinner and percentage */
.progress-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Animated spinner */
.progress-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f4f6;
    border-top: 3px solid #4299e1;
    border-radius: 50%;
    animation: progressSpin 1s linear infinite;
}

/* Percentage display */
.progress-percentage {
    font-size: 1.25rem;
    font-weight: 700;
    color: #4299e1;
    min-width: 3rem;
}

/* Spinner animation */
@keyframes progressSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Progress bar container */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

/* Progress bar fill */
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4299e1, #10b981);
    width: 0%;
    transition: width 0.8s ease-out;
    border-radius: 4px;
}

/* Main progress message */
.progress-message {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
    min-height: 1.5rem;
}

/* Secondary progress message */
.progress-submessage {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1.5rem;
    min-height: 1.25rem;
}

/* Step indicators container */
.step-indicators {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

/* Individual step indicator dot */
.step-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d1d5db;
    transition: all 0.3s ease;
}

    /* Completed step indicator */
    .step-indicator.completed {
        background: #4299e1;
        transform: scale(1.2);
    }

/* Form disable styles */
.form-submitting {
    pointer-events: none;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

    .form-submitting button[disabled] {
        opacity: 0.5;
        cursor: not-allowed;
    }

/* Prevent page scrolling when overlay is shown */
body.form-loading {
    overflow: hidden;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

/* Mobile and small screen adjustments */
@media (max-width: 480px) {
    .progress-content {
        padding: 1.25rem;
        margin: 0.5rem;
        max-width: 260px;
    }

    .progress-header {
        gap: 0.5rem;
    }

    .progress-percentage {
        font-size: 0.875rem;
    }

    .progress-message {
        font-size: 0.8rem;
    }

    .progress-submessage {
        font-size: 0.7rem;
    }

    .progress-spinner {
        width: 20px;
        height: 20px;
    }

    .step-indicators {
        gap: 0.25rem;
    }

    .step-indicator {
        width: 5px;
        height: 5px;
    }
}

/* Tablet adjustments */
@media (max-width: 768px) {
    .progress-content {
        max-width: 270px;
        padding: 1.375rem;
    }
}

/* ===================================
   THEME VARIANTS (Optional)
   =================================== */

/* Dark theme variant */
@media (prefers-color-scheme: dark) {
    #recipe-progress-overlay {
        background: transparent;
    }

    .progress-backdrop {
        background: transparent;
    }

    .progress-content {
        background: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }

    .progress-message {
        color: #f9fafb;
    }

    .progress-submessage {
        color: #d1d5db;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .progress-content {
        border: 2px solid #000;
    }

    .progress-spinner {
        border-top-color: #000;
    }

    .progress-percentage {
        color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .progress-spinner {
        animation: none;
        border-top-color: transparent;
    }

    .progress-bar-fill {
        transition: none;
    }

    .step-indicator {
        transition: none;
    }

    #recipe-progress-overlay {
        transition: none;
    }
}
