/* Main Container */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,500;1,14..32,500&display=swap');

.cptmaps-advanced-container {
    font-family: "Inter", sans-serif;
    font-optical-sizing: auto;
    font-weight: 500;
    font-style: normal;
    color: #474a53;
    max-width: 972px;
/*     margin: 0 auto; */
    padding: 0px;
}

/* Filters Section */

input#cptmaps-search-input {
	font-family: "Inter", sans-serif;
    font-weight: 500;
    font-style: normal;
	font-size: 14px;
    color: #474a53;
    width: 100%;
    padding: 10px 15px;
/*     border: 2px solid #e9ecef; */
/*     border-radius: 8px; */
    font-size: 14px;
    background: white;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
/*     transition: border-color 0.3s; */
    height: 40px;
    margin-bottom: 15px;
	max-width: 632px;
}

input#cptmaps-search-input:hover {
    border-color: #ced4da;
}

input#cptmaps-search-input:active {
    border-color: #474a53;
    box-shadow: 0 0 0 3px rgba(77, 171, 247, 0.1);
}


.cptmaps-filters-section {
/*     background: #f8f9fa; */
    border-radius: 12px;
    padding: 0px;
    margin-bottom: 25px;
/*     box-shadow: 0 2px 8px rgba(0,0,0,0.08); */
}

.cptmaps-filters-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #474a53;
    font-size: 1.3em;
}

.cptmaps-filters-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 15px;
    align-items: start;
}

@media (max-width: 768px) {
    .cptmaps-filters-grid {
        grid-template-columns: 1fr;
		gap: 5px;
    }
}

.cptmaps-filter-group {
    margin: 0;
    position: relative;
}

/* Dropdown Checkbox Styles */
.cptmaps-dropdown-checkbox {
    position: relative;
    width: 100%;
}

.cptmaps-dropdown-toggle {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #f2f3f5;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
/*     transition: border-color 0.3s; */
}

.cptmaps-dropdown-toggle:hover {
    border-color: #ced4da;
}

.cptmaps-dropdown-toggle.active {
    border-color: #474a53;
/*     box-shadow: 0 0 0 3px rgba(77, 171, 247, 0.1); */
}

.cptmaps-dropdown-label {
    font-family: "Inter", sans-serif;
    font-optical-sizing: auto;
    font-weight: 500;
    font-style: normal;   
    color: #474a53;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.cptmaps-dropdown-toggle.active .cptmaps-dropdown-label {
    font-family: "Inter", sans-serif;
    color: #474a53;
    font-weight: 500;
}

.cptmaps-dropdown-arrow {
    color: #6c757d;
    font-size: 10px;
    margin-left: 10px;
    transition: transform 0.3s;
}

.cptmaps-dropdown-toggle.active .cptmaps-dropdown-arrow {
    transform: rotate(180deg);
    color: #474a53;
}

.cptmaps-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-top: 5px;
    z-index: 1000;
    display: none;
    max-height: 300px;
    overflow: hidden;
}

.cptmaps-dropdown-menu.show {
    display: block;
}

.cptmaps-dropdown-search {
    padding: 10px;
    border-bottom: 1px solid #e9ecef;
}

.cptmaps-dropdown-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 13px;
}

.cptmaps-dropdown-search-input:focus {
    outline: none;
    border-color: #4dabf7;
}

.cptmaps-checkbox-options {
    max-height: 200px;
    overflow-y: auto;
    padding: 10px 0;
}

