/* How It Works Animation Styles */

/* Animated Steps Container */
.animated-steps-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin: 4rem 0;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.animated-step-box {
    background: rgba(248, 250, 252, 0.8);
    border: 2px solid rgba(229, 231, 235, 0.5);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.animated-step-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.02);
}

.step-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
}

.step-number-badge {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.animated-step-box .step-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #ef4444;
    letter-spacing: 1px;
    font-family: 'Inter', sans-serif;
}

/* Step 1: Photo Upload */
.photo-upload-area {
    position: relative;
    width: 100%;
    height: 200px;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    transition: all 0.3s ease;
}

.upload-placeholder {
    text-align: center;
    color: #6b7280;
}

.upload-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.uploaded-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.drag-cursor {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translate(-20px, -20px);
    transition: all 0.5s ease;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

/* Step 2: Effects */
.effects-container {
    margin-top: 4rem;
    display: flex;
    flex-direction: column;
    gap: 5px;
    height: 200px;
    overflow: hidden;
    position: relative;
}

.effect-option {
    background: #f3f4f6;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.effect-option.selected {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border-color: #ef4444;
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.effect-preview {
    font-weight: 600;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
}

/* Step 3: Video Result */
.video-result-area {
    width: 100%;
    height: 200px;
    background: #f9fafb;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.loading-spinner {
    text-align: center;
    color: #ef4444;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #ef4444;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.video-ready video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.video-progress-bar {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #ef4444;
    width: 0%;
    transition: width 0.3s ease;
}

/* Animation Controls */
.animation-controls {
    text-align: center;
    margin: 3rem 0;
}

.replay-animation-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.replay-animation-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

/* Animation States */
.animated-step-box.active {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.photo-upload-area.drag-active {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.photo-upload-area.drag-active .drag-cursor {
    opacity: 1;
    transform: translate(0, 0);
}

.effects-container.scrolling {
    animation: scrollEffects 2s ease-in-out forwards;
}

@keyframes scrollEffects {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-60px);
    }
    100% {
        transform: translateY(-40px);
    }
}

/* Drag Animation */
@keyframes dragPhoto {
    0% {
        transform: translate(-100px, -50px) scale(0.8);
        opacity: 0.7;
    }
    50% {
        transform: translate(-50px, -25px) scale(0.9);
        opacity: 0.8;
    }
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
}

.uploaded-photo.dragging {
    animation: dragPhoto 1.5s ease-out forwards;
}

/* Video Appear Animation */
@keyframes videoAppear {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.video-ready.appearing {
    animation: videoAppear 0.8s ease-out forwards;
}

/* Progress Bar Animation */
@keyframes progressFill {
    0% {
        width: 0%;
    }
    100% {
        width: 100%;
    }
}

.progress-fill.animating {
    animation: progressFill 2s ease-out forwards;
}

/* Responsive Design */
@media (max-width: 768px) {
    .animated-steps-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .animated-step-box {
        padding: 1.5rem;
    }
    
    .photo-upload-area,
    .video-result-area {
        height: 150px;
    }
    
    .effects-container {
        height: 150px;
    }
}

@media (max-width: 480px) {
    .animated-step-box {
        padding: 1rem;
    }
    
    .step-number-badge {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .animated-step-box .step-title {
        font-size: 0.8rem;
    }
    
    .photo-upload-area,
    .video-result-area {
        height: 120px;
    }
    
    .effects-container {
        height: 120px;
    }
    
    .replay-animation-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}
