/**
 * Car Selling Form Styles
 */

:root {
    --csf-primary-color: #BE0000;
    --csf-hover-color: #48535f;
}

.car-selling-form-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

.car-selling-form {
    background: #fff;
    border-radius: 5px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.car-selling-form .form-row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.car-selling-form .form-group {
    margin-top: 10px;
    margin-bottom: 20px;
    width: 100%;
}

.car-selling-form .col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding-right: 15px;
    padding-left: 15px;
    box-sizing: border-box;
}

.car-selling-form .col-md-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
    padding-right: 15px;
    padding-left: 15px;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .car-selling-form .col-md-6,
    .car-selling-form .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

.car-selling-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--csf-primary-color);
}

.car-selling-form label .required {
    color: #e53935;
}

.car-selling-form .form-control {
    display: block;
    width: 100%;
    padding: 10px 15px;
    font-size: 16px;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border-style: solid;
    border-width: 1px;
    border-color: var(--csf-primary-color);
    border-radius: 4px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    box-sizing: border-box;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
}

.car-selling-form .form-control:focus {
    color: #495057;
    background-color: #fff;
    border-color: var(--csf-primary-color);
    outline: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 0 0 0.2rem rgba(var(--csf-primary-color-rgb), 0.25);
}

/* Dropzone styling */
.car-selling-form .dropzone {
    border: 2px dashed var(--csf-primary-color);
    border-radius: 5px;
    background: rgba(var(--csf-primary-color-rgb), 0.1);
    min-height: 150px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    margin-bottom: 15px;
    position: relative;
}

.car-selling-form .dropzone .dz-message {
    margin: 2em 0;
}

.car-selling-form .dropzone .dz-message .note {
    display: block;
    font-size: 0.8em;
    margin-top: 10px;
    color: #666;
}

.car-selling-form .dropzone .dz-preview {
    position: relative;
    display: inline-block;
    vertical-align: top;
    margin: 8px;
    min-height: 60px;
}

.car-selling-form .dropzone .dz-preview .dz-image {
    border-radius: 10px;
    overflow: hidden;
    width: 80px;
    height: 80px;
    position: relative;
    display: block;
    z-index: 10;
}

.car-selling-form .dropzone .dz-preview .dz-remove {
    text-decoration: none;
    display: block;
    margin-top: 3px;
    cursor: pointer;
    color: #dc3545;
    font-size: 10px;
    text-align: center;
}

/* Hide filename and file size in dropzone previews */
#car-images-preview .dz-filename,
#car-images-preview .dz-size,
#car-images-preview .dz-details {
    display: none !important;
}

.car-selling-form .dropzone .dz-filename,
.car-selling-form .dropzone .dz-size,
.car-selling-form .dropzone .dz-details {
    display: none !important;
}

/* Make dropzone previews in the preview container smaller */
#car-images-preview .dz-preview {
    position: relative;
    display: inline-block;
    vertical-align: top;
    margin: 8px;
    min-height: 60px;
}

#car-images-preview .dz-image {
    border-radius: 10px;
    overflow: hidden;
    width: 80px;
    height: 80px;
    position: relative;
    display: block;
    z-index: 10;
}

#car-images-preview .dz-remove {
    text-decoration: none;
    display: block;
    margin-top: 3px;
    cursor: pointer;
    color: #dc3545;
    font-size: 10px;
    text-align: center;
}

.car-selling-form .image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.car-selling-form .image-preview {
    width: 80px;
    height: 80px;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    border: 1px solid #ddd;
}

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

.car-selling-form .image-preview .remove-image {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    text-align: center;
    line-height: 16px;
    cursor: pointer;
    color: #e53935;
    font-weight: bold;
    font-size: 12px;
}

/* Submit button */
.car-selling-form .submit-button {
    display: inline-block;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 12px 30px;
    font-size: 16px;
    line-height: 1.5;
    border-radius: 4px;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    color: #fff;
    background-color: var(--csf-primary-color);
    border-color: var(--csf-primary-color);
    cursor: pointer;
}

.car-selling-form .submit-button:hover {
    color: #fff;
    background-color: var(--csf-hover-color);
    border-color: var(--csf-hover-color);
}

.car-selling-form .submit-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5);
}

/* Form messages */
.car-selling-form .form-messages {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
    display: none;
}

.car-selling-form .form-messages.success {
    background-color: #d4edda;
    border: 2px solid #28a745;
    color: #155724;
    display: block;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.2);
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% {
        transform: scale(0.95);
        opacity: 0;
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.car-selling-form .form-messages.error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
    display: block;
}

/* Loading indicator */
.car-selling-form .form-loading {
    display: none;
    text-align: center;
    margin-top: 20px;
}

.car-selling-form .form-loading .spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(0, 123, 255, 0.3);
    border-radius: 50%;
    border-top-color: #007bff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

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

/* Modal styles */
.csf-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.csf-modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 5px;
    position: relative;
}

.csf-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.csf-modal-close:hover,
.csf-modal-close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.csf-modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.csf-btn {
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    border: 1px solid transparent;
}

