 :root {
    --bottom-nav-height: 60px; /* Define the height of the bottom navigation bar */
 }

 html,
 body {
     height: 100%;
     width: 100%;
     margin: 0;
     padding: 0;
     font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
     font-size: 0.8em;
     display: flex;
     flex-direction: column;
     overflow: hidden;
     position: static;
 }
 #logo {
    position: fixed;
    inset-block-start: 10px;
    inset-inline-start: 10px;
    z-index: 10; /* Ensure it's on top of the map */
 }

 #logo svg {
    inline-size: 50px;
    block-size: 50px;
 }

 #map {
     height: 100%;
     width: 100%;
     position: static;
     z-index: 1;
     transition: inline-size 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), margin-inline-start 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), block-size 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
     flex-grow: 1;
 }

 .panel {
     position: absolute;
     bottom: 0;
     left: 0;
     inset-inline-end: 0;
     background-color: #ffffff;
     z-index: 2;
     display: flex;
     flex-direction: column;
 }

 /* -------------------------------------------------------
    Mobile: list-panel and detail-panel are styled like the
    submission modal — a large rounded pill floating over
    the bottom 75% of the screen with a margin on all sides.
    They appear/disappear via the morph-open/morph-close
    animation only (no slide transition).
    ------------------------------------------------------- */
 #list-panel {
     flex-shrink: 0;
     /* Hidden by default — shown via morph-open animation */
     display: none;
     overflow: hidden;
     /* Pill shape with margin, matching the submission modal */
     position: fixed;
     bottom: 0;
     left: 0;
     right: 0;
     height: 75vh;
     margin: 10px;
     margin-bottom: calc(10px + var(--safe-area-inset-bottom, 0px));
     border-radius: 20px;
     box-shadow: 0 5px 30px rgba(0, 0, 0, 0.25);
     z-index: 1000;
 }

 #list-panel.open {
     display: flex;
     flex-direction: column;
 }

 #list-panel.detail-open {
    /* Keep the list panel visible underneath the detail panel. */
 }

 #list-panel.open .panel-header {
     margin-bottom: 0;
 }

 .panel-header {
     padding-block-start: 25px;
     padding-inline: 20px;
     padding-block-end: 10px;
     display: flex;
     align-items: center;
     text-align: left;
     cursor: pointer;
     margin-bottom: 45px;
     transition: margin-bottom 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
     position: relative;
 }

 #list-panel .panel-header {
     cursor: grab;
 }

 #detail-panel .panel-header {
     margin-bottom: 0;
 }

 /* --- Detail Panel Layout --- */
 /* Make the header sticky and the content scrollable */
 #detail-panel .panel-header {
    /* border-bottom: 1px solid #eee; */
    /* background-color: var(--theme-panel-bg, #fff); */
    /* backdrop-filter: blur(20px); */
    /* -webkit-backdrop-filter: blur(20px); */
    /* padding-bottom: 20px; */
 }

 #detail-panel .panel-content {
    overflow-y: auto; /* Override the default overflow:hidden */
    display: block; /* Override display:flex to allow normal block scrolling */
 }
 
 /* Style the submission modal header to match other panels */
 #submission-modal .panel-header {
    flex-shrink: 0;
    cursor: default;
    margin-bottom: 0;
    padding-block: 15px;
    border-bottom: 1px solid #eee;
 }

 /* Ensure all form inputs in the submission modal fill the available width without overflowing. */
 #submission-modal .form-group input[type="text"],
 #submission-modal .form-group input[type="datetime-local"],
 #submission-modal .form-group textarea,
 #submission-modal .form-group select {
    width: 100%;
    box-sizing: border-box; /* Include padding and border in the element's total width */
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
 }

 .panel-handle {
     position: absolute;
     top: 10px;
     inset-inline-start: 50%;
     transform: translateX(-50%);
     width: 40px;
     height: 5px;
     background-color: #c0c0c0;
     border-radius: 2.5px;
     margin: 0;
 }

 .panel-title {
     font-size: 1.2rem;
     flex-grow: 1;
     font-weight: 600;
     margin: 0;
 }

 .header-actions {
     position: absolute;
     inset-inline-end: 15px;
     inset-block-start: calc(50% + 7.5px);
     transform: translateY(-50%);
     display: flex;
     align-items: center;
     gap: 8px;
 }

 .header-action-btn {
     background: none;
     border: none;
     cursor: pointer;
     padding: 5px;
     color: #555;
     line-height: 1;
     position: static;
     display: flex;
     align-items: center;
     justify-content: center;
     /* Was absolute */
 }

 .header-action-text {
     display: none;
 }
 
 #collapse-button {
     display: none;
 }

 #expand-button {
     display: none;
     position: absolute;
     inset-inline-start: 12px;
     z-index: 10;
     align-items: initial;
     cursor: pointer;
     inset-block-start: 20px;
     z-index: 1;
 }

 .panel-content {
     flex: 1;
     /* Allow content to grow and fill space */
     display: flex;
     flex-direction: column;
     overflow: hidden;
     position: relative;
     /* Prevents content from overflowing the panel */
 }

 #search-container {
    display: flex;
    align-items: center;
    gap: 15px;
     padding: 10px 20px 0;
     position: relative;
     flex-shrink: 0;
     /* padding-top: 0px; */
     margin-bottom: 10px;
 }

 #search-input {
     flex-grow: 1;
     min-width: 0; /* Prevents input from overflowing flex container */
     padding-block: 10px;
     padding-inline-end: 15px;
     padding-inline-start: 40px;
     border: 1px solid #e0e0e0;
     border-radius: 20px;
     font-size: 1rem;
     box-sizing: border-box;
     background-color: #f5f5f5;
     transition: background-color 0.2s, border-color 0.2s;
 }

 #search-input:focus {
     outline: none;
     border-color: #007bff;
     background-color: #fff;
 }

 .search-icon {
     position: absolute;
     inset-inline-start: 35px;
     inset-block-start: 21px;
     width: 18px;
     height: 18px;
     stroke: #999;
     pointer-events: none;
 }

 .pills-container {
     /* background-color: #ffffff; */
     padding-block: 5px; padding-inline: 20px;
     white-space: nowrap;
     overflow-x: auto;
     -webkit-overflow-scrolling: touch;
     scrollbar-width: none;
     /* For Firefox */
 }

 .pills-container::-webkit-scrollbar {
     display: none;
     /* Hide scrollbar for Chrome, Safari, and Opera */
     height: 8px;
 }

 .pills-container::-webkit-scrollbar-thumb {
     background: #ccc;
     border-radius: 4px;
 }

 .pills-wrapper {
     position: relative;
     flex-shrink: 0;
     /* Prevent wrapper from shrinking in the flex layout */
 }

 .pills-wrapper::before,
 .pills-wrapper::after {
     content: '';
     position: absolute;
     top: 0;
     bottom: 0;
     width: 25px;
     z-index: 2;
     pointer-events: none;
 }

 .pills-wrapper::before {
     inset-inline-start: 0;
     background: linear-gradient(to inline-end, #ffffff 20%, rgba(255, 255, 255, 0));
 }

 .pills-wrapper::after {
     inset-inline-end: 0;
     background: linear-gradient(to inline-start, #ffffff 20%, rgba(255, 255, 255, 0));
 }

 .pill-select-group {
     display: flex;
     flex-wrap: wrap;
     gap: 8px;
     margin-top: 5px;
 }
 
 .pill-select-group .filter-pill {
     margin-right: 0; /* Override default margin from main filter pills */
 }
 
 /* Override for submission form's category container to prevent scrolling
    and allow it to grow to fit all category options. */
 #submission-modal .checkbox-group {
     max-height: none;
     overflow-y: visible;
     border: none;
     padding: 0;
 }
 
 #clear-filters-wrapper {
     flex-shrink: 0;
     /* The wrapper is now just a container, no extra styles needed */
     /* The button inside will have its own margin/padding if needed */
 }

 .filter-pill {
     display: inline-block;
     padding: 6px 14px;
     margin-inline-end: 8px;
     border-radius: 18px;
     background-color: #e9ecef;
     color: #495057;
     cursor: pointer;
     font-weight: 500;
     font-size: 0.9rem;
     transition: background-color 0.2s, color 0.2s;
 }

 .filter-pill:hover {
     background-color: #dee2e6;
 }

 .filter-pill.active {
     background-color: #007bff;
     color: #ffffff;
 }

 #events-container {
     flex-grow: 1;
     overflow-y: auto;
     padding-inline: 20px;
     padding-top: 0;
     /* Add padding to the bottom to account for the nav bar's height */
     padding-bottom: calc(var(--bottom-nav-height) + var(--safe-area-inset-bottom, 0px) + 20px);
     margin-top: 20px;
 }

 /* Custom Scrollbar for Webkit browsers */
 #events-container::-webkit-scrollbar {
     width: 8px;
 }

 #events-container::-webkit-scrollbar-track {
     background: #f1f1f1;
 }

 #events-container::-webkit-scrollbar-thumb {
     background: #888;
     border-radius: 4px;
 }

 #events-container::-webkit-scrollbar-thumb:hover {
     background: #555;
 }

 .card {
     background-color: #f9f9f9;
     border-radius: 8px;
     box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
     overflow: hidden;
     cursor: pointer;
     transition: background-color 0.2s ease;
     margin-bottom: 15px;
     /* Space between cards */
 }

 .card {
     position: relative;
     /* For positioning the favorite button */
 }

 .favorite-btn {
     position: absolute;
     inset-block-start: 10px;
     inset-inline-end: 10px;
     background-color: rgba(0, 0, 0, 0.4);
     color: white;
     border: none;
     border-radius: 50%;
     width: 36px;
     height: 36px;
     display: flex;
     align-items: center;
     justify-content: center;
     cursor: pointer;
     transition: background-color 0.2s, transform 0.2s;
     z-index: 2;
 }

 .favorite-btn:hover {
     background-color: rgba(0, 0, 0, 0.6);
     transform: scale(1.1);
 }

 .favorite-btn svg {
     width: 20px;
     height: 20px;
 }

 .card:hover {
     background-color: #f0f0f0;
     /* A subtle background color change */
 }

 .card:last-child {
     margin-bottom: 15px;
 }

 .no-results-container {
     text-align: center;
     padding: 40px 20px;
     color: #666;
 }

 .no-results-container p {
     margin-bottom: 20px;
 }

 .clear-filters-btn {
     padding: 10px 20px;
     border: 1px solid #007bff;
     color: #007bff;
     background-color: transparent;
     border-radius: 20px;
     cursor: pointer;
     font-size: 0.9rem;
     font-weight: 600;
     transition: background-color 0.2s, color 0.2s;
 }

 .clear-filters-btn:hover {
     background-color: #007bff;
     color: #fff;
 }

 .address-link {
     color: #007bff;
     text-decoration: none;
 }

 .address-link:hover {
     text-decoration: underline;
 }

 .detail-actions {
    /* margin-top: 20px; */
    /* padding-top: 15px; */
    /* border-top: 1px solid #eee; */
     display: flex;
     justify-content: center;
     gap: 10px;
 }

 /* Override for detail action buttons to give them a solid background */
 .detail-actions button {
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
 }
 
 .detail-actions button:hover {
    background-color: #f8f9fa; /* A slightly off-white for hover */
    border-color: #007bff;
    color: #007bff;
 }
 
 #add-to-calendar-btn {
     display: inline-flex;
     align-items: center;
     gap: 8px;
     padding: 10px 20px;
     border: 1px solid #28a745;
     color: #28a745;
     background-color: transparent;
     border-radius: 20px;
     cursor: pointer;
     font-size: 0.9rem;
     font-weight: 600;
     transition: background-color 0.2s, color 0.2s;
 }

 #add-to-calendar-btn:hover {
     background-color: #28a745;
     color: #fff;
 }

 #share-event-btn {
     display: inline-flex;
     align-items: center;
     gap: 8px;
     padding: 10px 20px;
     border: 1px solid #007bff;
     color: #007bff;
     background-color: transparent;
     border-radius: 20px;
     cursor: pointer;
     font-size: 0.9rem;
     font-weight: 600;
     transition: background-color 0.2s, color 0.2s;
 }

 #share-event-btn:hover {
     background-color: #007bff;
     color: #fff;
 }

 #share-event-btn:disabled {
     background-color: #28a745;
     border-color: #28a745;
     color: #fff;
     cursor: default;
 }

 #report-event-btn {
     display: inline-flex;
     align-items: center;
     gap: 8px;
     padding: 10px 20px;
     border: 1px solid #dc3545;
     color: #dc3545;
     background-color: transparent;
     border-radius: 20px;
     cursor: pointer;
     font-size: 0.9rem;
     font-weight: 600;
     transition: background-color 0.2s, color 0.2s;
 }

 #report-event-btn:hover {
     background-color: #dc3545;
     color: #fff;
 }

 .settings-content {
    margin: 20px 0;
 }

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.settings-item:first-of-type {
    border-top: 1px solid #eee;
}

