@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2c3e50;
    --primary-dark: #1a252f;
    --secondary: #34495e;
    --accent: #7f8c8d;
    --success: #27ae60;
    --error: #e74c3c;
    --bg-white: #ffffff;
    --bg-light: #f8f9fa;
    --bg-subtle: #ecf0f1;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --border-light: #e0e0e0;
    --shadow-subtle: rgba(0, 0, 0, 0.08);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-light);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
    position: relative;
    overflow-x: hidden;
}

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

/* Header */
.header {
    text-align: center;
    margin-bottom: 60px;
    animation: fadeInDown 0.8s ease;
}

.header h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 4em;
    font-weight: 800;
    margin-bottom: 15px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.subtitle {
    font-size: 1.25em;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: -0.01em;
}

/* Form Container */
.form-container {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 50px;
    box-shadow: 0 2px 12px var(--shadow-subtle);
    animation: fadeInUp 0.8s ease;
}

.form-group {
    margin-bottom: 32px;
}

.form-group label {
    display: block;
    font-size: 0.95em;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    text-transform: uppercase;
    font-size: 0.75em;
    opacity: 0.8;
}

.form-group input[type="text"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 16px 20px;
    background: var(--bg-white);
    border: 2px solid var(--border-light);
    border-radius: 8px;
    font-size: 1em;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

.form-group input[type="text"]::placeholder,
.form-group textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    background: var(--bg-white);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

/* File Upload */
.file-upload-wrapper {
    position: relative;
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.file-upload-display {
    border: 2px dashed var(--border-light);
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    background: var(--bg-subtle);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.file-upload-display:hover {
    background: var(--bg-white);
    border-color: var(--primary);
    box-shadow: 0 4px 12px var(--shadow-subtle);
}

.upload-icon {
    font-size: 4em;
    display: block;
    margin-bottom: 16px;
    filter: grayscale(0.3);
}

.upload-text {
    display: block;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.upload-hint {
    display: block;
    font-size: 0.9em;
    color: var(--text-secondary);
    opacity: 0.7;
}

.photo-preview {
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
    margin-top: 20px;
    box-shadow: 0 4px 12px var(--shadow-subtle);
    border: 1px solid var(--border-light);
}

/* Character Counter */
.char-counter {
    text-align: right;
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-top: 8px;
    font-weight: 500;
}

/* Buttons */
.btn-generate {
    width: 100%;
    padding: 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.2em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px var(--shadow-subtle);
    letter-spacing: -0.01em;
}

.btn-generate:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--shadow-subtle);
}

.btn-generate:active {
    transform: translateY(0);
}

/* Progress Container */
.progress-container {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 50px;
    box-shadow: 0 2px 12px var(--shadow-subtle);
    animation: fadeInUp 0.8s ease;
}

.progress-header {
    text-align: center;
    margin-bottom: 40px;
}

.progress-header h2 {
    font-family: 'Space Grotesk', sans-serif;
    color: var(--text-primary);
    margin-bottom: 12px;
    font-size: 2.5em;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.progress-header p {
    color: var(--text-secondary);
    font-size: 1.1em;
    font-weight: 500;
}

.progress-bar-wrapper {
    position: relative;
    margin-bottom: 50px;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: var(--bg-subtle);
    border-radius: 100px;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 100px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
}

.progress-percentage {
    text-align: center;
    font-size: 3em;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 20px;
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: -0.03em;
}

/* Progress Steps */
.progress-steps {
    margin: 40px 0;
}

.step {
    display: flex;
    align-items: center;
    padding: 20px 24px;
    margin-bottom: 12px;
    background: var(--bg-subtle);
    border-radius: 8px;
    transition: all 0.3s ease;
    opacity: 0.5;
    border: 1px solid var(--border-light);
}

.step.active {
    opacity: 1;
    background: var(--bg-white);
    border-left: 4px solid var(--primary);
    box-shadow: 0 2px 8px var(--shadow-subtle);
}

.step.completed {
    opacity: 1;
    background: var(--bg-white);
    border-left: 4px solid var(--success);
}

.step-icon {
    font-size: 1.8em;
    margin-right: 20px;
    filter: grayscale(0.5);
}

.step.active .step-icon,
.step.completed .step-icon {
    filter: grayscale(0);
}

.step-text {
    font-size: 1em;
    color: var(--text-primary);
    font-weight: 500;
    letter-spacing: -0.01em;
}

/* Fun Facts */
.fun-facts {
    margin-top: 40px;
    padding: 24px 28px;
    background: var(--bg-subtle);
    border-radius: 8px;
    border-left: 4px solid var(--accent);
    border: 1px solid var(--border-light);
}

.fun-fact {
    font-size: 1em;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.6;
    transition: opacity 0.3s ease;
}

/* Success Container */
.success-container {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 70px 50px;
    box-shadow: 0 2px 12px var(--shadow-subtle);
    text-align: center;
    animation: fadeInUp 0.8s ease;
}

.success-icon {
    font-size: 6em;
    margin-bottom: 24px;
    animation: bounce 1s ease;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) scale(1); }
    40% { transform: translateY(-30px) scale(1.1); }
    60% { transform: translateY(-15px) scale(1.05); }
}

.success-container h2 {
    font-family: 'Space Grotesk', sans-serif;
    color: var(--success);
    margin-bottom: 16px;
    font-size: 2.5em;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.comic-title-display {
    font-size: 1.4em;
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-style: italic;
    font-weight: 500;
}

.btn-download,
.btn-create-another {
    padding: 18px 48px;
    margin: 10px;
    border: none;
    border-radius: 14px;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: -0.01em;
}

.btn-download {
    background: var(--success);
    color: white;
    box-shadow: 0 4px 12px var(--shadow-subtle);
}

.btn-download:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--shadow-subtle);
}

.btn-create-another {
    background: var(--bg-white);
    color: var(--text-primary);
    border: 2px solid var(--border-light);
}

.btn-create-another:hover {
    background: var(--bg-subtle);
    transform: translateY(-2px);
}

/* Error Container */
.error-container {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 70px 50px;
    box-shadow: 0 2px 12px var(--shadow-subtle);
    text-align: center;
    animation: fadeInUp 0.8s ease;
}

.error-icon {
    font-size: 6em;
    margin-bottom: 24px;
}

.error-container h2 {
    font-family: 'Space Grotesk', sans-serif;
    color: var(--error);
    margin-bottom: 16px;
    font-size: 2.5em;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.error-message {
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-size: 1.1em;
    line-height: 1.6;
}

.btn-try-again {
    padding: 18px 48px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px var(--shadow-subtle);
    letter-spacing: -0.01em;
}

.btn-try-again:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--shadow-subtle);
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-subtle);
}

::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Selection */
::selection {
    background: var(--bg-subtle);
    color: var(--text-primary);
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    .header h1 {
        font-size: 2.5em;
    }

    .subtitle {
        font-size: 1em;
    }

    .form-container,
    .progress-container,
    .success-container,
    .error-container {
        padding: 30px 25px;
    }

    .progress-percentage {
        font-size: 2em;
    }

    .btn-download,
    .btn-create-another,
    .btn-try-again {
        padding: 16px 32px;
        font-size: 1em;
    }
}

