body {
    margin: 0;
    padding: 0;
    font-family: 'Manrope', sans-serif;
    color: whitesmoke;
    background-color: #000;
}

#navigation-bar {
    display: flex;
    align-items: center;
    /* Vertically center-align items */
    justify-content: space-between;
    /* Space out the logo and button */
    padding: 10px 10px;
    background-color: #1a1a1a;
    color: white;
    border-bottom: 2px solid #444;
    height: 50px;
    /* Ensure consistent height for alignment */
}

#home-link {
    display: flex;
    /* Ensure the logo is treated as a flex item */
    align-items: center;
    /* Vertically center-align the logo */
}

#home-link img {
    height: 40px;
    cursor: pointer;
}

#back-to-search {
    display: flex;
    /* Treat the button as a flex container */
    align-items: center;
    /* Vertically center-align the text */
    justify-content: center;
    /* Center-align the text horizontally */
    padding: 10px 15px;
    background-color: #444;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    height: 40px;
    /* Match the height of the logo for alignment */
    line-height: 1;
    /* Ensure consistent text alignment */
}

#back-to-search:hover {
    background-color: #666;
}

main {
    display: flex;
    /* Use flexbox to create a horizontal layout */
    height: 100vh;
    /* Make the main section take up the full viewport height */
    background-color: #1a1a1a;
    /* Match the background color of area.html */
    color: whitesmoke;
    /* Match the text color for consistency */
}

#toggle-container {
    display: 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;
    width: 100%;
}

.toggle-btn {
    flex: 1;
    /* Make both buttons equal in width */
    padding: 10px 20px;
    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;
}

@media (min-width: 768px) {
    #crag-details {
        width: 500px;
        /* Fixed width for the crag-details section */
        padding: 20px;
        border-right: 1px solid #ccc;
        /* Optional: Add a border to separate sections */
        overflow-y: auto;
        /* Enable scrolling if content overflows */
    }
}

@media (max-width: 768px) {
    #crag-details {
        flex: 1;
        border-bottom: 1px solid #ccc;
        overflow-y: auto;
    }
}

.problem-count {
    width: 100%;
    text-align: right;
    margin: 0px;
    padding-bottom: 8px;
}

#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;
    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-area {
    margin: 5px 0 0 0;
    font-size: 14px;
    color: #888;
}

#area-list-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

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

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

    #map {
        display: none;
        /* Hide the map on smaller screens */
    }
}

.crag-cover-image-wrapper {
    position: relative;
    /* Allows stacking of the placeholder and image */
    width: 300px;
    /* Matches the image width */
    height: 300px;
    /* 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 */
.crag-cover-image-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 */
.crag-cover-image-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;
}

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

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

#area-list li {
    position: relative;
    /* For positioning the button inside */
    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;
}

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

.area-details h3 {
    margin: 0;
    font-size: 18px;
}

.area-details p {
    margin: 5px 0;
    font-size: 14px;
}

.thumbnail-wrapper {
    position: relative;
    /* Allows stacking of the placeholder and image */
    width: 150px;
    /* Matches the image width */
    height: 150px;
    /* 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;
}

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

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

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

#search-bar {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    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;
}

.sector-header {
    display: flex;
    /* Use flexbox for layout */
    align-items: left;
    /* Vertically align all child elements */
    flex-direction: column;
    justify-content: space-between;
    /* Space out the elements horizontally */
    padding: 10px;
    background-color: #2a2a2a;
    /* Optional: Background color for the header */
    color: whitesmoke;
    border-radius: 5px;
    margin-bottom: 10px;
}

.sector-title {
    font-weight: bold;
    font-size: 24px;
    padding-bottom: 8px;
}

.sector-area-count {
    font-size: 18px;
    color: #ccc;
    padding-bottom: 4px;
}

.sorted-element {
    color: #ccc;
    font-size: 18px;
}

.sector-title-marker {
    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: 24px;
    /* 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;
    border: 4px solid #1DB954;
}