:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #6b7280;
    --secondary-hover: #4b5563;
    --success-color: #059669;
    --success-hover: #047857;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text: #1f2937;
    --text-secondary: #6b7280;
    --border-radius: 0.375rem;
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    min-height: 100vh;
    color: var(--text);
    line-height: 1.6;
    font-family: system-ui, -apple-system, sans-serif;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

h1 {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text);
}

p {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

h2 {
    margin-bottom: 1rem;
    color: var(--text);
}

h3 {
    color: var(--text);
    font-weight: 600;
}

.upload-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.upload-button {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    width: 100%;
}

.upload-button:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.upload-button-secondary {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: var(--secondary-color);
    color: white;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

.upload-button-secondary:hover {
    background-color: var(--secondary-hover);
}

.button-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.generate-button, .download-button, .regenerate-button, .new-portrait-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.generate-button {
    background-color: var(--primary-color);
}

.generate-button:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.download-button {
    background-color: var(--success-color);
}

.download-button:hover {
    background-color: var(--success-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.regenerate-button {
    background-color: var(--secondary-color);
}

.regenerate-button:hover {
    background-color: var(--secondary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.new-portrait-button {
    background-color: var(--primary-color);
}

.new-portrait-button:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.hidden {
    display: none;
}

#workflow-container, #result-container {
    text-align: center;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

#workflow-info {
    text-align: left;
    background-color: #f3f4f6;
    padding: 1rem;
    border-radius: var(--border-radius);
    max-height: 200px;
    overflow-y: auto;
}

#user-inputs-container {
    text-align: left;
}

#user-inputs-container .input-group {
    margin-bottom: 1rem;
}

#user-inputs-container label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

#user-inputs-container input, 
#user-inputs-container select, 
#user-inputs-container textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: var(--border-radius);
    background-color: white;
}

#user-inputs-container input:focus, 
#user-inputs-container select:focus, 
#user-inputs-container textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

#imagePreview, #resultImage {
    max-width: 100%;
    max-height: 400px;
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin: 1rem 0;
}

#progress-container {
    margin-top: 0;
}

#progress-status {
    position: relative;
    z-index: 1;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

#progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.3s ease-in-out;
}

#api-session {
    height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
}

#workflowList {
    max-height: 200px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--secondary-color) transparent;
}

#workflowList::-webkit-scrollbar {
    width: 6px;
}

#workflowList::-webkit-scrollbar-track {
    background: transparent;
}

#workflowList::-webkit-scrollbar-thumb {
    background-color: var(--secondary-color);
    border-radius: 3px;
}

.user-input {
    margin-bottom: 1rem;
}

.user-input label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.user-input input,
.user-input textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.user-input input:focus,
.user-input textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

@media (max-width: 1024px) {
    .bg-white {
        height: auto;
        max-height: none;
    }
    
    #workflowList {
        max-height: 300px;
    }
}

.api-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.api-link:hover {
    color: var(--primary-hover);
}

@media (max-width: 640px) {
    .button-container {
        flex-direction: column;
        align-items: center;
    }
    
    .generate-button, .download-button, .regenerate-button, .new-portrait-button {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    min-height: calc(100vh - 300px); /* Account for header and footer */
}

@media (min-width: 1024px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-col {
        position: relative;
        height: fit-content;
    }

    .sticky-col {
        position: sticky;
        top: 1rem;
        height: fit-content;
    }
}

/* Card Styles */
.bg-white {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Space between cards in right column */
.space-y-8 > * + * {
    margin-top: 2rem;
} 