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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.login-box h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: #DDDDDD;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

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

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    position: relative;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.logout-link {
    position: absolute;
    top: 0;
    right: 0;
    color: white;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.logout-link:hover {
    background: rgba(255, 255, 255, 0.3);
}

.main-content {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* Two-column grid layout for desktop */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.upload-column,
.options-column {
    min-width: 0; /* Prevents grid blowout */
}

/* Upload Section */
.upload-section {
    position: sticky;
    top: 20px;
}

.upload-section h2,
.options-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.disclaimer {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.dropzone {
    border: 3px dashed #667eea;
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropzone.dragover {
    background: #f0f4ff;
    border-color: #764ba2;
}

.dropzone-content {
    pointer-events: none;
}

.dropzone svg {
    color: #667eea;
    margin-bottom: 20px;
}

.dropzone p {
    color: #666;
    margin: 10px 0;
}

.or-text {
    color: #999;
    font-size: 0.9rem;
    margin: 20px 0 !important;
}

.preview-image {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    object-fit: contain;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

.btn-large {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    margin-top: 20px;
}

/* Options Section */
.options-section {
    /* Remove margin-top since we're using grid gap */
}

.generation-types {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.generation-option {
    display: flex;
    align-items: center;
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.generation-option:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.generation-option input[type="radio"] {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.generation-option input[type="radio"]:checked + span {
    color: #667eea;
    font-weight: 600;
}

.text-input-section {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.text-input-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.text-input-section input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
}

.text-input-section input:focus {
    outline: none;
    border-color: #667eea;
}

/* Progress Section */
.progress-section {
    margin-top: 40px;
    text-align: center;
}

.stage-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0;
}

.stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.stage-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    transition: all 0.3s;
}

.stage.active .stage-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stage-label {
    font-size: 0.9rem;
    color: #666;
}

.stage.active .stage-label {
    color: #667eea;
    font-weight: 600;
}

.stage-divider {
    width: 100px;
    height: 2px;
    background: #e0e0e0;
    margin: 0 20px;
}

.progress-bar-container {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
    margin: 10px 0;
}

.progress-message {
    color: #666;
    font-size: 1.1rem;
}

/* Result Section */
.result-section {
    margin-top: 40px;
    text-align: center;
}

.result-image-container {
    margin: 30px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    min-height: 300px;
}

.result-image-container img {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}

.result-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
}

/* Error Section */
.error-section {
    margin-top: 40px;
    text-align: center;
}

.error-section .error-message {
    font-size: 1.1rem;
    margin: 20px 0;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .main-content {
        padding: 20px;
    }
    
    /* Stack columns on mobile */
    .content-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .upload-section {
        position: static; /* Remove sticky on mobile */
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .logout-link {
        position: static;
        display: inline-block;
        margin-top: 10px;
    }
}