body.modal-open {
    overflow: hidden;
}

/* General Body & Typography */
body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
    padding-bottom: 50px;
}

body.map-active{
    padding-bottom: 1px;
}

/* Dark Mode Styles */
body.dark-mode {
    background-color: #1a1a2e; /* Dark background */
    color: #e0e0e0; /* Light text */
}

body.dark-mode h1 {
    color: #e0e0e0; /* Light header text */
}

body.dark-mode button {
    box-shadow: 0 2px 5px rgba(0,0,0,0.3); /* Darker shadow */
}

body.dark-mode #log-button, body.dark-mode #save-log-button {
    background-color: #0f4c75; /* Darker blue/green accent */
}

body.dark-mode #log-button:hover, body.dark-mode #save-log-button:hover {
    background-color: #3282b8;
}

body.dark-mode .log-entry {
    background-color: #2e2e4a; /* Slightly lighter dark background for cards */
    box-shadow: 0 4px 10px rgba(0,0,0,0.3); /* Darker shadow */
}

body.dark-mode .log-entry p {
    color: #b0b0b0; /* Lighter gray for text */
}

body.dark-mode .log-entry p:first-of-type {
    color: #e0e0e0; /* Light text for names */
}

body.dark-mode .edit-button {
    background-color: #0f4c75; /* Darker blue/green accent */
}

body.dark-mode .edit-button:hover {
    background-color: #3282b8;
}

body.dark-mode .delete-button {
    background-color: #9a031e; /* Darker red */
}

.delete-button:hover {
    background-color: #c82333;
}

.identify-button {
    background-color: #6c757d; /* Gray */
    color: white;
}

.identify-button:hover {
    background-color: #5a6268;
}

body.dark-mode .identify-button {
    background-color: #4a4a6a; /* Darker gray */
}

body.dark-mode .identify-button:hover {
    background-color: #5a5a7a;
}

body.dark-mode .modal {
    background-color: rgba(0,0,0,0.8); /* Darker, more opaque overlay */
}

body.dark-mode .modal-content {
    background-color: #2e2e4a; /* Darker background for modal content */
    box-shadow: 0 8px 20px rgba(0,0,0,0.5); /* Stronger dark shadow */
}

body.dark-mode .close-button {
    color: #b0b0b0; /* Lighter gray */
}

body.dark-mode .close-button:hover,
body.dark-mode .close-button:focus {
    color: #e0e0e0; /* Lighter on hover */
}

body.dark-mode input[type="text"], body.dark-mode textarea {
    border: 1px solid #4a4a6a; /* Darker border */
    background-color: #3a3a5a; /* Darker input background */
    color: #e0e0e0; /* Light text */
}

body.dark-mode #autocomplete-list {
    border: 1px solid #4a4a6a; /* Darker border */
    box-shadow: 0 4px 8px rgba(0,0,0,0.3); /* Darker shadow */
}

body.dark-mode #autocomplete-list div {
    background-color: #3a3a5a; /* Darker background */
    border-bottom: 1px solid #4a4a6a; /* Darker border */
}

body.dark-mode #autocomplete-list div:hover {
    background-color: #4a4a6a; /* Lighter dark on hover */
}

/* Header */
h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2.5em;
    font-weight: 600;
}

/* Buttons - General Styling */
button, .button {
    display: block;
    width: 100%;
    padding: 12px 0px;
    font-size: 1.1em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 15px;
    text-align: center;
    text-decoration: none;
    color: white;
    background-color: #28a745;
    font-weight: 600;
}

#delete-log-button {
    background-color: #dc3545;
    display: none; /* Hidden by default */
}

#delete-log-button:hover {
    background-color: #c82333;
}

#delete-all-logs-button {
    background-color: #dc3545;
}

#delete-all-logs-button:hover {
    background-color: #c82333;
}

button:hover, .button:hover {
    transform: translateY(-2px);
    background-color: #218838; /* Darker green on hover */
}

/* Primary Button */
#log-button, #save-log-button {
    background-color: #28a745; /* Green */
    color: white;
    font-weight: 600;
}

#log-button:hover, #save-log-button:hover {
    background-color: #218838;
}

/* Log Entries */
#logs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    padding: 10px;
}

.log-entry {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    max-width: 600px;
}

