/* Playful Loading Animations for Order Submission */

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.loading-overlay.show {
    display: flex;
}

/* Main Loading Container */
.loading-container {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    margin: 0 auto;
}

/* Lemonade Glass Animation */
.lemonade-glass {
    width: 120px;
    height: 180px;
    margin: 0 auto 2rem;
    position: relative;
    animation: bounce 2s ease-in-out infinite;
}

.glass-container {
    width: 100px;
    height: 150px;
    background: linear-gradient(180deg, transparent 30%, #FFE135 30%, #FFF700 100%);
    border: 4px solid #333;
    border-radius: 0 0 50px 50px;
    position: relative;
    margin: 0 auto;
    overflow: hidden;
}

.glass-top {
    width: 110px;
    height: 8px;
    background: #333;
    border-radius: 8px;
    position: absolute;
    top: -4px;
    left: -9px;
}

/* Bubbles Animation */
.bubble {
    position: absolute;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    animation: bubbleUp 3s linear infinite;
}

.bubble:nth-child(1) {
    width: 8px;
    height: 8px;
    left: 20%;
    animation-delay: 0s;
}

.bubble:nth-child(2) {
    width: 12px;
    height: 12px;
    left: 50%;
    animation-delay: 1s;
}

.bubble:nth-child(3) {
    width: 6px;
    height: 6px;
    left: 70%;
    animation-delay: 2s;
}

.bubble:nth-child(4) {
    width: 10px;
    height: 10px;
    left: 30%;
    animation-delay: 0.5s;
}

/* Straw */
.straw {
    width: 6px;
    height: 60px;
    background: linear-gradient(45deg, #ff6b9d, #c44569);
    position: absolute;
    top: -30px;
    right: 20px;
    border-radius: 3px;
    transform: rotate(-10deg);
}

.straw::before {
    content: '';
    width: 20px;
    height: 6px;
    background: #c44569;
    position: absolute;
    top: -3px;
    right: -7px;
    border-radius: 3px;
}

/* Lemon Slices Floating Around */
.lemon-slice {
    position: absolute;
    font-size: 2rem;
    animation: float 4s ease-in-out infinite;
}

.lemon-slice:nth-child(1) {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.lemon-slice:nth-child(2) {
    top: 60%;
    right: 10%;
    animation-delay: 1s;
}

.lemon-slice:nth-child(3) {
    bottom: 20%;
    left: 20%;
    animation-delay: 2s;
}

/* Loading Text Animation */
.loading-text {
    font-family: 'Fredoka One', cursive;
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 1rem;
    animation: colorChange 3s ease-in-out infinite;
}

.loading-subtitle {
    font-family: 'Comic Neue', cursive;
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 2rem;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    height: 12px;
    background: #f0f0f0;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #FFE135, #FF6B6B, #4ECDC4, #45B7D1);
    background-size: 200% 100%;
    border-radius: 20px;
    width: 0%;
    animation: progressFill 5s ease-in-out forwards, gradientShift 2s ease-in-out infinite;
    position: relative;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shine 2s ease-in-out infinite;
}

/* Step Indicators */
.steps-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.step-icon.active {
    background: linear-gradient(45deg, #FFE135, #FF6B6B);
    color: white;
    transform: scale(1.1);
    animation: pulse 1s ease-in-out infinite;
}

.step-icon.completed {
    background: #28a745;
    color: white;
}

.step-label {
    font-size: 0.8rem;
    color: #666;
    text-align: center;
}

.step-label.active {
    color: #FF6B6B;
    font-weight: bold;
}

/* Success Animation */
.success-checkmark {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #28a745;
    margin: 0 auto 1rem;
    display: none;
    position: relative;
}

.success-checkmark.show {
    display: block;
    animation: scaleIn 0.5s ease-out;
}

.success-checkmark::before {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 2.5rem;
    font-weight: bold;
}

/* Keyframe Animations */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

@keyframes bubbleUp {
    0% {
        bottom: 20px;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        bottom: 140px;
        opacity: 0;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

@keyframes colorChange {
    0%, 100% {
        color: #FFE135;
    }
    33% {
        color: #FF6B6B;
    }
    66% {
        color: #4ECDC4;
    }
}

@keyframes progressFill {
    0% {
        width: 0%;
    }
    25% {
        width: 25%;
    }
    50% {
        width: 50%;
    }
    75% {
        width: 75%;
    }
    100% {
        width: 100%;
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes shine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1.1);
    }
    50% {
        transform: scale(1.2);
    }
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Button Loading State */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .loading-container {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .lemonade-glass {
        width: 100px;
        height: 150px;
    }
    
    .glass-container {
        width: 80px;
        height: 120px;
    }
    
    .loading-text {
        font-size: 1.5rem;
    }
    
    .steps-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .step {
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
    }
    
    .step-icon {
        margin-right: 1rem;
        margin-bottom: 0;
    }
}

/* Confetti Animation */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #FFE135;
    animation: confettiFall 3s linear infinite;
}

.confetti:nth-child(odd) {
    background: #FF6B6B;
    animation-delay: 0.5s;
}

.confetti:nth-child(3n) {
    background: #4ECDC4;
    animation-delay: 1s;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}