.settings-item > label {
    font-weight: 500;
    color: #333;
}

.segmented-control {
    display: flex;
    border: 1px solid #007bff;
    border-radius: 8px;
    overflow: hidden;
}

.segmented-control input[type="radio"] {
    display: none;
}

.segmented-control label {
    padding: 6px 16px;
    cursor: pointer;
    background-color: #fff;
    color: #007bff;
    transition: background-color 0.2s, color 0.2s;
    font-weight: 500;
    font-size: 0.9rem;
}

.segmented-control input[type="radio"]:checked + label {
    background-color: #007bff;
    color: #fff;
}

.segmented-control label:not(:last-of-type) {
    border-right: 1px solid #007bff;
}

.zoom-control {
    display: flex;
    align-items: center;
    gap: 15px;
}

.zoom-control input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 120px;
    height: 8px;
    background: #ddd;
    border-radius: 5px;
    outline: none;
    transition: background .2s;
}

.zoom-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #007bff;
    cursor: pointer;
    border-radius: 50%;
}

.zoom-control input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #007bff;
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

.zoom-control #zoom-level-value {
    font-weight: 500;
    min-width: 20px;
    text-align: center;
}

/* Modern Toggle Switch */
 .toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
 }

 .toggle-switch-checkbox {
    opacity: 0;
    width: 0;
    height: 0;
 }

 .toggle-switch-label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 28px;
 }

 .toggle-switch-label:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
 }

 .toggle-switch-checkbox:checked + .toggle-switch-label {
    background-color: #007bff;
 }

 .toggle-switch-checkbox:checked + .toggle-switch-label:before {
    transform: translateX(22px);
 }

 .address-container {
     display: flex;
     align-items: center;
     justify-content: space-between;
     gap: 10px;
     margin: 1em 0;
 }

 .address-container p {
     margin: 0;
 }

 .directions-btn {
     background: none;
     border: 1px solid #ccc;
     border-radius: 50%;
     width: 36px;
     height: 36px;
     display: flex;
     align-items: center;
     justify-content: center;
     cursor: pointer;
     padding: 0;
     flex-shrink: 0;
     transition: background-color 0.2s, border-color 0.2s;
 }

 .directions-btn svg {
     stroke: #555;
     width: 18px;
     height: 18px;
 }

 .directions-btn:hover {
     background-color: #f0f0f0;
     border-color: #aaa;
 }

 #event-photo {
     display: none;
 }

 /* Fix for photo upload group overflowing on smaller screens.
    This ensures the container is constrained by the modal's width. */
 #photo-upload-group {
    width: 100%;
 }

 #scroll-to-top-btn {
     position: absolute;
     inset-block-end: 20px;
     inset-inline-end: 30px;
     width: 44px;
     height: 44px;
     background-color: #007bff;
     color: white;
     border: none;
     border-radius: 50%;
     display: flex;
     align-items: center;
     justify-content: center;
     cursor: pointer;
     box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
     z-index: 5;
     opacity: 0;
     visibility: hidden;
     transform: translateY(20px);
     transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
 }

 #scroll-to-top-btn.visible {
     opacity: 1;
     visibility: visible;
     transform: translateY(0);
 }

 .card-chevron {
     display: none;
     color: #aaa;
     transition: color 0.2s ease;
     margin-inline-start: 10px;
 }

 .card:hover .card-chevron {
     color: #333;
 }

 .card-content {
     padding: 15px 0;
     flex-grow: 1;
 }

 .card-body {
     display: flex;
     align-items: center;
     padding: 0 15px;
 }

 .card-title {
     font-size: 1.1rem;
     font-weight: 600;
     margin: 0 0 5px;
 }

 .card-description {
     font-size: 0.9rem;
     color: #666;
     margin-bottom: 10px;
     /* Add space before pills */
 }

 .mini-pills-container {
     display: flex;
     flex-wrap: wrap;
     gap: 6px;
 }

 .mini-pill {
     display: inline-block;
     padding: 4px 10px;
     border-radius: 12px;
     background-color: #e0e0e0;
     color: #333;
     font-size: 0.75rem;
     font-weight: 500;
 }

 .sale-type-pill-mini {
     background-color: #28a745;
     /* A green color for sale type */
     color: white;
 }

  /* Detail panel: same pill style as list panel — no slide transition */
  #detail-panel {
      height: 75vh;
      z-index: 1001; /* above list panel */
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      /* Hidden by default — shown via morph-open animation */
      display: none;
      overflow: hidden;
      margin: 10px;
      margin-bottom: calc(10px + var(--safe-area-inset-bottom, 0px));
      border-radius: 20px;
      box-shadow: 0 5px 30px rgba(0, 0, 0, 0.25);
  }

 #detail-panel.open {
     display: flex;
     flex-direction: column;
 }

 #detail-back-button {
     display: none;
     cursor: pointer;
     /* Reset button styles */
     background: none;
     border: none;
     padding: 0;
     margin-inline-end: 10px;
 }

 #detail-favorite-btn {
     position: static;
     background-color: transparent;
     margin-inline-start: 10px;
     padding: 5px;
 }

 #detail-favorite-btn svg {
     stroke: #666;
 }

 .favorite-btn.active svg,
 #detail-favorite-btn.active svg {
     fill: #ff4757;
     stroke: #ff4757;
 }

 #detail-content {
     padding: 20px;
     overflow-y: scroll;
     /* Add padding to the bottom to account for the nav bar's height and safe area */
     padding-bottom: calc(var(--bottom-nav-height) + var(--safe-area-inset-bottom, 0px) + 20px);
     padding-top: 0px;
 }

 /* A container for the text content within the detail panel to improve legibility on glass backgrounds. */
 .detail-text-content {
    background-color: rgba(255, 255, 255, 0.85); /* A more opaque white */
    padding: 15px;
    margin: 15px 0; /* Remove horizontal margin to match photo width */
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
 }
 
 /* When using the standard theme, this box should just blend in. */
 .standard-theme .detail-text-content {
    background-color: transparent;
    border-color: transparent;
 }

 /* --- Comment Section Styles --- */
 .comments-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
 }

 .comments-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
 }

 .comment {
    margin-bottom: 15px;
 }

 .comment .comment-text {
    margin-top: 0;
    margin-bottom: 2px; /* Reduce space below the comment text */
 }

 .comment-meta {
    font-size: 0.75rem; /* Make the font smaller */
    color: #6c757d; /* Make the text color lighter */
    margin-top: 0; /* Remove space above the date */
 }

 .user-owned-comment {
    background-color: #e7f3ff; /* A light blue highlight */
    border-left: 3px solid #007bff;
    padding: 10px;
    margin-left: -10px;
    margin-right: -10px;
    border-radius: 4px;
 }

 .add-comment-link {
    display: block;
    margin-top: 15px;
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
 }

 .add-comment-link:hover {
    text-decoration: underline;
 }

 .comment-form-container {
    margin-top: 15px;
 }

 .comment-input-wrapper textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    box-sizing: border-box;
    resize: vertical;
 }

 .comment-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
 }

 #comment-word-counter {
    font-size: 0.8rem;
    color: #6c757d;
 }

 #qr-code-container {
     position: absolute;
     inset-block-end: 20px;
     inset-inline-end: 20px;
     z-index: 10;
     cursor: pointer;
     display: none; /* Hidden by default, shown via JS for desktop */
     transition: opacity 0.3s ease;
 }

 #qr-code-container img {
     width: 50px;
     height: 50px;
     border-radius: 5px;
     box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
 }

 #qr-modal {
     position: fixed;
     inset-block-start: 0;
     inset-inline-start: 0;
     width: 100%;
     height: 100%;
     background-color: rgba(0, 0, 0, 0.6);
     z-index: 2000;
     display: none;
     /* Hidden by default */
     justify-content: center;
     align-items: center;
     flex-direction: column;
 }

 #qr-modal img {
     width: 250px;
     height: 250px;
 }

 #qr-modal p {
     color: white;
     font-size: 1.2rem;
     margin-top: 20px;
 }

 #debug-overlay {
     position: absolute;
     inset-block-start: 10px;
     inset-inline-start: 50%;
     transform: translateX(-50%);
     background-color: rgba(0, 0, 0, 0.7);
     color: white;
     border-radius: 5px;
     z-index: 12;
     font-family: monospace;
     font-size: 12px;
     pointer-events: auto;
     box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
 }

 #debug-header {
     padding: 5px 10px;
     background-color: rgba(0, 0, 0, 0.9);
     cursor: pointer;
     font-weight: bold;
     user-select: none;
     /* Prevent text selection on drag */
 }

 #debug-content {
     padding: 10px;
     pointer-events: auto;
     /* Allow scrolling/selection */
     min-width: 350px;
     max-height: 400px;
     overflow-y: auto;
 }

 #debug-overlay.collapsed #debug-content {
     display: none;
 }

 #loading-overlay {
     position: fixed;
     inset-block-start: 0;
     inset-inline-start: 0;
     width: 100%;
     height: 100%;
     background-color: rgba(255, 255, 255, 0.9);
     z-index: 9999;
     display: flex;
     justify-content: center;
     align-items: center;
     transition: opacity 0.5s ease, visibility 0.5s;
     opacity: 1;
     visibility: visible;
 }

 #loading-overlay.hidden {
     opacity: 0;
     visibility: hidden;
 }

 .spinner {
     width: 50px;
     height: 50px;
     border: 5px solid #f3f3f3;
     border-top: 5px solid #007bff;
     border-radius: 50%;
     animation: spin 1s linear infinite;
 }

 /* --- Image Slider --- */
 .image-slider {
     position: relative;
     overflow: hidden;
     background-color: #f0f0f0;
     /* Placeholder color */
 }

 .card-slider {
     height: 150px;
 }

 .detail-slider {
     height: 250px;
     /* A bit taller for the detail view */
     border-radius: 8px;
     margin-bottom: 15px;
 }

 .slider-inner {
     display: flex;
     height: 100%;
     transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
 }

 .slider-slide {
     flex-shrink: 0;
     width: 100%;
     height: 100%;
     background-size: cover;
     background-position: center;
     background-repeat: no-repeat;
     padding-top: 15px;
 }

 .slider-btn {
     position: absolute;
     inset-block-start: 50%;
     transform: translateY(-50%);
     background-color: rgba(0, 0, 0, 0.5);
     color: white;
     border: none;
     border-radius: 50%;
     width: 32px;
     height: 32px;
     font-size: 18px;
     font-weight: bold;
     cursor: pointer;
     display: flex;
     align-items: center;
     justify-content: center;
     line-height: 1;
     transition: background-color 0.2s, opacity 0.3s;
     opacity: 0;
     /* Hidden by default */
     z-index: 1;
 }

 .image-slider:hover .slider-btn {
     opacity: 1;
     /* Show on hover */
 }

 .slider-btn.prev {
     inset-inline-start: 10px;
 }

 .slider-btn.next {
     inset-inline-end: 10px;
 }

 .slider-btn:hover {
     background-color: rgba(0, 0, 0, 0.8);
 }

 .slider-dots {
     position: absolute;
     inset-block-end: 10px;
     inset-inline-start: 50%;
     transform: translateX(-50%);
     display: flex;
     gap: 6px;
     z-index: 1;
 }

 .slider-dot {
     width: 8px;
     height: 8px;
     border-radius: 50%;
     background-color: rgba(255, 255, 255, 0.6);
     border: 1px solid rgba(0, 0, 0, 0.2);
     cursor: pointer;
     transition: background-color 0.2s;
 }

 .slider-dot.active {
     background-color: #ffffff;
 }

 .user-location-dot {
     width: 12px;
     height: 12px;
     border-radius: 50%;
     background-color: #007aff;
     border: 3px solid #fff;
     box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.3);
     transform: translate(-50%, -50%);
     animation: pulse 2s infinite;
 }

 @keyframes spin {
     0% {
         transform: rotate(0deg);
     }

     100% {
         transform: rotate(360deg);
     }
 }

 @keyframes pulse {
     0% {
         box-shadow: 0 0 0 0 rgba(0, 122, 255, 0.4);
     }

     70% {
         box-shadow: 0 0 0 20px rgba(0, 122, 255, 0);
     }

     100% {
         box-shadow: 0 0 0 0 rgba(0, 122, 255, 0);
     }
 }

 /* --- Bottom Navigation Bar (floating rounded pill) --- */

 /*
  * When any sliding panel is visible, animate the pill downward and fade it out.
  * The body gets .list-panel-visible or .detail-panel-visible from client.js.
  */
 body.list-panel-visible #bottom-nav,
 body.detail-panel-visible #bottom-nav,
 body.submission-modal-visible #bottom-nav,
 body.settings-modal-visible #bottom-nav {
    transform: translateX(-50%) translateY(30px);
    opacity: 0;
    pointer-events: none;
 }

 #bottom-nav {
    position: fixed;
    /* Float above the bottom edge with a gap */
    inset-block-end: 16px;
    /* Centre horizontally and constrain width so it looks like a pill */
    inset-inline-start: 50%;
    transform: translateX(-50%);
    /* Smooth animation for show/hide when panels open/close */
    transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1),
                opacity 0.35s ease;
    width: max-content;
    min-width: 260px;
    max-width: calc(100% - 40px); /* 20px margin each side */
    height: var(--bottom-nav-height);
    justify-content: space-around;
    display: flex;
    align-items: stretch;
    z-index: 999;
    /* Pill shape */
    border-radius: 999px;
    /* Subtle shadow so it floats above the map */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18), 0 1px 6px rgba(0, 0, 0, 0.10);
    /* Clip children to the rounded corners */
    overflow: hidden;
    /* Remove the flat border-top that the themes add */
    border-top: none !important;
    /* Extra inset padding so the first/last buttons don't butt up against the pill edges */
    padding-inline: 12px;
    /* Safe-area-aware bottom offset */
    bottom: calc(40px + var(--safe-area-inset-bottom, 0px));
    inset-block-end: unset;
 }

 .nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: none;
    border: none;
    /* Horizontal padding widens each button tap target; extra top padding lifts content */
    padding: 10px 28px 5px;
    cursor: pointer;
    color: #666;
    transition: color 0.2s, transform 0.1s ease-out;
    /* Prevent buttons from shrinking below their content */
    white-space: nowrap;
 }

 /* Add a subtle "tap" animation when a nav button is pressed. */
 .nav-btn:active {
    transform: scale(0.92);
    /* Make the press-down feel faster and more responsive. */
    transition-duration: 0.05s;
 }

 .nav-btn svg {
   width: 24px;
   height: 24px;
   /* Default to stroked icons, which is the most common case. */
   stroke: currentColor;
   fill: none;
 }

 .nav-btn-text {
    font-size: 0.7rem;
    font-weight: 500;
 }

 .nav-btn.active {
    color: #007bff;
    transform: translateY(-2px); /* Pop the active icon up slightly */
 }

 .nav-btn.active .nav-btn-text {
    font-weight: 700; /* Make the text bolder for emphasis */
 }

 /* --- Cluster Info Window --- */
 .cluster-info-window {
     font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
     padding: 5px;
     max-width: 250px;
 }
 
 .cluster-info-window strong {
     font-size: 1rem;
     color: #333;
     display: block;
     margin-bottom: 8px;
     border-bottom: 1px solid #eee;
     padding-bottom: 5px;
 }
 
 .cluster-info-list {
     list-style: none;
     padding: 0;
     margin: 0;
     max-height: 150px;
     overflow-y: auto;
 }
 
 .cluster-info-list li {
     font-size: 0.9rem;
     color: #555;
     padding: 4px 0;
     white-space: nowrap;
     overflow: hidden;
     text-overflow: ellipsis;
 }
 
 .cluster-info-more {
     font-style: italic;
     color: #666;
     margin: 5px 0 0;
     font-size: 0.8rem;
 }
 
 @keyframes infowindow-fade-in {
     from {
         opacity: 0;
         transform: translateY(5px);
     }
     to {
         opacity: 1;
         transform: translateY(0);
     }
 }
 
 .infowindow-fade-animation {
     animation: infowindow-fade-in 0.25s ease-out;
 }

 /* --- Google Maps Overrides --- */
 /*
  * Selectively hide the close button on the InfoWindow for cluster previews.
  * We use the :has() pseudo-class to apply this style only when the InfoWindow
  * contains our custom .cluster-info-window content.
  */
 .gm-style-iw-c:has(.cluster-info-window) button[aria-label="Close"] {
    display: none !important;
 }
 #center-location-button {
     position: fixed;
     inset-block-start: 16px;
     inset-inline-end: 10px;
     z-index: 10;
 }

 /* Desktop Layout */
 @media (min-width: 769px) {
     #logo {
         inset-inline-end: 10px;
         inset-inline-start: auto;
         background-color: #fff;
         border-radius: 50%;
         width: 40px;
         height: 40px;
         display: flex;
         justify-content: center;
         align-items: center;
         cursor: pointer;
         box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
     }
 
     #center-location-button svg {
         stroke: #555;
     }
 
     /* Override for the few icons that should be filled instead of stroked. */
     .nav-btn svg[fill="currentColor"] {
         stroke: none;
         fill: currentColor;
     }
 
     #center-location-button.following svg {
         stroke: #007bff;
         /* Active blue */
         fill: #e6f2ff;
     }
 
     #bottom-nav {
         display: none;
     }
 
     .card-chevron {
         display: block;
     }
 
     #detail-back-button {
         display: flex;
         align-items: center;
     }
 
     #debug-header {
         cursor: move;
     }
 
     #map.panel-closed {
         inline-size: 100%;
         margin-inline-start: 0;
     }
 
     .panel {
         inset-block-start: 0;
         inset-block-end: 0;
         inset-inline-start: 0;
         inset-inline-end: auto;
         inline-size: 25%;
         height: 100%;
         border-radius: 0;
         box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
         position: fixed;
         border-radius: 0px;
     }
 
     #list-panel {
         /* Desktop: restore to full-height side panel */
         display: flex;
         flex-direction: column;
         position: fixed;
         height: 100%;
         width: var(--list-panel-width, 25%);
         top: 0;
         left: 0;
         bottom: 0;
         right: auto;
         margin: 0;
         border-radius: 0;
         box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
         transform: translateX(0);
         transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.4s ease;
         visibility: visible;
     }
 
     #list-panel.closed {
         transform: translateX(-100%);
         opacity: 0;
     }
 
     #list-panel.detail-open {
         transform: translateX(0);
         /* Stays visible */
     }
 
     #detail-panel {
         /* Desktop: restore to full-height side panel */
         display: flex;
         flex-direction: column;
         height: 100%;
         width: var(--list-panel-width, 25%);
         top: 0;
         left: 0;
         bottom: 0;
         right: auto;
         margin: 0;
         border-radius: 0;
         box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
         transform: translateX(-100%);
         z-index: 4;
     }
 
     #detail-panel.open {
         display: flex;
         transform: translateX(0);
     }
 
     .panel-header {
         display: flex;
         align-items: center;
         cursor: default;
         /* No dragging on desktop */
         margin-bottom: 0;
         padding-block: 10px; padding-inline: 20px;
         border-radius: 0 !important;
     }
 
     #collapse-button {
         display: flex;
         /* Use flex to align with other buttons */
         /* Minor visual adjustment to perfectly align with the other icons. */
         transform: translateY(1px);
     }
 
     #list-panel.closed+#expand-button {
         display: block;
     }
 
     .panel-handle {
         display: none;
         /* Hide mobile handle */
     }
 
     .panel-header {
         text-align: left;
         /* Override mobile-first center alignment */
     }
 
     .panel-title {
         flex-grow: 1;
     }
 
     .header-actions {
         position: static;
         transform: none;
         gap: 0;
     }
 
     .header-action-btn {
         position: static;
         margin-inline-start: 10px;
     }
 
     #detail-back-button {
         background: none;
         border: none;
         padding: 0;
         /* Reset button styles */
     }
 
     #submission-modal .modal-content {
         max-width: 1000px;
     }

     /* --- Desktop Content Condensation --- */
     /* Make the UI more data-dense on larger screens */
 
     .panel .panel-header {
         padding-block: 6px;
         /* Reduce vertical padding */
     }
 
     .panel .panel-title {
         font-size: 1.0rem;
         /* Slightly smaller title */
     }
 
     .panel #search-input {
         font-size: 0.85rem;
         padding-block: 6px;
     }
 
     .panel .pills-container {
         padding-block: 2px;
     }
 
     .panel .filter-pill {
         font-size: 0.75rem;
         padding: 3px 8px;
     }
 
     .panel #events-container {
         padding: 0 10px 10px;
         /* Reduce padding */
         margin-top: 10px;
     }
 
     .panel .card {
         margin-bottom: 8px;
         /* Tighter card spacing */
     }
 
     .panel .card-content {
         padding: 10px 0;
     }
 
     .panel .card-body {
         padding: 0 10px;
     }
 
     .panel .card-title {
         font-size: 0.95rem;
     }
 
     .panel .card-description {
         font-size: 0.8rem;
         margin-bottom: 6px;
     }
 
     .panel .mini-pill {
         font-size: 0.65rem;
         padding: 2px 6px;
     }
 
     /* Detail Panel Specifics */
     #detail-content {
         padding: 12px;
     }
 
     #detail-content p,
     #detail-content .address-container {
         font-size: 0.85rem;
         margin: 0.7em 0;
     }
 
     #detail-content .detail-actions button {
         font-size: 0.8rem;
         padding: 6px 12px;
     }

     /* Condense map elements for desktop */
     .user-location-dot {
         width: 10px;
         height: 10px;
         border-width: 2px;
     }

     .cluster-info-window strong {
         font-size: 0.9rem;
         margin-bottom: 5px;
         padding-bottom: 4px;
     }

     .cluster-info-list li {
         font-size: 0.8rem;
         padding: 3px 0;
     }
 }

