body {
    padding: 0;
    margin: 0;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

#map {
    height: 100vh !important;
    width: 100vw;
    min-height: 500px;
}

.hidden-icon {
    display: none;
}

/* Marker cluster customization */
.marker-cluster-small {
    background-color: rgba(181, 226, 140, 0.8);
    border: 2px solid rgba(110, 204, 57, 0.8);
}

.marker-cluster-medium {
    background-color: rgba(241, 211, 87, 0.8);
    border: 2px solid rgba(240, 194, 12, 0.8);
}

.marker-cluster-large {
    background-color: rgba(253, 156, 115, 0.8);
    border: 2px solid rgba(241, 128, 23, 0.8);
}

.marker-cluster div {
    color: #333;
    font-weight: bold;
    font-size: 12px;
}

/* Custom popup styling */
.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 10px;
}

.popup-buttons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.leaflet-popup-content h3 {
    margin: 0;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
    flex: 1;
    font-size: 16px;
    line-height: 1.3;
}

.nav-button {
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-button:hover {
    background-color: #229954;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
}

.details-button {
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.details-button:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
}

.nav-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.report-button {
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.report-button:hover {
    background-color: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
}

.report-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.leaflet-popup-content p {
    margin: 5px 0;
    line-height: 1.4;
}

.leaflet-popup-content b {
    color: #2c3e50;
}

/* Review links styling */
.leaflet-popup-content .review-link {
    color: #3498db;
    text-decoration: none;
    border-bottom: 1px dotted #3498db;
    transition: all 0.3s ease;
    font-weight: 500;
}

.leaflet-popup-content .review-link:hover {
    color: #2980b9;
    border-bottom-style: solid;
    background-color: rgba(52, 152, 219, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
}

/* Popup width optimization */
.leaflet-popup-content {
    min-width: 250px;
    max-width: 300px;
}

/* Mobile responsive adjustments */
@media (max-width: 480px) {
    .leaflet-popup-content {
        min-width: 220px;
        max-width: 280px;
    }
    
    .popup-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .popup-buttons {
        display: flex;
        justify-content: flex-end;
        gap: 6px;
        margin-top: 5px;
    }
    
    .nav-button, .report-button {
        font-size: 11px;
        padding: 5px 10px;
    }
    
    .leaflet-popup-content h3 {
        font-size: 15px;
        margin-bottom: 5px;
    }
}

/* Locate button for mobile devices */
.locate-button {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background-color: #3498db;
    color: white;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    display: none; /* Hidden by default, will be shown on mobile */
    display: flex;
    align-items: center;
    justify-content: center;
}

.locate-button:hover {
    background-color: #2980b9;
    transform: scale(1.1);
}

.locate-button:active {
    transform: scale(0.95);
}

.locate-button.locating {
    background-color: #f39c12;
    animation: pulse 1s infinite;
}

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

/* Show locate button only on mobile devices */
@media (max-width: 768px), (hover: none) {
    .locate-button {
        display: block;
    }
}

/* Leaflet layers control styling */
.leaflet-control-layers {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.leaflet-control-layers-expanded {
    padding: 10px;
    min-width: 160px;
}

.leaflet-control-layers label {
    font-weight: 500;
    margin: 5px 0;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: color 0.3s ease;
}

.leaflet-control-layers label:hover {
    color: #3498db;
}

.leaflet-control-layers input[type="radio"] {
    margin-right: 8px;
    transform: scale(1.1);
}

.leaflet-control-layers-toggle {
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTMgNEgxNFY2SDNWNFoiIGZpbGw9IiMzMzMiLz4KPHA+ath ZD0iTTMgMTBIMTRWMTJIM1YxMFoiIGZpbGw9IiMzMzMiLz4KPHA+ath ZD0iTTMgMTZIMTRWMThIM1YxNloiIGZpbGw9IiMzMzMiLz4KPC9zdmc+');
    width: 36px;
    height: 36px;
    background-size: 18px;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* User location marker styles */
.user-location-marker {
    background: none !important;
    border: none !important;
}

.user-location-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #3498db;
    border: 3px solid white;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.6);
    animation: locationPulse 2s infinite;
}

@keyframes locationPulse {
    0% {
        box-shadow: 0 0 10px rgba(52, 152, 219, 0.6);
    }
    50% {
        box-shadow: 0 0 20px rgba(52, 152, 219, 0.8);
    }
    100% {
        box-shadow: 0 0 10px rgba(52, 152, 219, 0.6);
    }
} 

/* 篩選控制面板樣式 - 類似圖層控制 */
.filter-control-panel {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    min-width: auto;
    max-width: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 篩選控制按鈕 - 類似圖層控制切換按鈕 */
.filter-control-toggle {
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE1LjUgMTRoLS43OWwtLjI4LS4yN0MxNS40MSAxMi41OSAxNiAxMS4xMSAxNiA5LjVDMTYgNS45MSAxMy4wOSAzIDkuNSAzUzMgNS45MSAzIDkuNVM1LjkxIDE2IDkuNSAxNmMxLjYxIDAgMy4wOS0uNTkgNC4yMy0xLjU3bC4yNy4yOHYuNzlsNSA0Ljk5TDIwLjQ5IDE5bC00Ljk5LTV6TTkuNSAxNGMtMi40OSAwLTQuNS0yLjAxLTQuNS00LjVzMi4wMS00LjUgNC41LTQuNSA0LjUgMi4wMSA0LjUgNC41LTIuMDEgNC41LTQuNSA0LjV6IiBmaWxsPSIjMzMzIi8+Cjwvc3ZnPg==');
    width: 36px;
    height: 36px;
    background-size: 20px;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    background-repeat: no-repeat;
    background-position: center;
    transition: all 0.2s ease;
}

.filter-control-toggle:hover {
    background-color: rgba(255, 255, 255, 1);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 篩選面板內容 - 預設隱藏 */
.filter-content {
    display: none;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 10px;
    min-width: 280px;
    max-width: 350px;
    margin-top: 8px;
}

/* 當篩選面板展開時顯示內容 */
.filter-control-expanded .filter-content {
    display: block;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}

.filter-header h4 {
    margin: 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    flex: 1;
}

.filter-description {
    margin-bottom: 16px;
    padding: 8px 12px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 6px;
    border-left: 3px solid #3498db;
}

.filter-description p {
    margin: 0;
    color: #2980b9;
    font-size: 12px;
    line-height: 1.4;
}

.filter-header-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.filter-clear-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.filter-clear-btn:hover {
    background: #ff5252;
}

.filter-sections {
    max-height: 500px;
    overflow-y: auto;
}

.filter-section {
    margin-bottom: 20px;
}

.filter-section h5 {
    margin: 0 0 12px 0;
    color: #555;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-option {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fafafa;
}

.filter-option:hover {
    border-color: #007bff;
    background: #f0f8ff;
}

.filter-option input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.1);
    accent-color: #007bff;
}

.filter-option input[type="checkbox"]:checked + .filter-icon + .filter-label {
    color: #007bff;
    font-weight: 500;
}

.filter-option:has(input[type="checkbox"]:checked) {
    border-color: #007bff;
    background: #e3f2fd;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
}

.filter-icon {
    margin-right: 8px;
    font-size: 16px;
}

.filter-label {
    font-size: 13px;
    color: #333;
    font-weight: 400;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .filter-control-panel {
        min-width: 260px;
        max-width: 300px;
        right: 10px !important;
        top: 10px !important;
        left: auto !important;
    }
    
    .filter-control-expanded {
        padding: 8px;
    }
    
    .filter-option {
        padding: 6px 10px;
    }
    
    .filter-label {
        font-size: 12px;
    }
    
    .filter-header h4 {
        font-size: 14px;
    }
}

/* 篩選結果計數 */
.filter-results {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #007bff;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
}

/* 手機版特別優化 */
@media (max-width: 480px) {
    .filter-control-panel {
        right: 8px !important;
        top: 8px !important;
        min-width: 240px;
        max-width: 280px;
    }
    
    .filter-control-toggle {
        width: 40px;
        height: 40px;
        background-size: 22px;
    }
    
    .filter-content {
        min-width: 240px;
        max-width: 280px;
        padding: 8px;
    }
}

/* 用戶位置標記樣式 */
.user-location-marker {
    background-color: #4285f4;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.user-location-pulse {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #4285f4;
    opacity: 0.3;
    animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.3;
    }
    70% {
        transform: scale(3);
        opacity: 0;
    }
    100% {
        transform: scale(3);
        opacity: 0;
    }
} 