.cptmaps-checkbox-option {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.cptmaps-checkbox-option:hover {
    background-color: #f8f9fa;
}

.cptmaps-checkbox-option input[type="checkbox"] {
    margin-right: 10px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.cptmaps-checkbox-label {
    font-size: 14px;
    color: #474a53;
    cursor: pointer;
    flex: 1;
}

.cptmaps-checkbox-option input[type="checkbox"]:checked + .cptmaps-checkbox-label {
    color: #474a53;
    font-weight: 500;
}

.cptmaps-dropdown-actions {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.cptmaps-select-all,
.cptmaps-clear-all {
    background: none;
    border: none;
    color: #474a53;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.cptmaps-select-all:hover,
.cptmaps-clear-all:hover {
    background-color: #e9ecef;
}

/* Active Filters Display */
.cptmaps-active-filters {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

.cptmaps-active-filters-header {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 8px;
    font-weight: 500;
}

.cptmaps-active-filters-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cptmaps-filter-tag {
    background: #e9ecef;
    color: #474a53;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.cptmaps-filter-tag-remove {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
}

.cptmaps-filter-tag-remove:hover {
    opacity: 1;
}

.cptmaps-filter-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: flex-end;
    margin-top: 5px;
}

.cptmaps-results-count {
    font-size: 14px;
    color: #6c757d;
    white-space: nowrap;
}

.cptmaps-results-count #cptmaps-active-count {
    font-weight: 500;
    color: #474a53;
    font-size: 1.2em;
}

.cptmaps-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.cptmaps-btn-secondary {
    font-family: "Inter", sans-serif;
    background: none;
    color: #474a53;
    text-decoration: underline;
}

.cptmaps-btn-secondary:hover {
    background: #dee2e6;
    transform: translateY(-1px);
}

/* Main Content Layout */


.cptmaps-popup-description p{
	margin-bottom: 10px;
}

a.wp-simple-butto-maps {
    font-family: "Inter", sans-serif;
    background: #fc4d03;
    color: #fff;
    padding: 4px 13px 4px 13px;
    border-radius: 5px;
    font-size: 11px;
}

a.wp-simple-butto-maps:hover{
	color: #fff;
}

.cptmaps-main-content {
    display: grid;
    grid-template-columns: 500px 1fr;
    gap: 25px;
    min-height: 600px;
}

@media (max-width: 1024px) {
    .cptmaps-main-content {
        grid-template-columns: 1fr;
    }
    
    .cptmaps-locations-sidebar.collapsed {
        position: fixed;
        left: -300px;
        top: 0;
        bottom: 0;
        z-index: 1000;
        box-shadow: 5px 0 15px rgba(0,0,0,0.1);
        transition: left 0.3s ease;
    }
    
    .cptmaps-locations-sidebar.collapsed.show {
        left: 0;
    }
    
    .cptmaps-sidebar-toggle {
        display: block !important;
    }
}

/* Sidebar Styles */
.cptmaps-locations-sidebar {
    background: white;
    border-radius: 12px;
    padding: 0;
/*     box-shadow: 0 2px 8px rgba(0,0,0,0.1); */
    display: flex;
    flex-direction: column;
    height: 647px;
    transition: all 0.3s ease;
}

.cptmaps-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid #f8f9fa;
}

.cptmaps-sidebar-header h4 {
    margin: 0;
    color: #474a53;
    font-size: 1.2em;
}

.cptmaps-sidebar-toggle {
    display: none;
    cursor: pointer;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 8px;
    transition: background 0.3s;
}

.cptmaps-sidebar-toggle:hover {
    background: #e9ecef;
}

.cptmaps-locations-list {
    flex: 1;
    overflow-y: auto;
    padding: 0px;
    display: flex;
    flex-direction: column;
    gap: 15px;
	padding-top: 0;
}

/* Location Item */
.cptmaps-location-item {
/*     background: #f8f9fa; */
    border-radius: 10px;
    padding: 15px;
    border: 1px solid #f2f3f5;
    transition: all 0.3s;
    cursor: pointer;
	max-width: 350px;
}

.cptmaps-location-item:hover {
    border-color: #e3e3e3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(77, 171, 247, 0.15);
}

.cptmaps-location-item.active {
    border-color: #e3e3e3;
    background: #f3f3f378;
}

.cptmaps-location-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.cptmaps-location-header h5 {
    margin: 0;
    font-size: 14px;
    color: #474a53;
    flex: 1;
    line-height: 20px;
}

.cptmaps-location-badge {
    background: #e9ecef;
    color: #474a53;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    margin-left: 0px;
    white-space: nowrap;
}

.cptmaps-location-excerpt {
    font-size: 13px;
    color: #6c757d;
    line-height: 1.4;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cptmaps-location-sectors {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
/*     justify-content: space-between; */
}

.cptmaps-sector-badge {
    background: #e9ecef;
    color: #474a53;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.cptmaps-location-taxonomies {
    display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
}
span.cptmaps-strategy-badge {
    background: #e9ecef;
    color: #474a53;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    margin-left: 0px;
    white-space: nowrap;
}

.cptmaps-location-title h5 {
    line-height: 20px !important;
    margin-top: 10px;
    margin-bottom: 10px;
}

/* Map Area */
.cptmaps-map-area {
    position: relative;
    background: white;
/*     border-radius: 12px; */
    overflow: hidden;
/*     box-shadow: 0 2px 8px rgba(0,0,0,0.1); */
    height: 647px;
	width:593px;
}

.cptmaps-map-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 500px;
    overflow: auto; /* Changed from 'hidden' */
/*     border-radius: 8px; */
/*     box-shadow: 0 2px 10px rgba(0,0,0,0.1); */
    background: #fff;
}

.cptmaps-map-image {
    position: relative;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.3s ease;
}

#cptmaps-map-image {
    position: relative;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center center; /* Fixed position */
    background-repeat: no-repeat;
    transition: transform 0.3s ease, background-position 0.3s ease; /* Add transition */
}

/* Map Points */
.cptmaps-map-point {

    position: absolute;
    width: 5px;
    height: 5px;
    background: #fff;
    border-radius: 50%;
/*     border: 0px solid white; */
    cursor: pointer;
/*     transform: translate(-50%, -50%); */
/*     transition: all 0.3s; */
/*     box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); */
    z-index: 100;

}

.cptmaps-map-point:hover, 
.cptmaps-map-point.active {
    background: #e54a09;
/*     transform: translate(-50%, -50%) scale(1.3); */
    box-shadow: 0 4px 10px rgb(252 77 3 / 17%);
    z-index: 101;
}

.cptmaps-map-point::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
/*     animation: pulse 2s infinite; */
    transform: translate(-50%, -50%);
    z-index: -1;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* Marker Popup Styles - FIXED POSITIONING */
.cptmaps-marker-popup {
    position: absolute;
    background: white;
    border-radius: 10px;
    padding: 0;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    z-index: 102;
    width: 320px;
    max-height: 200px;
    overflow: hidden;
    display: none;
    animation: popupFadeIn 0.3s ease;
    border: 1px solid #e9ecef;
    /* Position will be set by JavaScript */
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cptmaps-marker-popup.show {
    display: block;
}

.cptmaps-marker-popup::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 12px solid white;
    z-index: 103;
}

/* Popup positioned above marker (default) */
.cptmaps-marker-popup.position-above::after {
    bottom: -10px;
    border-top: 12px solid white;
    border-bottom: none;
}

/* Popup positioned below marker (for bottom markers) */
.cptmaps-marker-popup.position-below {
    top: 35px;
    bottom: auto;
}

.cptmaps-marker-popup.position-below::after {
    bottom: auto;
    top: -10px;
    border-top: none;
    border-bottom: 12px solid white;
}

.cptmaps-marker-popup-header {
    background: #f8f9fa;
    color: #474a53;
    padding: 15px 20px;
    position: relative;
}

.cptmaps-marker-popup-header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    padding-right: 25px;
}

