/* Navbar Customization */
.navbar-custom {
    background-color: #113065;
}

/* Container Customization */
.container {
    padding-top: 50px;
    padding-bottom: 30px;
}

/* Form Section Styling */
.form-section {
    background-color: #f8f9fa;
    /* Light gray background */
    padding: 20px;
    /* Add padding */
    border-radius: 10px;
    /* Rounded corners */
    border: 1px solid #e3e6f0;
    /* Subtle border */
    margin-bottom: 30px;
    /* Space between form sections */
}

/* Form Field Styling */
.form-group {
    margin-bottom: 15px;
}

.form-control {
    border-radius: 5px;
    border: 1px solid #ced4da;
    padding: 10px;
}

/* Button Group Styling for Actions */
.btn-group {
    display: flex;
    justify-content: space-around;
    /* Distribute buttons evenly */
    align-items: center;
    gap: 8px;
    /* Spacing between buttons */
}

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
    border-radius: 4px;
}

/* Enhanced Search Button */
.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

/* Specific Button Styling */
.btn-info {
    background-color: #17a2b8;
    border-color: #17a2b8;
    color: #fff;
}

.btn-warning {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #fff;
}

.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

.btn-info:hover,
.btn-warning:hover,
.btn-danger:hover {
    opacity: 0.85;
}

/* Table Row Hover Effect */
.table-hover tbody tr:hover {
    background-color: #f8f9fa;
}

/* Card Styling */
.card {
    border: 1px solid #e3e6f0;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
    margin-bottom: 20px;
    /* Space between cards */
}

/* Enhanced Card Hover Effect */
.card:hover {
    transform: translateY(-10px);
    transition: all 0.3s ease-in-out;
}

.card-title {
    font-size: 18px;
    font-weight: bold;
    color: #113065;
}

.card-text {
    font-size: 14px;
    color: #6c757d;
}

/* Card Image Styling */
.card-img-top {
    max-height: 150px;
    object-fit: cover;
    width: 100%;
}


/* Agency Logo Styling */
.agency-logo {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 30px;
    height: auto;
    z-index: 10;
}

/* More Features Section */
.more-features-section {
    margin-bottom: 20px;
}

/* Styling for the Tabs */
.nav-tabs .nav-link.active {
    background-color: #113065;
    color: #fff;
    border-radius: 5px 5px 0 0;
}

.nav-tabs .nav-link {
    color: #113065;
    border-radius: 5px 5px 0 0;
}

.nav-tabs .nav-link:hover {
    background-color: #f8f9fa;
    color: #113065;
}

/* Image management in property form */
.property-form-images img {
    max-height: 150px;
    object-fit: cover;
    margin-bottom: 10px;
}

.property-form-images .form-check {
    margin-top: 10px;
}

/* Ensure lightbox images are scaled appropriately */
.lg-item img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    object-fit: contain;
    /* Ensure that the image scales properly without distorting */
}

/* Custom CSS for other sections */
.carousel-item .lg-item>img {
    height: 600px;
    object-fit: cover;
}

.map-container {
    width: 100%;
    height: 400px;
    margin: 20px 0;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.map-container p {
    padding: 20px;
    margin: 0;
    color: #6c757d;
}

/* Select2 Base Styles */
.select2-container {
    max-width: 100% !important;
    width: 100% !important;
}

.select2-container--bootstrap-5 {
    display: block !important;
}

.select2-container--bootstrap-5 .select2-selection {
    min-height: 38px;
    max-width: 100%;
}

.select2-container .select2-selection--single {
    height: 38px !important;
    border: 1px solid #ced4da !important;
    border-radius: 4px !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 36px !important;
    padding-left: 12px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px !important;
}

/* Dropdown Styles */
.select2-dropdown {
    max-width: 500px !important;
    /* Adjust this value as needed */
    width: 100% !important;
    border: 1px solid #ced4da !important;
    border-radius: 4px !important;
}

.select2-search--dropdown {
    padding: 8px !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid #ced4da !important;
    border-radius: 4px !important;
    padding: 6px !important;
}

.select2-results {
    max-width: 100%;
    width: auto !important;
}

.select2-results__options {
    max-height: 250px !important;
    overflow-y: auto !important;
}

.select2-results__option {
    padding: 6px 12px !important;
}

/* Remove all width-related animations and transitions */
.select2-container,
.select2-dropdown,
.select2-search,
.select2-results {
    transition: none !important;
}

/* Ensure dropdown aligns with container */
.select2-container--open .select2-dropdown {
    left: 0 !important;
    width: 100% !important;
}

/* Animation */
@keyframes select2FadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus States */
.select2-search--focused .select2-search__field {
    background-color: #fff !important;
}

/* Add these to your existing Select2 styles */

/* Ensure search field is always visible and accessible */
.select2-container--open .select2-dropdown {
    margin-top: 0;
}

.select2-container--open .select2-search--dropdown {
    padding-top: 4px;
    position: sticky;
    top: 0;
    z-index: 1;
    background: white;
}

.select2-search__field:focus {
    outline: none !important;
    border-color: #80bdff !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, .25) !important;
}

/* Keep dropdown open when no results */
.select2-container--open .select2-dropdown--below {
    border-top: 1px solid #ced4da !important;
}

.select2-container--default .select2-results__message {
    padding: 6px 12px !important;
    color: #6c757d !important;
}

/* Update these Select2 styles */

/* Container width consistency */
.select2-container {
    width: 100% !important;
    max-width: 100% !important;
}

/* Dropdown width consistency */
/* Update Select2 dropdown to ensure proper width */
.select2-dropdown {
    border: 1px solid #ced4da !important;
    border-radius: 4px !important;
    width: auto !important;
    /* Adjust width so it doesn't stretch across the entire screen */
    min-width: 100% !important;
    max-width: 500px !important;
    /* Limit the dropdown width to avoid stretching */
    box-sizing: border-box !important;
}

/* Remove stretching from Select2 container */
.select2-container--open {
    width: auto !important;
    min-width: 100% !important;
    max-width: 500px !important;
    /* Match the dropdown width limit */
}

/* Add these styles to your existing CSS */
.gallery-container {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
}

.property-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 1rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* LightGallery Custom Styles */
.lg-backdrop {
    background-color: rgba(0, 0, 0, 0.85);
}

.lg-toolbar {
    background-color: rgba(0, 0, 0, 0.45);
}

.lg-counter {
    color: #fff;
}

.lg-thumb-outer {
    background-color: rgba(0, 0, 0, 0.45);
}

.lg-thumb-item {
    border: 2px solid #ddd;
    border-radius: 4px;
}

.lg-thumb-item.active,
.lg-thumb-item:hover {
    border-color: #fff;
}

/* Custom loading animation */
.lg-loading:after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Gallery styles */
#gallery-container {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
}

#property-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.gallery-item {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 3/2;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* LightGallery customization */
.lg-backdrop {
    background-color: rgba(0, 0, 0, 0.9);
}

.lg-toolbar {
    background-color: rgba(0, 0, 0, 0.45);
}

.lg-sub-html {
    background-color: rgba(0, 0, 0, 0.6);
}

.lg-thumb-outer {
    background-color: rgba(0, 0, 0, 0.45);
}

.lg-thumb-item {
    border: 2px solid #ddd;
    border-radius: 4px;
}

.lg-thumb-item.active,
.lg-thumb-item:hover {
    border-color: #fff;
}

/* Add these gallery-specific styles */
#gallery-container {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#property-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 15px;
}

.gallery-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 3/2;
    display: block;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #property-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
}
