body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 10px;
    box-sizing: border-box;
}

#map {
    flex: 1;
    min-height: 300px;
    margin-top: 10px;
}

#search-container {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

#search-input {
    flex: 1;
    padding: 12px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#search-button {
    padding: 12px 20px;
    font-size: 16px;
    background-color: #008080;
    color: white;
    border: none;
    border-radius: 6px; /* increased from 4px */
    cursor: pointer;
}

#search-button:hover {
    background-color: #006666;
}

#autocomplete-results {
    position: absolute;
    top: 60px;
    left: 10px;
    right: 10px;
    background: white;
    border: 1px solid #ccc;
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

#autocomplete-results li {
    padding: 10px;
    cursor: pointer;
}

#autocomplete-results li:hover {
    background-color: #f0f0f0;
}

#menu-container {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

/* Auth button shares the same styling as other header buttons */
#center-button, #auth-button, #my-maps-button, #how-to-use-button, #about-button {
    padding: 12px 20px;
    font-size: 16px;
    background-color: #008080;
    color: white;
    border: none;
    border-radius: 6px; /* increased from 4px */
    cursor: pointer;
    min-width: 20px;
}

#center-button:hover, #auth-button:hover, #my-maps-button:hover, #how-to-use-button:hover, #about-button:hover {
    background-color: #006666;
}

#location-status {
    margin-bottom: 10px;
    font-size: 14px;
    color: #333;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 20px;
    border-radius: 8px;
    max-width: 90%;
    width: 400px;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.modal-content h2 {
    margin-top: 0;
}

.modal-content p {
    margin: 10px 0;
}

#note-input {
    width: 100%;
    height: 80px;
    margin-bottom: 10px;
    padding: 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

#save-pin, #cancel-pin, .close-how-to-use, .close-about {
    padding: 10px 20px;
    font-size: 14px;
    margin-right: 10px;
    border: none;
    border-radius: 6px; /* increased from 4px */
    cursor: pointer;
}

/* Auth-required modal buttons: match modal action styling */
#auth-required-signin, #auth-required-cancel {
    padding: 10px 20px;
    font-size: 14px;
    margin-right: 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

#auth-required-signin {
    background-color: #008080;
    color: white;
}

#auth-required-cancel {
    background-color: #ccc;
}

#auth-required-signin:hover { background-color: #006666; }
#auth-required-cancel:hover { background-color: #bbb; }

/* Color palette for pin creation */
#color-palette {
    display: flex;
    gap: 8px;
    margin: 8px 0 6px 0;
    align-items: center;
    flex-wrap: wrap;
}

.color-swatch {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid transparent;
    box-sizing: border-box;
    cursor: pointer;
}

.color-swatch.selected {
    border-color: #333;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

/* small swatch shown in popups */
.popup-color-box {
    display: inline-block;
    width: 12px;
    height: 12px;
    vertical-align: middle;
    margin-right: 6px;
    border-radius: 2px;
    border: 1px solid rgba(0,0,0,0.1);
}

#save-pin, .close-how-to-use, .close-about {
    background-color: #008080;
    color: white;
}

#cancel-pin {
    background-color: #ccc;
}

#save-pin:hover, .close-how-to-use:hover, .close-about:hover {
    background-color: #006666;
}

#cancel-pin:hover {
    background-color: #bbb;
}

.heart-button {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
}

/* Reaction layout: keep heart and dislike buttons aligned and compact */
.heart-section {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.heart-section.hearted .heart-button {
    color: red;
}

.heart-count {
    font-size: 14px;
    margin-left: 4px;
    margin-right: 2px;
}

.dislike-button {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 2px;
    line-height: 1;
}

.dislike-button[data-disliked="true"] {
    color: #c62828; /* red-ish when active */
}

.dislike-count {
    font-size: 14px;
    margin-left: 2px;
    margin-right: 4px;
    color: #333;
}

/* Stronger active styling for dislike: make it visually distinct when pressed */
.dislike-button[data-disliked="true"] {
    background-color: #c62828; /* active red background */
    color: #fff; /* white glyph on red */
    padding: 4px 6px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(198,40,40,0.25);
    transform: translateY(-1px);
}

.dislike-button {
    transition: background-color 120ms ease, color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.dislike-button:focus {
    outline: 3px solid rgba(0,128,128,0.15);
    outline-offset: 2px;
}

/* Disabled reaction buttons (used for reported items) */
.disabled-reaction {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Mobile-friendly styles */
@media (max-width: 600px) {
    .container {
        padding: 5px;
    }

    #search-container {
        flex-direction: column;
        gap: 5px;
    }

    #search-input, #search-button {
        width: 100%;
        font-size: 14px;
        padding: 10px;
    }

    /* Make the header a single horizontal, touch-scrollable row on small screens
       so it doesn't take excessive vertical space. Buttons remain large enough
       for touch and won't wrap to a new line. */
    #menu-container {
        flex-direction: row;
        gap: 8px;
        /* horizontal scrolling for overflowed controls */
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        /* keep the menu near the top and easily reachable */
        position: sticky;
        top: 6px;
        z-index: 900;
        background: rgba(255,255,255,0.96);
        padding: 8px;
        border-radius: 10px;
        box-shadow: 0 8px 20px rgba(0,0,0,0.06);
    }

    /* Keep header buttons from stretching vertically; make each an inline-flex
       element with a comfortable minimum width for touch targets. */
    #center-button, #auth-button, #my-maps-button, #how-to-use-button, #about-button {
        flex: 0 0 auto;
        min-width: 64px;
        padding: 10px 12px;
        font-size: 14px;
        white-space: nowrap; /* prevent button text wrapping */
    }

    #location-status {
        font-size: 12px;
    }

    .modal-content {
        margin: 5% auto;
        width: 90%;
        padding: 15px;
    }

    #map {
        min-height: 200px;
    }

    /* Move autocomplete down so it's below the sticky header row */
    #autocomplete-results {
        top: 72px;
        max-height: 150px;
    }
}
