/* Search Modal Styles */
.search-modal {
    position: fixed;
    top: 84px;
    left: 80px;
    z-index: 999;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

.search-modal-content {
    width: 413px;
    max-height: 90vh;
    background: rgba(36, 44, 54, 0.9);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow-y: auto;
    animation: farmModalSlideIn 0.3s ease-out;
}

.search-modal-body {
    padding: 10px 24px;
    height: calc(100% - 50px);
    display: flex;
    flex-direction: column;
}

/* Đảm bảo bản đồ windy luôn hiển thị bình thường khi search modal mở */
body.modal-open #windy {
    opacity: 1 !important;
    filter: none !important;
    pointer-events: auto !important;
}

.google-maps-search {
    display: flex;
    align-items: center;
    background: #F8F9FA;
    border: 1px solid #E9ECEF;
    border-radius: 16px;
    padding: 5px 5px;
    margin-top: 10px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.google-maps-search:focus-within {
    border-color: #4D459B;
    box-shadow: 0 0 0 3px rgba(77, 69, 155, 0.1);
}

.google-maps-search input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    color: #242C36;
    outline: none;
    font-family: 'Wix Madefor Text', sans-serif;
}

.google-maps-search input::placeholder {
    color: #6C757D;
}

/* Search History Styles */
.search-history {
    margin-top: 10px;
    padding: 15px 0px;
    max-height: 400px;
    overflow-y: auto;
}

.search-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 0 5px;
}

.search-history-title {
    font-size: 14px;
    font-weight: 600;
    color: #839598;
    opacity: 0.9;
}

.search-history-clear-btn {
    background: transparent;
    border: none;
    color: #FFFFFF;
    font-size: 12px;
    cursor: pointer;
    opacity: 0.7;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.search-history-clear-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

.search-history-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.search-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.search-history-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.search-history-content {
    flex: 1;
    min-width: 0;
}

.search-history-name {
    font-size: 14px;
    font-weight: 500;
    color: #FFFFFF;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-history-address {
    font-size: 12px;
    color: #FFFFFF;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-history-delete-btn {
    background: transparent;
    border: none;
    color: #FFFFFF;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.6;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-history-delete-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
}

.search-history-empty {
    text-align: center;
    padding: 20px;
    color: #FFFFFF;
    opacity: 0.6;
    font-size: 13px;
}

/* Ẩn dropdown mặc định của Google Maps Autocomplete */
.pac-container {
    display: none !important;
    pointer-events: none !important;
    z-index: -1 !important;
}

/* Đảm bảo không có overlay nào của Google Maps che bản đồ windy */
.pac-overlay,
.pac-logo,
.pac-container * {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

.search-suggest {
    margin-top: 10px;
    padding: 15px 0px;
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Custom scrollbar cho search-suggest */
.search-suggest::-webkit-scrollbar {
    width: 6px;
}

.search-suggest::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.search-suggest::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.search-suggest::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.search-suggest-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 0 5px;
}

.search-suggest-title {
    font-size: 14px;
    font-weight: 600;
    color: #839598;
    opacity: 0.9;
}

.search-suggest-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.search-suggest-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.search-suggest-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.search-suggest-content {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.search-suggest-name {
    font-size: 14px;
    font-weight: 500;
    color: #FFFFFF;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-suggest-address {
    font-size: 12px;
    color: #FFFFFF;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-suggest-item-close-btn {
    background: transparent;
    border: none;
    color: #FFFFFF;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.6;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-suggest-item-close-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
}

.search-suggest-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.search-suggest-empty-icon {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-suggest-empty-text {
    font-size: 14px;
    color: #FFFFFF;
    opacity: 0.7;
    line-height: 1.5;
}

.search-input-group {
    display: flex;
    align-items: center;
    width: 70%;
    background: transparent;
}

.search-input-group img {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    opacity: 0.6;
}

@media (max-width: 480px) {
    .search-modal-body {
        padding: 20px;
    }
}
