/* HJ Product Management Frontend Styles */

/* Form Container Styles */
.hj-dealer-registration-form,
.hj-product-submission-form {
    max-width: 800px;
    margin: 20px auto;
    padding: 30px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.hj-dealer-registration-form h3,
.hj-product-submission-form h3 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #333;
    font-size: 24px;
    text-align: center;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

/* Form Section Styles */
.hj-form-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 6px;
    border-left: 4px solid #0073aa;
}

.hj-form-section h4 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #0073aa;
    font-size: 18px;
}

/* Form Row Styles */
.hj-form-row {
    margin-bottom: 20px;
}

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

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

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

.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);
}

.hj-form-row input:disabled,
.hj-form-row select:disabled {
    background-color: #f5f5f5;
    color: #666;
    cursor: not-allowed;
}

.hj-form-row textarea {
    resize: vertical;
    min-height: 80px;
}

/* Checkbox Group Styles */
.hj-checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.hj-checkbox-label {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hj-checkbox-label:hover {
    background: #f0f8ff;
    border-color: #0073aa;
}

.hj-checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    width: auto;
}

.hj-checkbox-label input[type="checkbox"]:checked + span {
    font-weight: 600;
    color: #0073aa;
}

/* Image Upload Styles */
.hj-image-upload {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: border-color 0.3s ease;
}

.hj-image-upload:hover {
    border-color: #0073aa;
}

.hj-image-upload input[type="file"] {
    width: 100%;
    padding: 10px;
    border: none;
    background: transparent;
}

.hj-image-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.hj-image-item {
    position: relative;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.hj-image-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.hj-remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: #d63638;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.hj-remove-image:hover {
    background: #b32d2e;
}

.hj-upload-progress {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Submit Button Styles */
.hj-submit-btn {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-width: 150px;
}

.hj-submit-btn:hover {
    background: #005a87;
    transform: translateY(-1px);
}

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

.hj-submit-btn .btn-loading {
    display: none;
}

.hj-submit-btn:disabled .btn-text {
    display: none;
}

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

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

.hj-success-message,
.hj-error-message,
.hj-info-message {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-weight: 500;
}

.hj-success-message {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .hj-dealer-registration-form,
    .hj-product-submission-form {
        margin: 10px;
        padding: 20px;
    }
    
    .hj-form-section {
        padding: 15px;
    }
    
    .hj-checkbox-group {
        grid-template-columns: 1fr;
    }
    
    .hj-image-preview {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .hj-image-item img {
        height: 100px;
    }
}

@media (max-width: 480px) {
    .hj-dealer-registration-form h3,
    .hj-product-submission-form h3 {
        font-size: 20px;
    }
    
    .hj-form-section h4 {
        font-size: 16px;
    }
    
    .hj-submit-btn {
        width: 100%;
        padding: 15px;
    }
}

/* Loading Animation */
@keyframes hj-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hj-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: hj-spin 1s linear infinite;
    margin-right: 8px;
}

/* Form Validation Styles */
.hj-form-row input.error,
.hj-form-row select.error,
.hj-form-row textarea.error {
    border-color: #d63638;
    box-shadow: 0 0 0 2px rgba(214, 54, 56, 0.1);
}

.hj-field-error {
    color: #d63638;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* Success States */
.hj-form-row input.success,
.hj-form-row select.success,
.hj-form-row textarea.success {
    border-color: #46b450;
    box-shadow: 0 0 0 2px rgba(70, 180, 80, 0.1);
}

/* Accessibility Improvements */
.hj-form-row label:focus-within {
    color: #0073aa;
}

.hj-submit-btn:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.hj-checkbox-label:focus-within {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .hj-dealer-registration-form,
    .hj-product-submission-form {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .hj-submit-btn,
    .hj-image-upload,
    .hj-form-messages {
        display: none;
    }
}
