/**
 * Enhanced Product Forms Styling
 */

.hj-product-submission-enhanced {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.hj-product-submission-enhanced h3 {
    color: #333;
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0073aa;
}

.hj-form-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 5px;
}

.hj-form-section h4 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #555;
}

.hj-form-row {
    margin-bottom: 20px;
}

.hj-form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.hj-form-row .required {
    color: #d63638;
}

.hj-form-row input[type="text"],
.hj-form-row input[type="number"],
.hj-form-row input[type="email"],
.hj-form-row input[type="tel"],
.hj-form-row select,
.hj-form-row textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.hj-form-row input:focus,
.hj-form-row select:focus,
.hj-form-row textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

/* Other input fields */
.other-input {
    margin-top: 10px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Brand and Model rows */
.brand-row,
.model-row {
    position: relative;
}

.brand-row .other-input,
.model-row .other-input {
    background-color: #fffbf0;
    border-color: #f0ad4e;
}

/* Image upload */
.hj-image-upload {
    border: 2px dashed #ddd;
    padding: 20px;
    border-radius: 4px;
    background: #fafafa;
    text-align: center;
}

.hj-image-upload input[type="file"] {
    margin-bottom: 15px;
}

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

.image-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

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

.image-preview-item .uploading-status {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 2px;
    font-size: 10px;
    text-align: center;
}

.image-preview-item .remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background: rgba(255, 0, 0, 0.8);
    color: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.image-preview-item .remove-image:hover {
    background: rgba(255, 0, 0, 1);
}

/* Submit button */
.hj-submit-btn {
    background: #0073aa;
    color: #fff;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.hj-submit-btn:hover {
    background: #005a87;
}

.hj-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.hj-submit-btn .btn-loading {
    display: inline-block;
}

/* Messages */
.hj-form-messages {
    margin-top: 20px;
}

.success-message,
.error-message {
    padding: 15px;
    border-radius: 4px;
    margin-top: 20px;
}

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

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

.success-message p,
.error-message p {
    margin: 0;
}

/* Disabled fields */
select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Form type specific styles */
.hj-product-submission-enhanced[data-form-type="tractor"] {
    border-top: 3px solid #28a745;
}

.hj-product-submission-enhanced[data-form-type="harvester"] {
    border-top: 3px solid #ffc107;
}

.hj-product-submission-enhanced[data-form-type="implements"] {
    border-top: 3px solid #17a2b8;
}

/* Responsive design */
@media (max-width: 768px) {
    .hj-product-submission-enhanced {
        padding: 15px;
    }
    
    .hj-form-section {
        padding: 15px;
    }
    
    .hj-image-preview {
        justify-content: center;
    }
    
    .image-preview-item {
        width: 80px;
        height: 80px;
    }
}

/* Loading states */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Tooltip styles */
.field-tooltip {
    position: relative;
    display: inline-block;
    margin-left: 5px;
}

.field-tooltip .tooltip-icon {
    color: #999;
    cursor: help;
}

.field-tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: left;
    border-radius: 4px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    font-weight: normal;
}

.field-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}
