/* Map Marker Styles */
.map-marker {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.indoor-marker {
    background-color: #0066cc;
}

.outdoor-marker {
    background-color: #28a745;
}

.mixed-marker {
    background: linear-gradient(90deg, #0066cc 50%, #28a745 50%);
}

.natural-marker {
    background-color: #17a2b8;
}

.pool-detail-marker {
    width: 30px;
    height: 30px;
    background-color: #dc3545;
    border: 3px solid white;
}

/* Popup Styles */
.pool-popup {
    min-width: 280px;
    max-width: 320px;
}

.pool-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    display: block;
    margin-bottom: 8px;
}

.pool-image-link {
    display: block;
    margin: 8px 0;
    text-decoration: none;
}

.pool-popup-image {
    width: 100%;
    max-height: 150px;
    object-fit: cover;
    border-radius: 6px;
}

.pool-description {
    font-size: 14px;
    color: #666;
    margin: 8px 0;
    line-height: 1.4;
}

.pool-badges {
    margin: 8px 0;
}

.badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: bold;
    border-radius: 3px;
    margin-right: 4px;
    margin-bottom: 2px;
    color: white;
}

.badge-indoor {
    background-color: #0066cc;
}

.badge-outdoor {
    background-color: #28a745;
}

.badge-natural {
    background-color: #17a2b8;
}

.badge-sauna {
    background-color: #ffc107;
    color: #212529;
}

.badge-hottub {
    background-color: #17a2b8;
}

.badge-toboggan {
    background-color: #dc3545;
}

.pool-actions {
    margin-top: 8px;
    display: grid;
    gap: 8px;
}

/* Bootstrap button styles for map popup - ensuring proper styling */
.pool-popup .btn {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    font-family: var(--bs-btn-font-family);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    background-color: transparent;
    transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.pool-popup .btn-primary {
    color: #fff;
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.pool-popup .btn-primary:hover {
    color: #fff;
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

.pool-popup .btn-primary:focus,
.pool-popup .btn-primary:active {
    color: #fff;
    background-color: #0a58ca;
    border-color: #0a53be;
    box-shadow: 0 0 0 0.25rem rgba(49, 132, 253, 0.5);
}

.pool-popup .btn-outline-success {
    color: #198754;
    background-color: transparent;
    border-color: #198754;
}

.pool-popup .btn-outline-success:hover {
    color: #fff;
    background-color: #198754;
    border-color: #198754;
}

.pool-popup .btn-outline-success:focus,
.pool-popup .btn-outline-success:active {
    color: #fff;
    background-color: #198754;
    border-color: #146c43;
    box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.5);
}

.pool-popup .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.25rem;
}

/* Filter Styles */
.map-filter-group {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.map-filter-item {
    display: block;
    margin-bottom: 0.5rem;
    cursor: pointer;
    font-size: 14px;
}

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

.map-filter-checkbox {
    margin-right: 0.5rem;
}

.map-filter-label {
    color: #495057;
}

.map-filter-item:hover .map-filter-label {
    color: #007bff;
}

/* New Button-style Filters */
.filter-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background-color: #fff;
    color: #495057;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    user-select: none;
}

.filter-btn:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    color: #495057;
    text-decoration: none;
}

.filter-btn.active {
    background-color: #007bff;
    border-color: #007bff;
    color: #fff;
}

.filter-btn.active:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    color: #fff;
}

@media (max-width: 768px) {
    .filter-buttons {
        gap: 0.25rem;
    }
    
    .filter-btn {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
}

/* Map Container Styles */
.map-container {
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#map {
    border-radius: 8px;
}

#homepage-map {
    height: 400px;
    border-radius: 8px;
}

#pool-map {
    height: 300px;
    border-radius: 8px;
}

/* Custom Pool Popup Modal */
.pool-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: none;
}

.pool-popup-modal {
    position: absolute;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}

.pool-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
    position: sticky;
    top: 0;
    background: white;
    border-radius: 12px 12px 0 0;
}

.pool-popup-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pool-popup-close:hover {
    color: #333;
}

.pool-popup-body {
    padding: 1.5rem;
}

/* Mobile: Fullscreen popup */
@media (max-width: 768px) {
    .pool-popup-modal {
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        max-height: 100vh;
    }
    
    .pool-popup-header {
        border-radius: 0;
    }
}

/* Desktop: Centered modal */
@media (min-width: 769px) {
    .pool-popup-modal {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 500px;
        max-height: 80vh;
    }
}

/* Enhanced pool popup content */
.pool-popup-content {
    min-width: auto;
}

.pool-popup-content .pool-image-container {
    position: relative;
    overflow: hidden;
    height: 200px;
    margin: -1.5rem -1.5rem 1.5rem -1.5rem;
    border-radius: 12px 12px 0 0;
}

@media (max-width: 768px) {
    .pool-popup-content .pool-image-container {
        height: 250px;
        margin-top: 0;
        border-radius: 0;
    }
}

.pool-popup-content .pool-popup-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pool-popup-content .pool-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 1rem;
}

.pool-popup-content .pool-description {
    font-size: 1rem;
    color: #666;
    margin: 1rem 0;
    line-height: 1.6;
}

.pool-popup-content .pool-badges {
    margin: 1.5rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pool-popup-content .pool-actions {
    margin-top: 2rem;
    display: grid;
    gap: 1rem;
}

@media (min-width: 769px) {
    .pool-popup-content .pool-actions {
        grid-template-columns: 1fr 1fr;
    }
}