.log-image-container {
    position: relative; /* Add this */
    display: flex;
    flex-wrap: wrap;
    gap: 5px; /* Smaller gap for log entries */
    justify-content: center;
    max-width: 100%;
    margin-bottom: 15px;
}

/* Removed :has() rule as width is now set on .image-carousel-wrapper */

.log-entry-image {
    width: 150px; /* Adjust size for log entries */
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.placeholder-image {
    object-fit: contain;
}

/* Override for images inside carousel */
.image-carousel-wrapper .log-entry-image {
    width: 100%;
    height: 100%;
    border-radius: 0; /* Remove border-radius for full-bleed effect in carousel */
    box-shadow: none; /* Remove shadow for cleaner look in carousel */
}

.log-entry p {
    margin: 5px 0;
    color: #555;
}

.log-entry p:first-of-type {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1em;
}

.log-details-container {
    display: flex;
    justify-content: center;
    width: 100%;
    align-items: center;
}

.log-info-container {
    text-align: center;
}

.log-card-buttons {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin-top: 15px;
    align-items: center;
}

.log-card-buttons button {
    width: 40px;
    height: 40px;
    font-size: 1.2em;
    padding: 0;
    margin: 0 5px;
}

.edit-button {
    background-color: #007bff;
    color: white;
}

.edit-button:hover {
    background-color: #0056b3;
}

.delete-button {
    background-color: #dc3545;
    color: white;
}

.delete-button:hover {
    background-color: #c82333;
}

.share-button {
    background-color: #007bff;
    color: white;
}

.share-button:hover {
    background-color: #0056b3;
}

/* Modal Styling */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; /* Higher z-index */
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.6); /* Darker overlay */
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fefefe;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    width: 90%; 
    max-width: 90vw; /* Max width for larger screens */
    max-height: 90vh; /* Constrain height to 90% of viewport height */
    overflow: auto; /* Enable vertical scrolling for modal content */
    position: relative;
    text-align: center;
}

.close-button {
    color: #888;
    float: right;
    font-size: 32px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-button:hover,
.close-button:focus {
    color: #333;
}

.image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    max-width: 100%;
    margin-bottom: 20px;
}

.modal-preview-image {
    width: 100px; /* Smaller size for multiple previews */
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

 .image-preview-item {
      position: relative;
  }

.remove-image-btn {
    background-color: #dc3545;
    width: 40px;
    height: 40px;
    font-size: 1.2em;
    padding: 0;
    margin: 0 5px;
    place-self: anchor-center;
    margin-top: 10px;
}


.input-with-button {
    display: flex;
    align-items: center;
}

#add-collection-button {
    width: auto;
    padding: 12px 15px;
    margin-left: 10px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Input Fields */
input[type="text"], textarea {
    width: calc(100% - 24px); /* Account for padding */
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    box-sizing: border-box; /* Include padding in width */
}

textarea {
    min-height: 80px;
    resize: vertical;
}

.input-error {
    border-color: red;
}

/* Autocomplete List */
.autocomplete-list {
    border: 0px solid #eee;
    max-height: 80px;
    overflow: auto;
    margin-top: -10px; /* Overlap with input border */
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    position: static;
    z-index: 1002;
    background: grey;
    margin-left: 11px;
}

#autocomplete-list div {
    padding: 12px;
    cursor: pointer;
    background-color: #fff;
    border-bottom: 1px solid #eee;
    font-size: 0.95em;
}

#autocomplete-list div:last-child {
    border-bottom: none;
}

#autocomplete-list div:hover {
    background-color: #f0f0f0;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    h1 {
        font-size: 2em;
    }

    button {
        padding: 10px 15px;
        font-size: 1em;
    }

    .modal-content {
        padding: 20px;
        width: 95%;
    }

    input[type="text"], textarea {
        padding: 10px;
    }

    #autocomplete-list div {
        padding: 10px;
    }
}

#app-icon {
    display: block;
    margin: 0 auto;
}

#left-nav-buttons {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#left-nav-buttons div {
    color: #333;

}

.icon-button-base {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2em; /* Standardize font size here */
    margin-bottom: 0; /* Override default button margin */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    background-color: #f4f7f6;
}

