body {
    margin: 0;
    padding: 0;
    font-family: 'Manrope', sans-serif;
    color: whitesmoke;
    background-color: #000;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

main {
    flex: 1;
    display: flex;
    flex-direction: row;
    background-color: #1a1a1a;
    color: whitesmoke;
    overflow: hidden;
}

header {
    font-weight: 100;
}

#search-container {
    flex: 1;
    padding: 20px;
    margin: 0;
    align-items: center;
    overflow-y: auto;
    background-color: #000;
}

#toggle-container {
    display: inline-flex;
    /* Use flexbox to align buttons horizontally */
    border: 1px solid #444;
    /* Add a border around the segmented control */
    border-radius: 8px;
    /* Rounded corners for the entire control */
    overflow: hidden;
    /* Ensure the buttons stay within the border */
    margin: 20px 0;
}

.toggle-btn {
    /* flex: 1; */
    /* Make both buttons equal in width */
    padding: 10px 100px;
    border: none;
    background-color: #1a1a1a;
    /* Default background color */
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 16px;
    text-align: center;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.toggle-btn:first-child {
    border-right: 1px solid #333;
    /* Add a divider between the buttons */
}

.toggle-btn.active {
    background-color: rgba(245, 245, 245, 0.9);
    /* Highlight the active button */
    color: black;
}

#map {
    flex: 1;
    background-color: #1a1a1a;
    /* Optional: Add a background color */
    color: whitesmoke;
    /* Optional: Ensure text is readable */
}

@media (max-width: 768px) {
    #map {
        display: none;
    }

    .toggle-btn {
        /* flex: 1; */
        /* Make both buttons equal in width */
        padding: 10px;
        border: none;
        background-color: #1a1a1a;
        /* Default background color */
        color: rgba(255, 255, 255, 0.6);
        cursor: pointer;
        font-size: 16px;
        text-align: center;
        transition: background-color 0.3s ease, color 0.3s ease;
    }
}

#crag-list {
    list-style-type: none;
    /* Removes bullet points */
    padding: 10px 10px;
    /* Removes default padding */
    margin: 0;
    /* Removes default margin */
    display: flex;
    flex-direction: column;
    /* Makes the list items stack vertically */
    gap: 10px;
    /* Optional: Adds spacing between items */
}

#crag-list li {
    position: relative;
    display: flex;
    /* Aligns thumbnail and text horizontally */
    align-items: center;
    /* Centers thumbnail and text vertically */
    background-color: #1a1a1a;
    /* Minimalistic dark background */
    color: whitesmoke;
    /* Light text for contrast */
    padding: 15px;
    /* Adds spacing inside each item */
    border-radius: 8px;
    /* Rounds the corners */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    /* Adds a subtle shadow */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    /* Smooth hover effect */
    font-size: 18px;
    /* Adjusts font size for readability */
    text-align: left;
    /* Aligns text to the left */
    gap: 15px;
    /* Adds spacing between thumbnail and text */
    cursor: pointer;
}

.thumbnail-wrapper {
    position: relative;
    /* Allows stacking of the placeholder and image */
    width: 100px;
    /* Matches the image width */
    height: 100px;
    /* Matches the image height */
    border-radius: 8px;
    /* Matches the rounded corners of the image */
    overflow: hidden;
    /* Ensures the image doesn't overflow the wrapper */
}

/* Placeholder background */
.thumbnail-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #cbbaba;
    /* Placeholder background color */
    border-radius: 8px;
    /* Matches the wrapper and image corners */
    z-index: 1;
    /* Ensures it is behind the image */
}

/* Image styling */
.thumbnail-wrapper img {
    position: relative;
    z-index: 2;
    /* Ensures it is above the placeholder */
    width: 100%;
    /* Fill the wrapper */
    height: 100%;
    /* Fill the wrapper */
    border-radius: 8px;
    /* Matches the wrapper and placeholder corners */
    object-fit: cover;
    /* Ensures the image fits within the dimensions */
    opacity: 0;
    /* Start fully transparent */
    transition: opacity 0.5s ease-in-out;
    /* Smooth fade-in effect */
}

/* When the image is loaded */
.thumbnail-wrapper img.loaded {
    opacity: 1;
    /* Fully visible when loaded */
}

#crag-list li:hover {
    /* transform: translateY(-3px); */
    /* Slight lift on hover */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    /* Enhances shadow on hover */
    background-color: #333;
    /* Slightly lighter background on hover */
}

.crag-details {
    display: flex;
    flex-direction: column;
    /* Stack the title, location, and problem count vertically */
    gap: 5px;
    /* Add spacing between the elements */
}

.crag-title {
    font-size: 18px;
    font-weight: bold;
    color: whitesmoke;
}

.crag-location {
    font-size: 14px;
    color: whitesmoke;
}

.crag-problem-count {
    font-size: 14px;
    color: whitesmoke;
}

@media (min-width: 768px) {
    .center-on-map-btn {
        display: none;
        position: absolute;
        bottom: 10px;
        /* Position the button at the bottom */
        right: 10px;
        /* Position the button at the far right */
        padding: 8px 12px;
        background-color: #1a73e8;
        color: white;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        font-size: 14px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        transition: background-color 0.2s ease, box-shadow 0.2s ease;
    }

    .center-on-map-btn:hover {
        background-color: #1669c1;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    }

    #crag-list li:hover .center-on-map-btn {
        display: block;
        /* Show the button when the parent <li> is hovered */
    }
}

@media (max-width: 768px) {
    .center-on-map-btn {
        display: none;
    }
}

#search-bar {
    width: 95%;
    padding: 10px;
    margin-left: 0;
    margin-right: 50px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.manrope-fonts {
    font-family: "Manrope", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
}

.marker-icon-title {
    background-color: rgba(0, 0, 0, 0.7);
    /* Semi-transparent background */
    color: white;
    /* White text for contrast */
    border-radius: 3px;
    /* Slightly rounded corners */
    font-size: 16px;
    /* Smaller font size */
    text-align: center;
    white-space: nowrap;
    /* Prevent text from wrapping */
    font-family: "Manrope", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
}

.highlighted-marker {
    border: 4px solid #1DB954;
}

#problem-list {
    list-style-type: none;
    /* Remove default list styling */
    margin: 0;
    padding: 0;
}

#problem-list li {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #444;
    color: whitesmoke;
    font-size: 16px;
    width: 500px;
    cursor: pointer;
}

#problem-list li:last-child {
    border-bottom: none;
}

#problem-list li h3 {
    font-weight: normal;
    margin: 0;
}

#problem-list li .problem-cell-quality-rating {
    font-size: 18px;
}

#problem-list li:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    background-color: #333;
}

.problem-cell-details {
    display: flex;
    flex-direction: column;
    margin-left: 8px;
    flex: 1;
}

.problem-cell-crag {
    margin: 5px 0 0 0;
    font-size: 14px;
    color: #888;
}