/* BalcoDeck AI Generator Styles - assets/balcodeck-ai.css */

#balcodeck-generator {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.generator-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    min-height: 800px;
}

@media (max-width: 768px) {
    .generator-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Input Section */
.input-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.input-section h2 {
    margin: 0 0 30px 0;
    color: #2c3e50;
    font-size: 28px;
    font-weight: 600;
}

.form-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h3 {
    margin: 0 0 20px 0;
    color: #34495e;
    font-size: 18px;
    font-weight: 600;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
    font-size: 14px;
}

.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

.form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Image Upload */
.image-upload-area {
    border: 2px dashed #e1e8ed;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.image-upload-area:hover {
    border-color: #3498db;
    background: #f8f9ff;
}

.image-upload-area.dragover {
    border-color: #3498db;
    background: #f0f8ff;
    transform: scale(1.02);
}

.upload-placeholder span {
    display: block;
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 8px;
    font-weight: 500;
}

.upload-placeholder small {
    color: #7f8c8d;
    font-size: 13px;
}

.image-preview {
    margin-top: 15px;
    text-align: center;
}

.image-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.image-preview .remove-image {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 12px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

/* Generate Button */
.generate-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.3);
}

.generate-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

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

/* Output Section */
.output-section {
    background: white;
    border-radius: 12px;
    border: 2px solid #e9ecef;
    overflow: hidden;
}

.output-header {
    padding: 20px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.output-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
}

.output-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.output-info span {
    color: #7f8c8d;
    font-size: 13px;
}

.output-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 8px 12px;
    background: white;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #2c3e50;
}

.action-btn:hover {
    background: #f8f9fa;
    border-color: #3498db;
}

.output-container {
    position: relative;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.output-placeholder {
    text-align: center;
    color: #7f8c8d;
}

.placeholder-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.output-placeholder p {
    font-size: 16px;
    margin: 0;
}

.output-image {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 20px;
}

.output-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.output-loading {
    text-align: center;
    color: #3498db;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e1e8ed;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px auto;
}

.output-loading p {
    font-size: 16px;
    margin: 0 0 8px 0;
    font-weight: 500;
}

.output-loading small {
    color: #7f8c8d;
    font-size: 13px;
}

.output-error {
    text-align: center;
    color: #e74c3c;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.8;
}

.output-error p {
    font-size: 16px;
    margin: 0 0 8px 0;
    font-weight: 500;
}

.output-error small {
    color: #95a5a6;
    font-size: 13px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #balcodeck-generator {
        padding: 10px;
    }
    
    .input-section {
        padding: 20px;
    }
    
    .output-header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .output-actions {
        align-self: stretch;
    }
    
    .action-btn {
        flex: 1;
        text-align: center;
    }
}

/* Animation for form appearance */
.form-section {
    animation: slideInUp 0.3s ease-out;
}

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

/* Focus states for accessibility */
.form-group select:focus,
.generate-btn:focus,
.action-btn:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Loading state for form */
.form-loading {
    pointer-events: none;
    opacity: 0.7;
}

.form-loading .form-group select {
    background-color: #f8f9fa;
}

/* Success state styling */
.generation-success .output-section {
    border-color: #27ae60;
}

.generation-success .output-header {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
}

.generation-success .output-header h3 {
    color: white;
}

/* Error state styling */
.generation-error .output-section {
    border-color: #e74c3c;
}

.generation-error .output-header {
    background: #fdf2f2;
    color: #e74c3c;
}