/* Modern Silicon Valley Styling */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --accent-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --dark-bg: #1a1a2e;
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --border-radius: 16px;
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--primary-gradient);
    min-height: 100vh;
}

.hero-section {
    background: var(--primary-gradient);
    color: white;
    text-align: center;
    padding: 1.5rem 1rem 1rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    background: linear-gradient(45deg, #fff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.hero-subtitle {
    font-size: 1rem;
    margin-bottom: 0.3rem;
    opacity: 0.9;
    font-weight: 300;
}

.hero-tagline {
    font-size: 0.85rem;
    opacity: 0.8;
    font-style: italic;
    margin-bottom: 0.8rem;
}

.main-content {
    background: white;
    margin: -0.5rem 1rem 0;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    position: relative;
    z-index: 2;
    padding: 1.5rem;
    min-height: 65vh;
}

/* Wizard Specific Styles */
.wizard-progress {
    margin-bottom: 1rem;
}

.progress-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 80px;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #a0aec0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.progress-step.active .step-circle {
    background: var(--accent-gradient);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.4);
}

.progress-step.completed .step-circle {
    background: var(--success-gradient);
    color: white;
}

.step-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.progress-step.active .step-label {
    color: var(--text-primary);
}

.progress-line {
    flex: 1;
    height: 2px;
    background: #e2e8f0;
    margin: 0 1rem;
    border-radius: 1px;
    transition: all 0.3s ease;
    min-width: 20px;
}

.progress-line.completed {
    background: var(--success-gradient);
}

.wizard-content {
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-content {
    width: 100%;
    max-width: 800px;
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

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

.wizard-navigation {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

.step-indicator {
    font-weight: 600;
    color: var(--text-secondary);
}

/* Upload Zone Styles */
.upload-zone {
    border: 2px dashed #cbd5e0;
    border-radius: var(--border-radius);
    padding: 3rem 2rem;
    text-align: center;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    transition: all 0.3s ease;
    position: relative;
}

.upload-zone:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
}

.upload-content {
    position: relative;
    z-index: 1;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.upload-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.upload-button {
    margin-top: 1rem;
    position: relative;
    z-index: 2;
    cursor: pointer;
}

.upload-preview {
    margin-top: 2rem;
    text-align: center;
}

.preview-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    margin-bottom: 1rem;
}

.upload-success {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #38a169;
    font-weight: 600;
}

.success-icon {
    font-size: 1.2rem;
}

/* Crop Section Styles */
.crop-section, .controls-section, .settings-section, .preview-section {
    padding: 1rem;
}

.crop-preview-container {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px dashed #cbd5e0;
    border-radius: var(--border-radius);
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
}

.crop-preview-container:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
}

.crop-result, .result-preview {
    text-align: center;
    margin-top: 1rem;
}

.result-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    box-shadow: var(--shadow-lg);
}

/* Settings Section Styles */
.settings-summary {
    background: #f8fafc;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-top: 1rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
}

.summary-item:last-child {
    margin-bottom: 0;
}

.summary-item .label {
    font-weight: 600;
    color: var(--text-secondary);
}

.summary-item .value {
    color: var(--text-primary);
    font-weight: 500;
}

.source-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    box-shadow: var(--shadow-lg);
}

.live-preview-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.live-preview-image {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
}

/* Live preview animations */
@keyframes spin-cw {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes spin-ccw {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

/* Credit Section */
.credit-section {
    text-align: center;
    padding: 1.5rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.credit-link {
    transition: all 0.3s ease;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

.credit-link:hover {
    color: white;
    text-decoration: underline;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Generate Section Styles */
.generate-section, .success-section {
    text-align: center;
}

.generation-preview {
    position: relative;
    display: inline-block;
    margin-bottom: 2rem;
}

.generate-preview {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    box-shadow: var(--shadow-lg);
}

.generation-overlay {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.success-animation {
    margin-bottom: 2rem;
}

.success-icon-large {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.final-gif {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    box-shadow: var(--shadow-xl);
    margin-bottom: 1rem;
}

.download-section {
    margin-top: 2rem;
}

/* Enhanced Button Styles */
.gradient-button {
    background: var(--accent-gradient);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.3);
}

.gradient-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(240, 147, 251, 0.4);
    color: white;
}

.gradient-button:disabled {
    opacity: 0.6;
    transform: none;
    cursor: not-allowed;
}

.success-button {
    background: var(--success-gradient);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}

.success-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.4);
    color: white;
}

.success-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.2);
}

.processing-message {
    animation: fadeInOut 2s ease-in-out infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.download-button {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.3);
}

.download-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.4);
    color: white;
    text-decoration: none;
}

.form-control, .form-range {
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.form-control:focus, .form-range:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.tech-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    margin: 0.25rem;
    backdrop-filter: blur(10px);
}

.alert {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--shadow-lg);
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .main-content {
        margin: -1rem 0.5rem 0;
        padding: 1rem;
    }
    
    .progress-container {
        gap: 0.25rem;
    }
    
    .progress-line {
        min-width: 10px;
        margin: 0 0.5rem;
    }
    
    .step-label {
        font-size: 0.75rem;
    }
    
    .upload-zone {
        padding: 2rem 1rem;
    }
    
    .upload-icon {
        font-size: 3rem;
    }
    
    .wizard-content {
        min-height: 45vh;
    }
}

/* Camera Upload Functionality */
.upload-options {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.option-button {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border-color);
    background: var(--background-color);
    color: var(--text-color);
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.option-button:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
}

.option-button.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.camera-interface {
    text-align: center;
    padding: 1rem;
    border: 2px dashed var(--border-color);
    border-radius: 1rem;
    background: var(--background-color);
}

.camera-container {
    max-width: 640px;
    margin: 0 auto;
}

.camera-video {
    width: 100%;
    max-width: 480px;
    height: auto;
    border-radius: 1rem;
    background: #000;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    margin-bottom: 1rem;
}

.camera-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 1.5rem 0;
}

.camera-button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.capture-button {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(86, 171, 47, 0.3);
}

.capture-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(86, 171, 47, 0.4);
}

.cancel-button {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.cancel-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.camera-instructions {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 1rem;
}

.camera-instructions p {
    margin: 0;
}

/* Mobile responsiveness for camera */
@media (max-width: 768px) {
    .upload-options {
        flex-direction: column;
        align-items: center;
    }
    
    .option-button {
        width: 100%;
        max-width: 250px;
    }
    
    .camera-video {
        max-width: 100%;
    }
    
    .camera-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .camera-button {
        width: 100%;
        max-width: 200px;
    }
}