.cptmaps-marker-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #474a53;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    padding: 0;
}

.cptmaps-marker-popup-close:hover {
    background: #474a53;
}

.cptmaps-marker-popup-content {
    padding: 20px;
    max-height: 320px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
}

.cptmaps-marker-popup-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin-bottom: 15px;
}

.cptmaps-marker-popup-content p {
    margin-bottom: 15px;
}

.cptmaps-marker-popup-content p:last-child {
    margin-bottom: 0;
}

.cptmaps-marker-popup-taxonomies {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.cptmaps-marker-popup-badge {
    background: #e9ecef;
    color: #474a53;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.cptmaps-marker-popup-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.cptmaps-marker-popup-actions .cptmaps-btn {
    width: 100%;
    text-align: center;
    padding: 8px 15px;
    font-size: 13px;
}

/* Ensure popup stays within map container */
.cptmaps-marker-popup.edge-adjusted {
    /* JavaScript will calculate exact positioning */
}

/* Loading Indicator */
.cptmaps-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.cptmaps-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #fc4d03;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}


/* Zoom Controls */
.cptmaps-zoom-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 1000; /* Ensure it's above everything */
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cptmaps-zoom-btn {
    width: 36px;
    height: 36px;
    border: 2px solid #7e8187;
    background: white;
    color: #7e8187;
    border-radius: 50%;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.cptmaps-zoom-btn:hover {
    background: #fc4d03;
    color: white;
}

.cptmaps-zoom-btn:active {
    transform: scale(0.95);
}

.cptmaps-zoom-level {
    min-width: 50px;
    text-align: center;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.cptmaps-zoom-reset {
    font-family: "Inter", sans-serif;
    padding: 8px 12px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.cptmaps-zoom-reset:hover {
    background: #e0e0e0;
}

/* Map container needs overflow for zoom */
.cptmaps-map-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    transition: transform 0.3s ease;
}

/* Adjust map points for zoom */
.cptmaps-map-point {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 10;
    transition: transform 0.2s ease;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* No Results */
.cptmaps-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.cptmaps-no-results p {
    margin-bottom: 15px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
	.cptmaps-filters-section {
		padding: 5px;
	}	
	.cptmaps-filter-actions {
		justify-content: flex-start !important;
		margin-top: 5px;
		margin-left: 10px;
	}	
	
	input#cptmaps-search-input {
		margin-bottom: 5px;
	}	
	
	#cptmaps-map-image {
		width: 100%;
		height: 69%;
	}	
    .cptmaps-marker-popup {
        width: 280px;
        max-height: 350px;
    }
	.cptmaps-locations-list {
		padding: 5px;
	}    
	.cptmaps-location-item {
		padding: 5px;
		max-width: 100%;
	}		
    .cptmaps-marker-popup-content {
        max-height: 270px;
    }	
	.cptmaps-location-header {
		margin-bottom: 0px;
	}		
	.cptmaps-location-header h5 {
		font-size: 16px !important;
	}	  
    .cptmaps-advanced-container {
        padding: 0px;
    }  
    .cptmaps-locations-sidebar{
        height: 165px;
    }	
	.cptmaps-map-area{
		height: 500px;
		width: auto;
	}
	.cptmaps-map-container {
		background: #fff;
	}	
	.cptmaps-map-point::after {
		animation: none !important;
	}		
    .cptmaps-zoom-controls {
        bottom: 20px !important;
        left: 20px;
        right: 0 !important;
        flex-direction: row !important;
        align-items: center !important;
        max-width: 177px;
    }
	
}