.csf-btn-primary {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.csf-btn-primary:hover {
    background-color: #0069d9;
    border-color: #0062cc;
}

.csf-btn-secondary {
    background-color: #6c757d;
    color: white;
    border-color: #6c757d;
}

.csf-btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

/* Fix for recaptcha */
.grecaptcha-badge {
    visibility: hidden;
}

/* Lookup button */
.car-selling-form .lookup-button {
    display: inline-block;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 10px 16px;
    font-size: 16px;
    line-height: 1.5;
    border-radius: 4px;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    color: #fff;
    background-color: var(--csf-primary-color);
    border-color: var(--csf-primary-color);
    cursor: pointer;
    width: 100%;
    height: calc(2.25rem + 2px);
    margin-top: 0;
}

.car-selling-form .lookup-button:hover {
    color: #fff;
    background-color: var(--csf-hover-color);
    border-color: var(--csf-hover-color);
}

.car-selling-form .lookup-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.5);
}

/* Car data results */
.car-selling-form .car-data-results {
    margin-top: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: none;
}

.car-selling-form .car-data-results.show {
    display: block;
}

.car-selling-form .car-data-results h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #495057;
}

.car-selling-form .car-data-results .car-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.car-selling-form .car-data-results .car-info-item {
    margin-bottom: 8px;
}

.car-selling-form .car-data-results .car-info-label {
    font-weight: 600;
    color: #495057;
}

.car-selling-form .car-data-results .car-info-value {
    color: #212529;
}

@media (max-width: 768px) {
    .car-selling-form .car-data-results .car-info-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .car-selling-form .input-group .form-control,
    .car-selling-form .input-group-text {
        font-size: 16px;
        padding: 12px 15px;
    }
    
    .car-selling-form .license-plate-symbol {
        padding: 0;
        min-width: 44px;
    }
    
    .car-selling-form .license-plate-icon {
        width: 28px;
        min-height: 30px;
    }
    
    .car-selling-form .lookup-button {
        padding: 12px 16px;
        margin-top: 10px;
        height: auto;
    }
}

/* Uppercase input styling */
.car-selling-form .uppercase-input {
    text-transform: uppercase;
}

/* Input group styling */
.car-selling-form .input-group {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
}

.car-selling-form .form-row .form-group {
    margin-bottom: 0;
}

.car-selling-form .input-group .form-control {
    position: relative;
    flex: 1 1 auto;
    width: 1%;
    margin-bottom: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.car-selling-form .input-group .form-control:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.car-selling-form .input-group .form-control:focus {
    z-index: 3;
    border-color: var(--csf-primary-color);
    outline: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 0 0 0.2rem rgba(var(--csf-primary-color-rgb), 0.25);
}

.car-selling-form .input-group .form-control:focus + .input-group-append .input-group-text {
    border-color: var(--csf-primary-color);
}

.car-selling-form .input-group-append {
    margin-left: -1px;
    display: flex;
}

.car-selling-form .input-group-text {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    margin-bottom: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    color: #495057;
    text-align: center;
    white-space: nowrap;
    border: 1px solid var(--csf-primary-color);
    border-radius: 4px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

#car-reg-number, #car-reg-number {
    border-left: none;
    background: none;
}

.car-selling-form .input-group-prepend {
    margin-right: -1px;
    display: flex;
}

.car-selling-form .input-group-prepend .input-group-text {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.car-selling-form .input-group-prepend .input-group-text:focus-within,
.car-selling-form .input-group .form-control:focus ~ .input-group-prepend .input-group-text {
    border-color: var(--csf-primary-color);
}

.car-selling-form .euro-symbol {
    background-color: #ffebee;
    color: var(--csf-primary-color);
    font-weight: bold;
}

.car-selling-form .license-plate-symbol {
    color: #495057;
    padding: 0;
    border-color: var(--csf-primary-color);
    border-right: none;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    border-radius: 4px 0 0 4px;
}

.car-selling-form .license-plate-icon {
    margin-left: -16px;
    width: 32px;
    height: 100%;
    min-height: 36px;
    object-fit: cover;
    display: block;
    border-radius: 3px 0 0 3px;
}

.car-selling-form .license-plate-icon:before {
    content: "EST";
    display: inline-block;
    font-size: 10px;
    font-weight: bold;
    color: #495057;
    position: absolute;
    opacity: 0;
}

.car-selling-form .license-plate-icon[alt]:after {
    content: attr(alt);
    font-size: 10px;
    font-weight: bold;
    color: #495057;
    display: none;
}

#car-reg-number {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

.input-group-prepend {
    width: 34px;
}

/* Safari specific overrides to remove blue focus borders */
.car-selling-form input:focus,
.car-selling-form select:focus,
.car-selling-form textarea:focus,
.car-selling-form button:focus {
    outline: none !important;
    -webkit-appearance: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

/* Remove Safari's default input styling */
.car-selling-form input[type="text"],
.car-selling-form input[type="email"],
.car-selling-form input[type="tel"],
.car-selling-form input[type="number"],
.car-selling-form select,
.car-selling-form textarea {
    -webkit-appearance: none;
    -webkit-border-radius: 4px;
}

/* Disable textarea resizing */
.car-selling-form textarea {
    resize: none;
}

#lookup-car-btn {
    height: 57px;
}