@media (max-width: 768px) {
     body.submission-modal-visible #logo-container {
         display: none;
     }
 }

 /*
  * Make the submission modal full-screen on mobile devices
  * for a more app-like experience.
  */
 @media (max-width: 768px) {
    #submission-modal .modal-content {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
        border-bottom-right-radius: 20px;
        border-bottom-left-radius: 20px;
    }

     /* Add safe area padding to the header and footer inside the full-screen modal */
     #submission-modal .modal-title {
         padding-top: calc(20px + var(--safe-area-inset-top));
         padding-left: calc(20px + var(--safe-area-inset-left));
         padding-right: calc(20px + var(--safe-area-inset-right));
     }

     #submission-modal .form-scroll-content {
        padding-left: calc(20px + var(--safe-area-inset-left));
        padding-right: calc(20px + var(--safe-area-inset-right));
     }

     #submission-modal .form-actions {
         /* padding-bottom: calc(15px + var(--safe-area-inset-bottom)); */
         padding-left: calc(20px + var(--safe-area-inset-left));
         padding-right: calc(20px + var(--safe-area-inset-right)); 
     }
 }

 @media (max-width: 768px) {
    #submission-modal .modal-content {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        margin: 0;
        box-shadow: none;
        border-radius: 20px;
    }
}
