/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: #2c5530;
    margin-bottom: 10px;
    font-size: 2.5rem;
}

header p {
    color: #666;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Map Container */
#map {
    height: 600px;
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

/* Map Controls */
.map-controls {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.filter-controls h3 {
    margin-bottom: 15px;
    color: #2c5530;
}

.filter-controls label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    cursor: pointer;
    font-weight: 500;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.filter-controls label:hover {
    background-color: #f8f9fa;
}

.filter-controls .label-content {
    display: flex;
    align-items: center;
}

.filter-controls .item-count {
    font-size: 0.9em;
    color: #666;
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
    min-width: 20px;
    text-align: center;
}

.filter-controls .item-count.loading {
    animation: pulse 1.5s ease-in-out infinite alternate;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    100% { opacity: 1; }
}

.filter-controls input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
}

/* Global Search */
.global-search {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.global-search h3 {
    color: #2c5530;
    margin-bottom: 15px;
}

/* Entity Lists */
.entity-lists {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.list-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.list-section h3 {
    color: #2c5530;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.list-container {
    min-height: 100px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    #map {
        height: 400px;
    }
    
    .entity-lists {
        grid-template-columns: 1fr;
    }
    
    .map-controls {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    #map {
        height: 350px;
    }
    
    .filter-controls label {
        font-size: 0.9rem;
    }
}

/* Custom marker tooltips */
.custom-tooltip {
    background: rgba(0, 0, 0, 0.8) !important;
    border: none !important;
    border-radius: 4px !important;
    color: white !important;
    padding: 4px 8px !important;
    font-size: 12px !important;
    font-weight: bold !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3) !important;
}

.custom-tooltip::before {
    border-top-color: rgba(0, 0, 0, 0.8) !important;
}

/* Entity Lists Styling */
.search-controls {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 180px;
}

.filter-label {
    font-size: 0.9em;
    font-weight: 500;
    color: #2c5530;
    margin-bottom: 3px;
}

.search-input, .filter-select {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-input:focus, .filter-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.filter-select:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    border-color: #dee2e6;
    cursor: not-allowed;
}

.list-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.list-item:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.15);
    transform: translateY(-1px);
}

.list-item-content {
    flex: 1;
    cursor: pointer;
}

.list-item-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.details-link {
    color: #3498db;
    text-decoration: underline;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.details-link:hover {
    color: #2980b9;
}

.list-item h4 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 1.1em;
}

.list-item p {
    margin: 4px 0;
    color: #666;
    font-size: 0.9em;
    line-height: 1.4;
}

.list-item .description {
    font-style: italic;
    color: #777;
}

.list-item .products, .list-item .amenities {
    color: #3498db;
    font-weight: 500;
}

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

.pagination-info {
    margin-bottom: 10px;
    color: #666;
    font-size: 0.9em;
    text-align: center;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.pagination-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: #2980b9;
}

.pagination-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.page-info {
    color: #666;
    font-size: 14px;
}

/* Detail Pages */
.detail-page {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.detail-section {
    margin-bottom: 25px;
}

.detail-section h3 {
    color: #2c5530;
    margin-bottom: 10px;
    font-size: 1.3rem;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 5px;
}

.detail-section p {
    margin-bottom: 8px;
    line-height: 1.6;
}

.resource-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.resource-link {
    background: #3498db;
    color: white;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    font-weight: 500;
}

.resource-link:hover {
    background: #2980b9;
}

.product-tag, .amenity-tag {
    background: #e8f4fd;
    color: #2980b9;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-right: 8px;
    margin-bottom: 4px;
    display: inline-block;
}

.loading-message, .error-message {
    text-align: center;
    padding: 40px;
    font-size: 1.1rem;
    color: #666;
}

.error-message {
    color: #e74c3c;
}

nav a {
    color: #2c5530;
    text-decoration: none;
    font-weight: 500;
    padding: 10px 20px;
    border: 2px solid #2c5530;
    border-radius: 6px;
    transition: all 0.2s ease;
}

nav a:hover {
    background: #2c5530;
    color: white;
}

/* Modal Dialog */
.detail-modal {
    border: none;
    border-radius: 12px;
    padding: 0;
    max-width: 800px;
    width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    margin: auto;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.detail-modal::backdrop {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
}

.modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.modal-header {
    padding: 15px 20px 0 20px;
    display: flex;
    justify-content: flex-end;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 5px 10px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-body {
    padding: 0 30px 30px 30px;
    overflow-y: auto;
    flex: 1;
}

.detail-content-modal {
    /* Modal-specific content styling */
}

.detail-content-modal .detail-section h3 {
    font-size: 1.2rem;
}

/* Default layout structure for smaller screens */
@media (max-width: 1599px) {
    .main-layout {
        display: block;
    }
    
    .map-column {
        display: block;
    }
    
    .content-column {
        display: block;
    }
}

/* Large Screen Layout - Side by Side */
@media (min-width: 1600px) {
    .container {
        max-width: none;
        padding: 20px;
    }
    
    .main-layout {
        display: flex;
        gap: 20px;
        align-items: flex-start;
    }
    
    .map-column {
        flex: 1;
        position: sticky;
        top: 20px;
    }
    
    .content-column {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
    
    /* Adjust map for large screens */
    #map {
        height: 700px;
        margin-bottom: 0;
    }
    
    /* Content column scrollbar styling */
    .content-column::-webkit-scrollbar {
        width: 8px;
    }
    
    .content-column::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }
    
    .content-column::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 4px;
    }
    
    .content-column::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8;
    }
    
    /* Adjust entity lists for content column */
    .entity-lists {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
    
    .list-section {
        margin-bottom: 0;
    }
}

/* Responsive adjustments for lists */
@media (max-width: 768px) {
    .search-controls {
        flex-direction: column;
    }
    
    .search-input, .filter-select {
        min-width: auto;
    }
    
    .list-item {
        padding: 12px;
        flex-direction: column;
        gap: 15px;
    }
    
    .list-item-actions {
        justify-content: flex-end;
    }
    
    .pagination {
        flex-direction: column;
        gap: 10px;
    }
    
    .detail-page {
        padding: 20px;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .resource-links {
        flex-direction: column;
    }
}