/* SOAF Location Map Block - Frontend Styles */

.soaf-location-map {
    position: relative;
}

.soaf-location-map-container {
    width: 100%;
    background-color: #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.soaf-location-map-container.clickable {
    cursor: pointer;
}

.soaf-location-map-container.clickable:hover {
    opacity: 0.95;
    transition: opacity 0.2s ease;
}

/* Ensure map fills container properly */
.soaf-location-map-container > div {
    width: 100% !important;
    height: 100% !important;
}

/* Loading state */
.soaf-location-map-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
    color: #6c757d;
}

/* Error state */
.soaf-location-map-error {
    padding: 20px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
    text-align: center;
    font-size: 14px;
}

/* Responsive behavior */
@media (max-width: 768px) {
    .soaf-location-map-container {
        min-height: 250px;
    }
}

/* Ensure proper z-index for map controls */
.soaf-location-map-container .gm-style > div {
    z-index: 1;
}

/* Custom marker styling adjustments */
.soaf-location-map-container .gm-style img[src*="marker"] {
    max-width: none !important;
}

/* Google Maps Info Window Custom Styling */
.gm-style .gm-style-iw-c {
    background: var(--wp--preset--color--primary, #1a73e8) !important;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 0 !important;
}

.gm-style .gm-style-iw-d {
    overflow: auto !important;
}

.gm-style .gm-style-iw {
    background: var(--wp--preset--color--primary, #1a73e8) !important;
    border-radius: 8px;
    font-family: var(--wp--preset--font-family--system-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
}

/* Info Window Content */
.gm-style .gm-style-iw-c .gm-style-iw-d {
    color: #fff !important;
}

.gm-style .gm-style-iw-c .gm-style-iw-d * {
    color: #fff !important;
}

/* Close Button Styling - More aggressive approach */
.gm-style .gm-style-iw button img {
    filter: brightness(0) invert(1) !important;
}

/* Additional close button selectors */
.gm-style .gm-style-iw-chr > button {
    background: transparent;
    opacity: 0.9;
}

.gm-style .gm-style-iw-chr > button:hover {
    opacity: 1;
    background: rgba(255,255,255,0.1);
}

.gm-style .gm-style-iw-chr > button img {
    filter: brightness(0) invert(1) !important;
}

.gm-style .gm-style-iw .gm-ui-hover-effect img {
    filter: brightness(0) invert(1) !important;
}

/* Super specific close button targeting */
.gm-style-iw button[jsaction*="closeclick"] img,
.gm-style-iw button[title="Close"] img,
.gm-style-iw [role="button"] img,
.gm-style-iw .gm-style-iw-chr button img,
.gm-style .gm-style-iw-c button img {
    filter: brightness(0) invert(1) !important;
    opacity: 1;
}

/* Universal image filter in info windows */
.gm-style .gm-style-iw img[src*="close"],
.gm-style .gm-style-iw img[src*="cross"],
.gm-style .gm-style-iw img[alt="Close"],
.gm-style .gm-style-iw img[alt="close"] {
    filter: brightness(0) invert(1) !important;
}

/* CSS content replacement for close button */
.gm-style .gm-style-iw-chr > button::before {
    content: "×" !important;
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

/* Info Window Tail/Arrow - Correct targeting */
.gm-style .gm-style-iw-t {
    background: var(--wp--preset--color--primary, #1a73e8) !important;
}

.gm-style .gm-style-iw-tc {
    background: transparent !important;
    filter: none;
}

.gm-style .gm-style-iw-tc::after {
    background: var(--wp--preset--color--primary, #1a73e8) !important;
}

/* Target the arrow shadow/background more specifically */
.gm-style .gm-style-iw-t[style*="background-color"] {
    background-color: var(--wp--preset--color--primary, #1a73e8) !important;
}

/* Override any dark arrow backgrounds */
.gm-style .gm-style-iw div[style*="background-color: rgb(68, 68, 68)"],
.gm-style .gm-style-iw div[style*="background-color: rgb(60, 64, 67)"],
.gm-style .gm-style-iw div[style*="background-color: rgba(60, 64, 67"] {
    background-color: transparent !important;
}

/* Alternative: Target the arrow container that has the dark background */
.gm-style .gm-style-iw > div:last-child {
    background: transparent;
}

.gm-style .gm-style-iw > div:last-child > div {
    background: var(--wp--preset--color--primary, #1a73e8);
}

/* Ensure links are visible */
.gm-style .gm-style-iw-c a {
    color: #fff !important;
    text-decoration: underline;
}

.gm-style .gm-style-iw-c a:hover {
    color: rgba(255,255,255,0.8);
}

/* Typography */
.gm-style .gm-style-iw-c {
    font-family: var(--wp--preset--font-family--system-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    font-size: 14px;
    line-height: 1.4;
} 