/* Container and Layout */
.resale-form-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.resale-form-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.resale-form-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    padding: 1.5rem 2rem;
    margin: 0;
}

.resale-form-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.resale-form-body {
    padding: 2rem;
}

/* Grid System */
.form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.75rem;
}

.form-col {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 0.75rem;
}

.form-col-full {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0 0.75rem;
}

/* Bootstrap-style Grid System */
.row {
    margin-right: -0.75rem;
    margin-left: -0.75rem;
}

.col-md-6 {
    position: relative;
    width: 100%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

.col-md-4 {
    position: relative;
    width: 100%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

.col-12 {
    position: relative;
    width: 100%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
    flex: 0 0 100%;
    max-width: 100%;
}

.col-md-12{
    float: left;
    width: 100%;
}

/* Map Styles */
.property-map {
    width: 100%;
    height: 400px;
    border: 2px solid #ced4da;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
    background-color: #f8f9fa;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.address-search-container {
    position: relative;
    margin-bottom: 1rem;
}

.address-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.search-result-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f1f1f1;
    font-size: 0.9rem;
    color: #495057;
    transition: background-color 0.2s;
}

.search-result-item:hover {
    background-color: #f8f9fa;
    color: #495057;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item.no-results {
    padding: 15px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}
/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
        float: left;
    }
    
    .col-md-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
        float: left;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (max-width: 767.98px) {
    .col-md-6,
    .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
        float: left;
    }
    
    .row {
        margin-right: -0.5rem;
        margin-left: -0.5rem;
    }
    
    .col-md-6,
    .col-md-4,
    .col-12 {
        padding-right: 0.5rem;
        padding-left: 0.5rem;
        float: left;
    }
}

/* Container Styles */
.container {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }
}

@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333333;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #ffffff;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-control:disabled,
.form-control[readonly] {
    background-color: #f8f9fa;
    opacity: 1;
}

/* Select Elements */
.form-select {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    appearance: none;
    box-sizing: border-box;
}

.form-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

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

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

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

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    text-align: center;
    white-space: nowrap;
    background-color: #f8f9fa;
    border: 1px solid #ced4da;
    border-left: 0;
    border-radius: 0;
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

/* Form Text */
.form-text {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #6c757d;
}

/* Button Styles */
.btn {
    display: inline-block;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 0.375rem;
    transition: all 0.15s ease-in-out;
    box-sizing: border-box;
}
.privacy-notice small {
    margin-top: 0 !important;
    margin-bottom: 20px;
    display: block;
}
.btn-primary {
    color: #ffffff;
    background: linear-gradient(135deg, #1a2444 0%, #764ba2 100%);
    border-color: #5d4188;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1a2444 0%, #6a4190 100%);
    border-color: #1a2444;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    border-radius: 0.5rem;
}

/* Text Alignment */
.text-center {
    text-align: center;
}

/* Spacing Utilities */
.mb-3 {
    margin-bottom: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.px-5 {
    padding-left: 3rem;
    padding-right: 3rem;
}

.my-5 {
    margin-top: 3rem;
    margin-bottom: 3rem;
}

/* Hidden Elements */
[style*="display:none"],
[style*="display: none"] {
    display: none !important;
}

/* Select2 Custom Styling */
.select2-container {
    width: 100% !important;
    min-width: 100% !important;
}

.select2-container--default .select2-selection--multiple {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    min-height: 45px !important;
    max-height: 120px;
    overflow-y: auto;
    width: 100% !important;
    background-color: #ffffff;
}

.select2-container--default .select2-selection--multiple:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    padding: 4px 8px;
    width: 100% !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #ffffff;
    padding: 4px 8px;
    margin: 2px;
    font-size: 0.875rem;
    line-height: 1.2;
    border-radius: 0.25rem;
    max-width: calc(100% - 10px);
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: #ffffff;
    margin-right: 5px;
    font-size: 14px;
    font-weight: bold;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #ffcccc;
}

.select2-dropdown {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid #ced4da;
    padding: 8px;
    border-radius: 0.25rem;
    font-size: 0.9rem;
}

.select2-container--default .select2-results__option {
    padding: 8px 12px;
    font-size: 0.9rem;
}

.select2-container--default .select2-results__option--highlighted {
    background-color: #667eea;
    color: #ffffff;
}

/* Alert Messages */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
}

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

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .resale-form-container {
        margin: 1rem auto;
        padding: 0 0.5rem;
    }
    
    .resale-form-body {
        padding: 1rem;
    }
    
    .resale-form-header {
        padding: 1rem;
    }
    
    .form-col {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .form-row {
        margin: 0 -0.5rem;
    }
    
    .form-col,
    .form-col-full {
        padding: 0 0.5rem;
    }
    
    .btn-lg {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    .px-5 {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (max-width: 480px) {
    .resale-form-header h3 {
        font-size: 1.25rem;
    }
    
    .form-control,
    .form-select {
        padding: 0.625rem;
        font-size: 0.9rem;
    }
    
    .input-group-text {
        padding: 0.625rem;
        font-size: 0.9rem;
    }
}

/* Loading State */
.form-loading {
    opacity: 0.6;
    pointer-events: none;
}

.form-loading .btn {
    position: relative;
}

.form-loading .btn::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Card Styles for Bootstrap compatibility */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
}

.card-header {
    padding: 1rem 1.25rem;
    margin-bottom: 0;
    background-color: rgba(0,0,0,.03);
    border-bottom: 1px solid rgba(0,0,0,.125);
    border-top-left-radius: calc(0.375rem - 1px);
    border-top-right-radius: calc(0.375rem - 1px);
}

.card-body {
    flex: 1 1 auto;
    padding: 1.25rem;
}

/* Form Check Styles */
.form-check {
    position: relative;
    display: block;
    padding-left: 1.25rem;
    margin-bottom: 0.125rem;
}

.form-check-input {
    position: absolute;
    margin-top: 0.3rem;
    margin-left: -1.25rem;
    width: 1rem;
    height: 1rem;
}

.form-check-label {
    margin-bottom: 0;
    font-weight: 400;
}

/* Additional responsive adjustments */
@media (max-width: 575.98px) {
    .container {
        padding-right: 10px;
        padding-left: 10px;
    }
    
    .my-5 {
        margin-top: 2rem;
        margin-bottom: 2rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-header {
        padding: 0.75rem 1rem;
    }
}

/* Ensure form elements work with both grid systems */
.form-row .col-md-6 .form-group,
.row .col-md-6 .form-group,
.form-row .col-md-4 .form-group,
.row .col-md-4 .form-group {
    margin-bottom: 1.5rem;
}

/* Fix for hidden elements in grid */
.row .col-md-6[style*="display:none"],
.row .col-md-6[style*="display: none"] {
    display: none !important;
}

/* Ensure proper spacing between rows */
.row + .row {
    margin-top: 0;
}