html,
body,
#app {
    height: 100%;
    width: 100%;
    margin: 0px;
}

/* Adjust search container to use flexbox for alignment */
#search-container {
    display: flex;
    flex-wrap: wrap; /* Allow items to wrap to the next line */
    align-items: center;
    position: absolute;
    top: 10px;
    right: 15px; /* Reverted to right */
    z-index: 100;
    width: auto; /* Allow width to adjust based on content */
    max-width: 400px; /* Limit width to prevent overflow on smaller screens */
    justify-content: flex-end; /* Reverted to flex-end */
}

#filter-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    position: absolute;
    top: 10px;
    left: 15px;
    z-index: 100;
    width: auto;
    max-width: 400px;
    justify-content: flex-start;
}

#filter-container > * {
    margin-right: 5px; /* Space between items */
    margin-top: 5px; /* Space for wrapped items */
}

#search-container > * {
    margin-left: 5px; /* Space between items */
    margin-top: 5px; /* Space for wrapped items */
}

#tipinput {
    width: 62.5px; /* 50% of 125px */
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Custom multi-select dropdown styles */
.custom-dropdown {
    position: relative;
    width: 150px;
    height: 36px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    background-color: white;
    cursor: pointer;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    padding: 0 8px;
    font-size: 14px;
    color: #333;
}

.custom-dropdown-header {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-dropdown-arrow {
    margin-left: auto;
    border: solid #333;
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 3px;
    transform: rotate(45deg);
    -webkit-transform: rotate(45deg);
    transition: transform 0.2s;
}

.custom-dropdown.open .custom-dropdown-arrow {
    transform: rotate(-135deg);
    -webkit-transform: rotate(-135deg);
}

.custom-dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1001;
    display: none; /* Hidden by default */
    flex-direction: column;
    padding: 5px 0;
}

.custom-dropdown.open .custom-dropdown-options {
    display: flex;
}

.custom-dropdown-options label {
    display: flex;
    align-items: center;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 14px;
}

.custom-dropdown-options label:hover {
    background-color: #f0f0f0;
}

.custom-dropdown-options input[type="checkbox"] {
    margin-right: 8px;
}

#apply-filter-button {
    background-color: #007bff;
    color: white;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    height: 36px;
    box-sizing: border-box;
}

/* Feedback Button Styles */
#feedback-button {
    background-color: #007bff;
    color: white;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    margin-left: 5px; /* Space between search input and button */
    height: 36px; /* Match input height */
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
}

/* Feedback Form Styles */
#feedback-form-container {
    position: absolute; /* Changed to absolute to be relative to search-container */
    top: 50px; /* Position below the search container */
    right: 0;
    width: 300px;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    padding: 15px;
    display: none; /* Hidden by default */
    flex-direction: column;
    gap: 10px;
}

#feedback-form-container h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}

#close-feedback-form {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #888;
    line-height: 1;
}

#close-feedback-form:hover {
    color: #333;
}

#feedback-form-container textarea,
#feedback-form-container input[type="email"] {
    width: calc(100% - 20px);
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    resize: vertical;
}

#feedback-form-container .rating-options {
    display: flex;
    justify-content: space-around;
    margin-bottom: 10px;
}

#feedback-form-container .rating-options label {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    font-size: 12px;
    color: #555;
}

#feedback-form-container .rating-options input[type="radio"] {
    margin-bottom: 5px;
}

#feedback-form-container button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
}

#feedback-form-container button:hover {
    background-color: #218838;
}

.error-border {
    border: 1px solid red !important;
}

#announcement-container {
    position: absolute;
    top: 60px; /* Adjusted position to be below search/feedback */
    right: 15px; /* Reverted to right */
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    border-radius: 5px;
    padding: 8px 12px; /* Slightly smaller padding */
    display: flex;
    align-items: center;
    gap: 8px; /* Slightly smaller gap */
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    max-width: 300px; /* Adjusted max-width to fit better */
}

#announcement-container p {
    margin: 0;
    font-size: 12px; /* Smaller font size */
    line-height: 1.4; /* Adjusted line height */
}

#close-announcement {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #856404;
    padding: 0;
    line-height: 1;
}

#close-announcement:hover {
    color: #664d03;
}

#view-announcement-button {
    position: absolute;
    top: 60px;
    right: 15px;
    z-index: 100;
    display: none; /* Hidden by default, controlled by JS */
}

#view-announcement-button button {
    background-color: #fff3cd; /* Light yellow, similar to announcement */
    color: #856404; /* Dark yellow/brown, similar to announcement text */
    border: 1px solid #ffeeba; /* Similar to announcement border */
    border-radius: 5px;
    padding: 5px 10px; /* Smaller padding */
    font-size: 12px; /* Smaller font size */
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); /* Match announcement shadow */
    height: auto; /* Let content determine height */
}

#view-announcement-button button:hover {
    background-color: #e0c98a; /* Slightly darker yellow on hover */
    color: #664d03;
}

/* Location Detail Card Styles */
.location-detail-card {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: white;
    border-top: 1px solid #ccc;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    padding: 15px;
    box-sizing: border-box;
    display: flex; /* Changed from none to flex */
    flex-direction: column;
    gap: 10px;
    transform: translateY(100%); /* Start off-screen */
    transition: transform 0.3s ease-out, visibility 0.3s ease-out; /* Added visibility to transition */
    visibility: hidden; /* Hidden by default, but takes up space */
}

.location-detail-card.open {
    transform: translateY(0); /* Slide in */
    visibility: visible; /* Make visible when open */
}

.location-detail-card .close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #888;
    line-height: 1;
}

.location-detail-card .close-button:hover {
    color: #333;
}

.location-detail-card h3 {
    margin-top: 0;
    margin-bottom: 8px;
    color: #333;
    font-size: 18px;
}

.location-detail-card #detail-card-tags span {
    display: inline-block;
    margin-right: 5px;
    font-size: 10px;
    padding: 2px 5px;
    background-color: #e0e0e0;
    border-radius: 3px;
}

.location-detail-card #detail-card-summary {
    font-size: 12px;
    color: #555;
    margin-bottom: 10px;
}

.location-detail-card .detail-card-actions a {
    display: inline-block;
    margin-right: 15px;
    font-size: 12px;
    text-decoration: none;
    padding: 5px 0;
}

.location-detail-card .detail-card-actions a#detail-card-xiaohongshu-link {
    color: #ff2d55;
}

.location-detail-card .detail-card-actions a#detail-card-navigation-link {
    color: #007bff;
}

/* Media queries for responsiveness */
@media (min-width: 768px) {
    .location-detail-card {
        width: 400px; /* Fixed width for PC */
        left: 50%;
        transform: translateX(-50%) translateY(100%); /* Center and off-screen */
        border-radius: 8px 8px 0 0;
        border-top-left-radius: 8px;
        border-top-right-radius: 8px;
        border-left: 1px solid #ccc;
        border-right: 1px solid #ccc;
    }

    .location-detail-card.open {
        transform: translateX(-50%) translateY(0); /* Center and slide in */
    }
}
