.map-wrapper {
    height: 400px;
    position: relative;
    transition: height 0.5s ease-in-out;
}
#map {
    width: 100%;
    height: 100%;
}
/* Hide the infowindow close button */
.gm-style-iw-chr {display: none;}
/* Add little triangle under infowindow */
.gm-style .gm-style-iw-tc::after {
    background: #fff;
    -webkit-clip-path: polygon(0 0, 50% 100%, 100% 0);
    clip-path: polygon(0 0, 50% 100%, 100% 0);
    content: "";
    height: 12px;
    left: 0;
    position: absolute;
    top: -1px;
    width: 25px;
}
/* Remove weird google maps styles */
.gm-style .gm-style-iw-d {
    overflow: hidden !important;
    max-height: 1000px !important;
}
.gm-style .gm-style-iw-c {
    padding: 0px !important;
}
/* Style for the tooltip container */
.event-tooltip {
    position: relative;
    background: #fff;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
	max-height: 180px;
    overflow: auto;
}
.mapboxgl-popup.mapboxgl-popup-anchor-top, .mapboxgl-popup.mapboxgl-popup-anchor-bottom {
    max-width: 300px !important;
    z-index: 99999;
}
/* Style for the close button */
#close-tooltip {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background-color: #ff5c5c;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    line-height: 20px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
}
/* Style for the event tooltip card */
.event-tooltip-card {
    width: 100%;
    padding: 12px;
}
.event-tooltip-card a {
    outline: none;
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 10px !important;
    text-decoration: none !important;
    width: 100% !important;
}
/* Style for the event image */
.event-tooltip-image {
    display: block !important;
    width: 50px !important;
    height: 50px !important;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0 !important;
}
/* Style for the tooltip information */
/* .event-tooltip-info {
    display: inline-block;
    width: 73%;
    vertical-align: top;
} */

