/* Map Modal Styles */
.map-modal-container {
    display: flex;
    height: 70vh;
    min-height: 500px;
}

.map-modal-sidebar {
    width: 350px;
    background: #f8f9fa;
    border-right: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-map {
    flex: 1;
    height: 100%;
    background: #e9ecef;
}

.search-section {
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
    background: white;
}

.search-section h6 {
    color: #495057;
    margin-bottom: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-section h6 i {
    color: #007bff;
}

.input-group {
    margin-bottom: 15px;
}

.input-group .form-control {
    border-radius: 8px 0 0 8px;
    border: 2px solid #e9ecef;
    padding: 12px 15px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.input-group .form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.input-group .btn {
    border-radius: 0 8px 8px 0;
    padding: 12px 15px;
    background: #007bff;
    border: 2px solid #007bff;
    transition: all 0.3s ease;
}

.input-group .btn:hover {
    background: #0056b3;
    border-color: #0056b3;
    transform: translateY(-1px);
}

.popular-cities {
    margin-top: 15px;
}

.city-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.city-tag {
    display: inline-block;
    padding: 6px 12px;
    background: #e9ecef;
    color: #495057;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #dee2e6;
}

.city-tag:hover {
    background: #007bff;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.results-section {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.results-section h6 {
    color: #495057;
    margin-bottom: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.results-section h6 i {
    color: #28a745;
}

.search-results-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.search-results-list .alert {
    margin-bottom: 15px;
    font-size: 14px;
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: 500;
}

.search-result-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

.search-result-item:hover {
    border-color: #228B22 !important;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
    transform: translateY(-2px);
}

.search-result-item:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

.search-result-item h6 {
    color: #212529;
    margin-bottom: 6px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
}

.search-result-item p {
    color: #6c757d;
    font-size: 13px;
    margin-bottom: 8px;
    line-height: 1.4;
}

.search-result-item .business-type {
    display: inline-block;
    padding: 4px 10px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 500;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Enhanced business item layout */
.search-result-item .business-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.search-result-item .business-image {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid #f8f9fa;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-result-item .business-details {
    flex: 1;
    min-width: 0;
}

.search-result-item .business-name {
    font-weight: 600;
    color: #212529;
    margin-bottom: 4px;
    font-size: 15px;
}

.search-result-item .business-address {
    color: #6c757d;
    font-size: 13px;
    margin-bottom: 6px;
    line-height: 1.3;
}

.search-result-item .business-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.search-result-item .business-type-badge {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.search-result-item .business-distance {
    background: #f8f9fa;
    color: #6c757d;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
}

/* Loading state for search results */
.search-results-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #6c757d;
}

.search-results-loading .spinner {
    margin-right: 12px;
}

/* Empty state for search results */
.search-results-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.search-results-empty i {
    font-size: 48px;
    color: #dee2e6;
    margin-bottom: 16px;
    display: block;
}

.search-results-empty h5 {
    color: #495057;
    margin-bottom: 8px;
    font-weight: 500;
}

.search-results-empty p {
    color: #6c757d;
    font-size: 14px;
    margin: 0;
}

/* Modal Animation */
.modal.fade .modal-dialog {
    transform: scale(0.8);
    transition: transform 0.3s ease-out;
}

.modal.show .modal-dialog {
    transform: scale(1);
}

/* Ensure modal is properly sized */
.modal-xl {
    max-width: 95%;
}

@media (max-width: 768px) {
    .modal-xl {
        max-width: 98%;
        margin: 5px;
    }
}

/* Loading Animation */
.search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Responsive Design */

/* Large Tablets and Small Laptops */
@media (max-width: 1024px) {
    .map-modal-container {
        height: 75vh;
    }
    
    .map-modal-sidebar {
        width: 300px;
    }
    
    .modal-xl {
        max-width: 90%;
    }
}

/* Tablets */
@media (max-width: 768px) {
    .map-modal-container {
        flex-direction: column;
        height: 80vh;
    }
    
    .map-modal-sidebar {
        width: 100%;
        height: 40%;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
        overflow-y: auto;
    }
    
    .modal-map {
        height: 60%;
    }
    
    .modal-dialog {
        margin: 15px;
        max-width: calc(100% - 30px);
        height: 85vh;
    }
    
    .map-modal-content-side {
        height: 100%;
    }
    
    .modal-body {
        height: calc(100% - 60px);
    }
    
    .search-section {
        padding: 15px;
    }
    
    .results-section {
        padding: 15px;
    }
    
    .search-results-list {
        max-height: 180px;
        overflow-y: auto;
    }
    
    .search-result-item {
        padding: 12px;
        margin-bottom: 8px;
    }
    
    .search-result-item h6 {
        font-size: 14px;
    }
    
    .search-result-item p {
        font-size: 12px;
    }
    
    .search-result-item img {
        width: 35px !important;
        height: 35px !important;
    }
    
    .input-group .form-control {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .input-group .btn {
        padding: 10px 12px;
    }
}

/* Mobile Phones */
@media (max-width: 576px) {
    .map-modal-container {
        height: 85vh;
    }
    
    .map-modal-sidebar {
        height: 45%;
    }
    
    .modal-map {
        height: 55%;
    }
    
    .modal-dialog {
        margin: 8px;
        max-width: calc(100% - 16px);
        height: 90vh;
    }
    
    .search-section {
        padding: 12px;
    }
    
    .results-section {
        padding: 12px;
    }
    
    .search-section h6,
    .results-section h6 {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .search-results-list {
        max-height: 150px;
        padding: 8px;
    }
    
    .search-result-item {
        padding: 10px;
        margin-bottom: 6px;
    }
    
    .search-result-item h6 {
        font-size: 13px;
        margin-bottom: 3px;
    }
    
    .search-result-item p {
        font-size: 11px;
        margin-bottom: 5px;
    }
    
    .search-result-item img {
        width: 30px !important;
        height: 30px !important;
        margin-right: 8px !important;
    }
    
    .search-result-item .business-type {
        font-size: 9px;
        padding: 1px 6px;
    }
    
    .input-group {
        margin-bottom: 12px;
    }
    
    .input-group .form-control {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .input-group .btn {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .city-tags {
        gap: 6px;
    }
    
    .city-tag {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .alert {
        padding: 8px 12px;
        font-size: 12px;
        margin-bottom: 10px;
    }
}

/* Extra Small Mobile Phones */
@media (max-width: 375px) {
    .map-modal-container {
        height: 88vh;
    }
    
    .map-modal-sidebar {
        height: 48%;
    }
    
    .modal-map {
        height: 52%;
    }
    
    .modal-dialog {
        margin: 5px;
        max-width: calc(100% - 10px);
        height: 92vh;
    }
    
    .search-section,
    .results-section {
        padding: 10px;
    }
    
    .search-results-list {
        max-height: 120px;
        padding: 6px;
    }
    
    .search-result-item {
        padding: 8px;
        margin-bottom: 5px;
    }
    
    .search-result-item h6 {
        font-size: 12px;
    }
    
    .search-result-item p {
        font-size: 10px;
    }
    
    .search-result-item img {
        width: 25px !important;
        height: 25px !important;
        margin-right: 6px !important;
    }
    
    .input-group .form-control {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .input-group .btn {
        padding: 6px 8px;
        font-size: 12px;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .map-modal-container {
        height: 90vh;
    }
    
    .map-modal-sidebar {
        height: 35%;
    }
    
    .modal-map {
        height: 65%;
    }
    
    .search-results-list {
        max-height: 100px;
    }
    
    .search-result-item {
        padding: 6px 8px;
        margin-bottom: 4px;
    }
    
    .search-result-item h6 {
        font-size: 11px;
        margin-bottom: 2px;
    }
    
    .search-result-item p {
        font-size: 9px;
    }
    
    .search-result-item img {
        width: 20px !important;
        height: 20px !important;
        margin-right: 6px !important;
    }
}

/* Custom Scrollbar */
.search-results-list::-webkit-scrollbar {
    width: 6px;
}

.search-results-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.search-results-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.search-results-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Map Controls */
.map-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
}

.map-control-btn {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.map-control-btn:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Success/Error Messages */
.alert {
    border-radius: 8px;
    border: none;
    padding: 12px 15px;
    margin-bottom: 15px;
    font-size: 14px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
}

/* Animation for search results */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-result-item {
    animation: fadeInUp 0.3s ease-out;
}

/* Selected state for search results */
.search-result-item.selected {
    border-color: #007bff;
    background: linear-gradient(135deg, #f8f9ff, #ffffff);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
    transform: translateY(-1px);
}

.search-result-item.selected::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    border-radius: 2px;
}

/* Touch-friendly improvements for mobile */
@media (max-width: 768px) {
    .search-result-item {
        min-height: 60px; /* Increased for better touch targets */
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(0, 123, 255, 0.1);
    }
    
    .search-result-item .business-content {
        gap: 10px;
    }
    
    .search-result-item .business-image {
        width: 45px;
        height: 45px;
    }
    
    .search-result-item .business-name {
        font-size: 14px;
    }
    
    .search-result-item .business-address {
        font-size: 12px;
    }
    
    .search-result-item .business-meta {
        gap: 6px;
        margin-top: 6px;
    }
    
    .search-result-item .business-type-badge,
    .search-result-item .business-distance {
        font-size: 9px;
        padding: 2px 6px;
    }
    
    .city-tag {
        min-height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        -webkit-tap-highlight-color: rgba(0, 123, 255, 0.1);
    }
    
    .input-group .btn {
        min-height: 44px;
        -webkit-tap-highlight-color: rgba(0, 123, 255, 0.1);
    }
    
    .input-group .form-control {
        min-height: 44px;
    }
    
    /* Improve scrolling performance */
    .search-results-list {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    /* Better focus states for accessibility */
    .search-result-item:focus,
    .city-tag:focus,
    .input-group .btn:focus {
        outline: 2px solid #007bff;
        outline-offset: 2px;
    }
    
    /* Enhanced alert styling for mobile */
    .alert {
        padding: 12px 15px;
        font-size: 13px;
        border-radius: 10px;
    }
    
    .alert i {
        margin-right: 8px;
    }
    
    /* Empty state improvements for mobile */
    .search-results-empty {
        padding: 30px 15px;
    }
    
    .search-results-empty i {
        font-size: 36px;
        margin-bottom: 12px;
    }
    
    .search-results-empty h5 {
        font-size: 16px;
        margin-bottom: 6px;
    }
    
    .search-results-empty p {
        font-size: 13px;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .search-result-item {
        border-width: 0.5px;
    }
    
    .city-tag {
        border-width: 0.5px;
    }
}