body.dark-mode #left-nav-buttons div {
    color: #e0e0e0;
}

body.dark-mode .icon-button-base {
    
    background-color: #1a1a2e;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3); /* Darker shadow */
}

#settings-button {
    cursor: pointer;
    z-index: 999;
    color: #333;
}

#right-utility-buttons {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}


#right-utility-buttons .button {
    margin-bottom: 0;
}

body.dark-mode #settings-button {
    color: #e0e0e0;
}

#main-content {
    transition: margin-left .5s;
    padding: 16px;}

#normlisten-content {
    margin-left: 75px;
}

.identified-name {
    font-size: 1.2em;
    font-weight: bold;
    color: #2c3e50;
    cursor: pointer;
}

.predictions-list {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
}

.prediction-item {
    font-size: 0.9em;
    color: #555;
}

#map {
    height: 100vh; /* calc(100vh - 75px); */
}

.popup-thumbnail {
    max-width: 100px;
    max-height: 100px;
    display: block;
    margin-top: 5px;
}

/* Sort Container */
.sort-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 15px;
}

.sort-container label {
    margin-right: 10px;
    font-weight: 600;
}

.no-prediction-filter-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 10px 0;
}

/* Lightbox Modal */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1001; /* Sit on top */
    padding-top: 100px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
}

.lightbox-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

#sort-select.button {
    width: auto;
    padding: 10px;
    font-size: 1em;
}

#filter-toggle-button {
    position: static;
    font-size: 24px;
    cursor: pointer;
    z-index: 999;
    margin-bottom: 0;
}

#bulk-import-input-label {
    position: static;
    font-size: 24px;
    cursor: pointer;
    z-index: 999;
    margin-bottom: 0;
}

#clear-filters-button {
    background-color: #dc3545;
}

#clear-filters-button:hover {
    background-color: #c82333;
}

.collection-pill {
    display: inline-flex;
    align-items: center;
    background-color: #e0e0e0;
    color: #333;
    padding: 5px 10px;
    border-radius: 15px;
    margin: 5px;
    font-size: 0.9em;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease-in-out;
}

.collection-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.collection-pill .remove-pill {
    margin-left: 8px;
    cursor: pointer;
    font-weight: bold;
    color: #888;
}

.collection-pill .remove-pill:hover {
    color: #333;
}

/* Dark mode for pills */
body.dark-mode .collection-pill {
    background-color: #4a4a6a;
    color: #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,.3);
}

body.dark-mode .collection-pill:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

body.dark-mode .collection-pill .remove-pill {
    color: #b0b0b0;
}

body.dark-mode .collection-pill .remove-pill:hover {
    color: #e0e0e0;
}

/* Image Carousel Styling */
.image-carousel-wrapper {
    position: relative;
    width: 150px; /* Fixed width */
    height: 150px; /* Fixed height */
    overflow: hidden;
    border-radius: 8px; /* Apply border-radius here */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* Apply shadow here */
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto; /* Center the carousel */
}

.image-carousel-wrapper .log-entry-image {
    position: absolute;
    /* width: 100%; */ /* Removed */
    /* height: 100%; */ /* Removed */
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.image-carousel-wrapper .log-entry-image.active {
    opacity: 1;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 10px;
    cursor: pointer;
    z-index: 10;
    border-radius: 50%;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.carousel-arrow.prev {
    left: 50%; /* Start at center of log-image-container */
    margin-left: calc(-115px - 20px); /* Move left by half carousel width + half arrow width */
}

.carousel-arrow.next {
    right: 50%; /* Start at center of log-image-container */
    margin-right: calc(-115px - 20px); /* Move right by half carousel width + half arrow width */
}

.carousel-arrow:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.leaflet-popup-content .share-button {
    width: 40px;
    height: 40px;
    font-size: 1.2em;
    padding: 0;
    margin: 10px auto 0;
    display: block;
}

footer {
    background-color: #f2f2f2;
    padding: 10px;
    text-align: center;
    font-size: 0.9em;
    color: #666;
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 1000;
    border-top: 1px solid #1a1a2e;
}

footer a {
    color: #337ab7;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

body.dark-mode footer {
    background-color: #2e2e4a;
    color: #b0b0b0;
}

body.dark-mode footer a {
    color: #87bfff;
}