/* Info column: name on top, bottom row below */
.tooltip-info {
    display: flex !important;
    flex-direction: column !important;
    gap: 1px;
    flex: 1 !important;
    min-width: 0;
}
/* Bottom row: city/state on left, date box on right */
.tooltip-bottom {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
/* City, state */
.event-tooltip-location {
    font-size: 13px;
    color: #7A7A7A;
    margin: 0;
}
/* Date box */
.tooltip-date-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #e9ecef;
    border-radius: 8px;
    padding: 4px 8px;
    min-width: 40px;
    line-height: 1.2;
}
.tooltip-date-month {
    font-size: 11px;
    color: #555;
}
.tooltip-date-day {
    font-size: 14px;
    font-weight: bold;
    color: #333;
}
/* Title styling */
.event-tooltip-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin: 0;
}
/* Date styling (legacy) */
.event-tooltip-date {
    font-size: 14px;
    color: #777;
    margin: 0;
}
button.mapboxgl-popup-close-button {
    background: #ff6565;
    color: #fff;
    font-size: 20px;
    padding: 0 4px;
}
.mapboxgl-popup-close-button:hover {
    background: red;
}
.map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Dark overlay color */
    transition: opacity 0.5s ease-in-out;
    opacity: 0;
    pointer-events: none; 
    z-index: 20;
}
.map-wrapper.shrink .map-overlay {
    opacity: 1;
}
.view-switcher {
    position: absolute;
    z-index: 99999;
    background-color: #fff;
    display: flex;
    flex-direction: row;
    top: 10px;
    right: 50%;
    transform: translateX(50%);
    border-radius: 999px;
    padding: 4px;
}
.view-switcher-btn {
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 999px;
    text-transform: uppercase;
    padding: 10px 18px;
}
.view-switcher-btn.active {
    /* background-color: #02A67F; */
    background-color: #a4d577;
    color: #fff;
}
.view-switcher-left {
    padding: 10px;
}
.view-switcher-right {
    padding: 10px;
}
.events-wrapper {
    margin-top: 10px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    /* gap: 20px !important; */
    gap: 16px !important;
    justify-content: center;
}
.event-card {
 	flex: 1 1 300px;
    /* max-width: 400px; */
    max-width: 336px;
    height: auto; 
    /*
    flex-basis: 300px;
    flex-grow: 1;
    */
    border: 1px solid #dee2e6;
    border-radius: 15px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.event-image {
    width: 100%;
    /* aspect-ratio: 16 / 9; */
    height: 181px;
    background-color: #ccc;
    /* background-size: cover;
    background-position: center;
    background-repeat: no-repeat;*/
}
/* .event-name {
    font-size: 20px;
    min-height: 60px;
} */
.event-date-right {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
    /* width: 7.5rem;
    height: 6.6rem; */
    width: 50px;
    height: 50px;
    -webkit-border-radius: 0.8rem;
    border-radius: 0.8rem;
    background: #e9ecef;
}
p.event-location {
    padding-top: 0;
    font-size: 14px;
    margin-bottom: 0;
    margin-top: 0;
    color: #7A7A7A;
}
.event-date-right span:first-child {
    font-size: 12px;
}
.event-name {
    font-size: 16px;
    min-height: auto;
    margin-bottom: 0;
}
.event-d {
    display: flex;
    justify-content: space-between;
}
#event-search-form input.btn.btn-primary {
    display: none;
}
#search-input{
    padding: 0 20px 0 65px;
    font-size: 1.1rem;
    border-radius: 40px;
    height: 4rem;
}
.search-wrapper {
    position: relative;
    width: 100%;
}
.search-wrapper .search-icon {
    position: absolute;
    left: 35px;
    top: 50%;
    transform: translateY(-50%);
}
.event-card-info {
    padding: 10px;
    margin-top: 10px;
    flex-grow: 1; 
}
#event-filter-form {
	display: flex;
    flex-direction: row;
    gap: 10px;
}
.page-themes .event-card-info {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px;
    margin-top: 0px;
}
/* .page-themes .event-card {
    min-height: 372px;
} */
.mapboxgl-ctrl-bottom-left {
    display: none;
}
.list-view {
    padding: 15px 15px;
}
.filters { 
    display: flex;
    flex-direction: row;
    gap: 20px;
}
#event-filter-form {
    display: flex;
    flex-direction: row;
    gap: 10px;
}
.form-check {
    width: auto;
    flex: 0 1 auto;
}
/*Group event css start*/
.group-events {
  overflow: auto;
  max-height: 215px; 
  min-width: 220px;
}
.simplebar-content-wrapper:focus-visible {
    outline: none;
}
.custom-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    z-index: 1;
    pointer-events: auto;
}
.marker-container {
    cursor: pointer;
    position: relative;
    width: 45px;
    height: 45px;
    background-image: url('/wp-content/uploads/2025/08/ic-group-location.png');
    background-size: cover;
    display: flex;
    align-items: center;
    justify-content: center;
}
.inner-icon {
    width: 17px;
    height: 17px;
    border-radius: 50%;
    object-fit: cover;
    position: absolute;
    left: 12px;
    top: 12px;
}
.marker-count {
    position: absolute;
    top: 0px;
    right: 0px;
    background-color: #02A67F;
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 12px;
    box-shadow: 0 0 2px rgba(0,0,0,0.5);
}
/*Group event css end*/
/* Make the form-check elements 100% width only after 768px */
@media (max-width: 768px) {
    .view-switcher {
        min-width: 210px;
    }
    .event-card {
        max-width: 100%;
        flex: 2 2 150px;
    }
    /* #events-container {
        min-height: 1200px;
    } */

    /* Mobile Placeholder (Critical for GTmetrix) */
    /* #events-container:empty {
        min-height: 10px; 
    } */

    #events-container.is-loading {
        min-height: 600px; /* Mobile space reserved */
    }
    .event-name {
        min-height: auto;
        font-size: 16px;
    }
    .event-image {
        height: auto;
    }
	.event-tooltip {
      width: unset !important;
      max-height: 195px;
    }
    .form-check {
        width: 100%;
    }
    #event-filter-form {
        flex-direction: column;
    }
    .event-tooltip:focus-visible,.group-events:focus-visible, .simplebar-wrapper:focus-visible,.gm-style .gm-style-iw:focus-visible {
        outline: 0px;
    }
    .event-tooltip-card a {
        display: flex !important;
        flex-direction: row !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }
    .event-tooltip-image {
        display: block !important;
        width: 50px !important;
        height: 50px !important;
        flex-shrink: 0 !important;
    }
    .tooltip-info {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 !important;
        min-width: 0 !important;
    }
    .tooltip-bottom {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
    }
    .tooltip-date-box {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        flex-shrink: 0 !important;
    }
}
@media (max-width: 430px){
    .group-events {  
        min-width: 250px;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .map-wrapper {
        height: 450px;
    }
}
/* @media screen and (min-width: 1600px) and (max-width: 1920px) {
    .event-card {
        flex: 1 1 380px;
        max-width: 380px;
    }
} */
@media screen and (min-width: 1600px) and (max-width: 1920px) {
    .events-wrapper {
        display: flex;
        flex-wrap: wrap;
        gap: 16px;
        justify-content: center;
    }
    
    .event-card {
        flex: 0 0 calc(25% - 16px);
        max-width: calc(25% - 16px);
        border: 1px solid #dee2e6;
        border-radius: 15px;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    .event-image {
        width: 100%;
        height: 220px;
        object-fit: cover;
        display: block;
    }
}