/* 
 * Frontend Styles for Social Lifestyle Distances (Premium Map Overlay v1.4.2)
 */

 :root {
    --sld-primary: #149246;
    --sld-primary-light: rgba(20, 146, 70, 0.1);
    --sld-bg-glass: rgba(255, 255, 255, 0.35); /* Increased transparency */
}

.sld-container {
    position: relative;
    width: 100%;
    margin: 20px 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0,0,0,0.05);
    background: transparent;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.sld-map-area {
    width: 100%;
}

#sld-map {
    width: 100%;
    height: 500px;
    background-color: #f8f9fa;
}

/* Sidebar Overlay Styles (Glassmorphism) */
.sld-sidebar-area {
    position: absolute;
    top: 20px;
    right: 20px;
    bottom: 20px;
    width: 340px;
    background: var(--sld-bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    z-index: 10;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.4);
}

.sld-sidebar-title {
    margin: 0;
    padding: 20px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #2d3748;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    background: rgba(255,255,255,0.5);
}

.sld-poi-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-y: auto;
    flex-grow: 1;
}

/* Custom scrollbar for list */
.sld-poi-list::-webkit-scrollbar {
    width: 6px;
}
.sld-poi-list::-webkit-scrollbar-track {
    background: transparent;
}
.sld-poi-list::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.15);
    border-radius: 10px;
}

.sld-poi-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    cursor: pointer;
    transition: all 0.3s ease;
}

.sld-poi-item:hover {
    background: rgba(255,255,255,0.4);
}

.sld-poi-item.active {
    background: rgba(255,255,255,0.7);
    border-left: 4px solid var(--sld-primary);
    padding-left: 16px;
}

.sld-item-img {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    object-fit: cover;
    margin-right: 15px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.sld-item-icon {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    background: #ffffff; /* Make icon background white for contrast against glass */
    color: var(--sld-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.sld-item-icon svg {
    width: 22px;
    height: 22px;
}

.sld-item-details h4 {
    margin: 0 0 4px 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a202c;
}

.sld-item-meta {
    font-size: 0.8rem;
    color: #4a5568;
}

/* Premium InfoWindow Styles */
.gm-style .gm-style-iw-c {
    padding: 0 !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
}

.gm-style .gm-style-iw-d {
    overflow: hidden !important;
    padding: 0 !important; /* Remove internal padding */
}

/* Hide Native Google Close Button completely and robustly */
.gm-style-iw-c > button,
.gm-style-iw-c button,
.gm-ui-hover-effect {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
}

/* Our Custom Inline Close Button (Using SPAN to bypass theme button styling) */
span.sld-custom-close {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    background: transparent !important;
    border: none !important;
    font-size: 24px !important;
    line-height: 1 !important;
    color: #a0aec0 !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin: 0 !important;
    transition: color 0.2s ease;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 24px !important;
    height: 24px !important;
    border-radius: 50% !important;
    box-shadow: none !important;
    z-index: 9999 !important;
}

span.sld-custom-close:hover {
    color: #e53e3e !important;
}

.sld-info-window-premium {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    min-width: 240px;
}

.sld-info-image-wrap {
    width: 100%;
    height: 130px;
    overflow: hidden;
}

.sld-info-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sld-info-body {
    padding: 16px 20px 20px 20px;
}

.sld-info-header {
    padding: 20px 20px 20px 20px;
    text-align: left;
}

.sld-info-title {
    margin: 0 0 12px 0 !important;
    font-size: 1.1rem !important;
    color: #1a202c !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    padding-right: 40px !important; /* Ensure text doesn't overlap the absolute close button */
    box-sizing: border-box !important;
}

.sld-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--sld-primary);
    color: #fff;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.sld-info-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sld-stat {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: #4a5568;
    background: #f7fafc;
    padding: 8px 12px;
    border-radius: 6px;
}

.sld-stat svg {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    color: var(--sld-primary);
}

.sld-error {
    background-color: #fff5f5;
    color: #c53030;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #f56565;
    font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sld-container {
        display: flex;
        flex-direction: column;
    }
    
    .sld-map-area {
        height: 350px;
    }
    
    #sld-map {
        height: 350px;
    }

    .sld-sidebar-area {
        position: relative;
        top: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        border-radius: 0 0 12px 12px;
        max-height: 400px;
        border: none;
        border-top: 1px solid rgba(0,0,0,0.05);
        box-shadow: none;
        background: #ffffff; /* Remove transparency on mobile */
        backdrop-filter: none; /* Remove blur on mobile */
        -webkit-backdrop-filter: none;
    }

    /* Make close button smaller on mobile */
    span.sld-custom-close {
        font-size: 18px !important;
        width: 20px !important;
        height: 20px !important;
    }
    
    .sld-info-window-premium h3 {
        font-size: 1rem;
    }
    
    .sld-info-body {
        padding: 12px 15px 15px 15px;
    }
}
