html, body {
    height: 100%;
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
}
#container {
    display: flex;
    height: 100%;
}
#map {
    flex: 1;
}
#sidebar {
    width: 420px;
    padding: 16px;
    box-sizing: border-box;
    background: #fafafa;
    border-left: 1px solid #ddd;
    overflow-y: auto;
    word-wrap: break-word;
    overflow-wrap: break-word;
    transition: width 0.3s ease, padding 0.3s ease;
}

#sidebar.sidebar-collapsed {
    width: 0;
    padding: 0;
    border-left: none;
    overflow: hidden;
}

/* Sidebar toggle button */
.sidebar-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: background-color 0.2s, box-shadow 0.2s, opacity 0.3s ease, visibility 0.3s ease;
    opacity: 1;
    visibility: visible;
}

.sidebar-toggle:hover {
    background: #f5f5f5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.sidebar-toggle.hidden {
    opacity: 0;
    visibility: hidden;
}

.toggle-icon {
    font-size: 16px;
    color: #333;
    display: block;
    line-height: 1;
}
#sidebar h2 {
    margin-top: 0;
}

/* Image styling */
#images img, .listing-image {
    width: 100%;
    border-radius: 4px;
    margin-bottom: 8px;
}

.cover-photo {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 8px;
}

/* Post preview containers */
.post-preview {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid #ddd;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.text-preview {
    color: #333;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 10px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.full-description {
    color: #333;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 15px;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Button styling */
.expand-button, .back-button {
    background: #4285f4;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.expand-button:hover, .back-button:hover {
    background: #3367d6;
}

.back-button {
    background: #666;
    margin-bottom: 15px;
}

.back-button:hover {
    background: #777;
}

.listing-link {
    margin-top: 15px;
    margin-bottom: 15px;
}

.listing-link a {
    color: #4285f4;
    text-decoration: none;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.listing-link a:hover {
    text-decoration: underline;
}

/* Sidebar filters */
.sidebar-filters {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #e9ecef;
}

.filter-group {
    margin-bottom: 16px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group label {
    display: block;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

/* Sidebar filters */
.sidebar-filters {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #e9ecef;
}

.filter-group {
    margin-bottom: 16px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group label {
    display: block;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

/* Price inputs container */
.price-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.price-inputs input[type="number"] {
    flex: 1;
    min-width: 0;
    width: 0;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    box-sizing: border-box;
}

.price-inputs input[type="number"]:focus {
    outline: none;
    border-color: #4285f4;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
}

.price-separator {
    color: #666;
    font-weight: 500;
    font-size: 14px;
    flex-shrink: 0;
}

/* Form controls */
input[type="range"] {
    width: 100%;
    margin-top: 6px;
}

label {
    color: #333;
    font-size: 14px;
}

#hoursLabel {
    color: #000;
    font-weight: bold;
}

/* Details container */
#details {
    margin: 0;
    padding: 0;
    font-family: inherit;
}

/* New modular component styles */

/* Cover photo container with loading states */
.cover-photo-container {
    position: relative;
    width: 100%;
    height: 120px;
    background: #f0f0f0;
    border-radius: 4px;
    margin-bottom: 8px;
    overflow: hidden;
}

.cover-photo-container.loaded {
    background: transparent;
}

.cover-photo-container.error {
    background: #ffebee;
}

/* Image placeholder */
.image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #999;
    font-size: 12px;
    background: #f5f5f5;
}

/* Image count badge */
.image-count-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
}

/* Post metadata */
.post-metadata {
    color: #666;
    font-size: 12px;
    margin-bottom: 8px;
    line-height: 1.3;
}

/* Posting time */
.posting-time {
    color: #666;
    font-size: 13px;
    margin-bottom: 10px;
    font-style: italic;
}

/* Extra details */
.extra-details {
    background: #f8f9fa;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 15px;
    font-size: 13px;
}

.detail-item {
    margin-bottom: 4px;
    color: #555;
}

.detail-item:last-child {
    margin-bottom: 0;
}

/* Image gallery for single listing */
.image-gallery {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.image-container {
    position: relative;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}

.image-container.loaded {
    background: transparent;
}

.image-container.error {
    background: #ffebee;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    color: #999;
    font-size: 12px;
}

/* No images message */
.no-images {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 4px;
}

/* Prominent price displays */
.prominent-price {
    /* font-weight handled inline for selective styling */
}

.prominent-price-detail {
    /* font-weight handled inline for selective styling */
}


.text-preview {
  /* Space handling */
  white-space: normal;          /* allow wrapping */
  overflow-wrap: break-word;    /* break long words/URLs if needed */

  /* Ellipsis after a few lines (≈ 220 chars) */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;        /* adjust lines to taste */

  /* Hide anything beyond the clamp */
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Loading indicator - positioned in corner, non-blocking */
.loading-indicator {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    pointer-events: none; /* Allow clicks to pass through */
}

.loading-content {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    text-align: left;
    max-width: 250px;
    border: 1px solid #ddd;
    pointer-events: auto; /* Re-enable pointer events for the content */
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.loading-content:hover {
    opacity: 0.8;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #4285f4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    display: inline-block;
    vertical-align: middle;
    margin: 0;
}

.loading-progress {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* Contact section styling - at bottom of content */
.contact-section {
    margin-top: 20px;
    padding: 16px 0 0 0;
    border-top: 1px solid #e9ecef;
}

.contact-header {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
    text-align: center;
    font-weight: 500;
}

.contact-buttons {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    justify-content: center;
}

.contact-link {
    color: #F8BBD0;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    transition: color 0.2s ease;
}

.contact-link:hover {
    color: #E91E63;
    text-decoration: none;
}
