/**
 * Dynamic Form Styles
 * Styles for auto-generated forms from WaveSpeed model schema
 */

.dynamic-model-form {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    /* Restored padding */
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Form Header */
.form-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.form-header h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 24px;
    font-weight: 600;
}

.model-description {
    margin: 10px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.model-type-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #007bff;
    color: white;
    font-size: 12px;
    font-weight: 500;
    border-radius: 12px;
    text-transform: uppercase;
}

/* Model Badges Container */
.model-badges {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.model-price-badge {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
    cursor: help;
}

/* Form Fields */
.form-field {
    margin-bottom: 15px;
    /* Reduced by ~40% */
}

.form-field label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Info Icon Tooltip */
.field-info-icon {
    font-size: 14px;
    color: #6c757d;
    cursor: help;
    transition: color 0.2s;
}

.field-info-icon:hover {
    color: #0d6efd;
}


.required-indicator {
    color: #dc3545;
    font-weight: bold;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-control:invalid {
    border-color: #dc3545;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    cursor: pointer;
}

/* Checkbox */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-check {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checkbox-wrapper label {
    margin: 0;
    cursor: pointer;
    user-select: none;
}

/* Help Text (Legacy - now utilizing tooltips) */
.field-help-text {
    display: none;
    /* Hide legacy help text blocks */
    margin-top: 4px;
    color: #6c757d;
    font-size: 11px;
    line-height: 1.3;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    margin-top: 30px;
}

/* Legacy submit styling fallback (kept for pages not yet migrated to btn-platform) */
.submit-btn:not(.btn-platform) {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    color: white;
    background-color: #007bff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.submit-btn:not(.btn-platform):hover {
    background-color: #0056b3;
}

.submit-btn:not(.btn-platform):active {
    transform: translateY(1px);
}

.submit-btn:not(.btn-platform):disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* Alert Messages */
.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Loading State */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #007bff;
    animation: spinner 0.8s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Image Array Uploader */
.image-array-uploader {
    margin-bottom: 15px;
}

.uploader-info {
    margin-bottom: 8px;
}

.upload-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.upload-zone:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.upload-zone.dragover {
    border-color: #667eea;
    background: #e0e7ff;
    transform: scale(1.02);
}

.upload-zone:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.18);
}

.field-invalid .upload-zone,
.upload-zone-invalid {
    border-color: #dc3545;
    background: #fff5f5;
}

.field-error-message {
    font-size: 0.875rem;
    font-weight: 500;
}

.upload-zone-content i {
    font-size: 36px;
    color: #94a3b8;
    margin-bottom: 10px;
}

.upload-zone-content p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
}

.image-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.preview-item:hover .remove-btn {
    opacity: 1;
}

.preview-item .remove-btn:hover {
    background: #dc3545;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dynamic-model-form {
        padding: 15px;
    }

    .form-header h3 {
        font-size: 20px;
    }

    .submit-btn {
        font-size: 14px;
    }
}
