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-direction: column;
    align-items: flex-start;
    position: absolute;
    top: 10px;
    left: 15px;
    z-index: 100;
    width: auto;
    max-width: 400px;
}

.filter-row {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.filter-row > * {
    margin-right: 5px;
}

#my-shared-button {
    margin-top: 5px;
}

#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);
}

#nearby-locations-panel #tipinput {
    width: calc(100% - 30px);
    margin: 10px 15px;
    box-sizing: border-box;
}

/* 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;
}

#my-shared-button {
    background-color: #f0f0f0;
    color: #333;
    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;
}

#my-shared-button.active {
    background-color: #28a745;
}

/* Action Buttons Styles */
.side-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-left: 5px;
}

#report-button, #profile-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;
    width: 100%;
    white-space: nowrap;
}

#center-marker {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -100%);
    z-index: 1000;
    pointer-events: none; /* Let clicks pass through to the map */
    display: flex;
    flex-direction: column;
    align-items: center;
}

#center-marker img {
    width: 25px;
    height: 34px;
}

#nearby-locations-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    max-height: 35%;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

#nearby-locations-panel .nearby-header {
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    font-weight: bold;
}

#nearby-locations-panel .nearby-header button {
    background: none;
    border: none;
    color: #007bff;
    cursor: pointer;
}

#nearby-locations-panel .nearby-list {
    overflow-y: auto;
    flex: 1;
}

#nearby-locations-panel .nearby-item {
    padding: 10px 15px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
}

#nearby-locations-panel .nearby-item:hover {
    background-color: #f9f9f9;
}

#nearby-locations-panel .nearby-item.active {
    background-color: #e6f7ff;
}

#nearby-locations-panel .poi-name {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

#nearby-locations-panel .poi-address {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

#nearby-locations-panel .no-data {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

#confirm-location-button {
    margin: 10px 15px;
    padding: 12px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
}

/* Report Modal Styles */
#report-modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

#report-modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 400px;
    max-height: 85vh;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

#report-modal-content h3 {
    margin: 0 0 15px 0;
    text-align: center;
    color: #333;
}

#close-report-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #888;
}

#report-modal-content .form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
    width: 100%; /* Ensure full width */
    align-items: flex-start; /* Align children (label and input) to the left */
}

#report-modal-content .form-group label {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
    text-align: left;
    width: 100%; /* Ensure label takes full width for its own alignment */
}

#report-modal-content .required-mark {
    color: #dc3545;
    font-weight: bold;
}

#report-modal-content .form-group input,
#report-modal-content .form-group textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

.report-tags-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
    width: 100%;
}

.report-tag-item {
    padding: 6px 12px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
    user-select: none;
}

.report-tag-item.active {
    background-color: #e6f7ff;
    border-color: #1890ff;
    color: #1890ff;
    font-weight: 500;
}

#submit-report-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
}

@media (min-width: 768px) {
    #nearby-locations-panel {
        width: 400px;
        left: 50%;
        transform: translateX(-50%);
        max-height: 35vh;
    }
}

#center-marker .marker-label {
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 12px;
    color: #333;
    white-space: nowrap;
    margin-top: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

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

#announcement-container {
    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: 2001; /* Higher than other cards */
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transform: translateY(100%);
    transition: transform 0.3s ease-out, visibility 0.3s ease-out;
    visibility: hidden;
}

#announcement-container.open {
    transform: translateY(0);
    visibility: visible;
}

#announcement-container p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

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

#close-announcement:hover {
    color: #333;
}

/* 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;
}

.location-detail-card #detail-card-upload-user {
    position: absolute;
    bottom: 15px;
    right: 15px;
    font-size: 12px;
    color: #666;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #eee;
    z-index: 1001;
}

/* 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 */
    }
}

/* Profile Modal Styles */
#profile-modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
}

#profile-modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    width: 300px;
    position: relative;
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

#user-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.user-info-header {
    margin-bottom: 15px;
}

.user-info-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.user-info-details {
    padding-left: 20px; /* Shift account, nickname, email to the right */
    flex: 1;
}

.user-info-details p {
    margin: 8px 0;
    font-size: 14px;
    color: #555;
}

.user-info-actions {
    display: flex;
    justify-content: flex-end; /* Logout button to the right */
    margin-top: 20px;
}

#logout-button, #show-modify-button, #cancel-modify-button, #submit-modify-button {
    width: auto !important; /* Override the 100% width for forms */
    padding: 8px 15px !important;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-left: 10px;
}

#logout-button {
    background-color: #dc3545;
}

#show-modify-button {
    background-color: #007bff;
}

#modify-info-form .form-group label {
    width: 80px; /* Slightly wider labels for modify form */
}

#close-profile-modal {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #888;
}

#login-register-form input,
#login-register-form button {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    box-sizing: border-box;
}

.form-tabs {
    display: flex;
    margin-bottom: 10px;
}

.tab-button {
    flex: 1;
    padding: 10px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    cursor: pointer;
}

.tab-button.active {
    background-color: #fff;
    border-bottom-color: transparent;
}

.form-group {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.form-group label {
    width: 60px;
    margin-right: 10px;
}

.form-group input {
    flex: 1;
    margin-top: 0;
}

.form-hint {
    font-size: 12px;
    color: #888;
    margin-top: 5px;
    margin-bottom: 10px;
    text-align: left;
}

.profile-common-actions {
    margin-top: 20px;
    padding-top: 5px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
}

.profile-action-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    transition: background-color 0.2s, color 0.2s;
    border-radius: 4px;
}

.profile-action-item:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

.profile-action-item::after {
    content: '>';
    color: #ccc;
    font-size: 12px;
}

.profile-view-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

.profile-view-header h3 {
    margin: 0;
    flex: 1;
    text-align: center;
    font-size: 18px;
    color: #333;
}

.profile-back-btn {
    position: absolute;
    left: 0;
    background: none;
    border: none;
    color: #007bff;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
}

.profile-back-btn:hover {
    text-decoration: underline;
}

.announcement-detail, .feedback-detail {
    font-size: 14px;
    line-height: 1.8;
    color: #333;
    padding: 10px 0;
}

.announcement-detail p {
    margin: 0;
}

.feedback-detail textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    resize: none;
    box-sizing: border-box;
    margin-bottom: 15px;
}

.feedback-detail .rating-options {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
}

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

#submit-feedback-btn {
    width: 100%;
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
    padding: 10px;
    margin-top: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    box-sizing: border-box;
}

#submit-feedback-btn:hover {
    background-color: #e0e0e0;
}

.report-notice {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 15px;
    border-left: 4px solid #ffc107; /* 黄色左边框起到提示作用 */
}

.report-notice p {
    font-size: 12px;
    color: #666;
    margin: 4px 0;
    line-height: 1.4;
}