/* Reset and Scope */
.cm-map-wrapper {
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Custom Marker Styling */
.cm-map-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    justify-content: center;
}

.cm-map-filter-btn {
    padding: 8px 16px;
    background-color: #f0f0f0;
    border: 2px solid transparent;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    transition: all 0.2s ease;
}

.cm-map-filter-btn:hover {
    background-color: #e0e0e0;
}

.cm-map-filter-btn.active {
    background-color: #fff;
    border-color: #0182A4;
    color: #0182A4;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cm-map-marker-icon {
    background-color: transparent;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cm-map-marker-icon img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    filter: drop-shadow(0px 4px 6px rgba(0,0,0,0.4));
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.cm-map-marker-icon:hover img {
    transform: scale(1.15) translateY(-4px);
    filter: drop-shadow(0px 8px 15px rgba(0,0,0,0.5));
}

/* Modal Overlay */
.cm-map-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2147483647;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 60px 20px;
    overflow-y: auto;
    backdrop-filter: blur(4px);
}

/* Modal Content */
.cm-map-modal-content {
    background: #ffffff;
    width: 90%;
    max-width: 650px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    position: relative;
    margin: auto;
    transform: translateY(20px);
    opacity: 0;
    animation: cmMapModalSlideIn 0.3s forwards ease-out;
}

@keyframes cmMapModalSlideIn {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cm-map-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    color: #334155;
    z-index: 10;
    transition: background 0.2s;
}

.cm-map-modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Branding extraction based on the site's colorful approach */
.cm-map-modal-header {
    background: #ffffff;
    border-bottom: 6px solid var(--modal-theme-color, #0182A4);
    padding: 24px;
    text-align: center;
    position: relative;
    flex-shrink: 0;
    transition: border-bottom-color 0.3s;
}

.cm-map-modal-header img {
    width: 100%;
    max-width: 400px;
    height: 160px;
    object-fit: contain;
    margin: 0 auto;
    display: block;
    position: relative;
    z-index: 2;
}

.cm-map-modal-body {
    padding: 24px;
    text-align: center;
    overflow-y: auto;
}

.cm-map-modal-body h3 {
    margin: 0 0 5px 0;
    font-size: 22px;
    color: #333;
}

.cm-map-modal-body p {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 14px;
}

.cm-map-modal-tags {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

#cm-map-modal-category {
    display: inline-block;
    padding: 4px 10px;
    background-color: var(--modal-theme-color, #83BD45);
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    color: #ffffff;
    text-transform: uppercase;
    transition: background-color 0.3s;
}

#cm-map-modal-partner-tag {
    display: inline-block;
    padding: 4px 10px;
    background-color: #0182A4;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    color: #ffffff;
    text-transform: uppercase;
    border: 1px solid rgba(255,255,255,0.2);
}

.cm-map-modal-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.cm-map-modal-links a {
    color: var(--modal-theme-color, #0182A4);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f1f5f9;
    transition: all 0.2s;
}

.cm-map-modal-links a svg {
    width: 20px;
    height: 20px;
}

.cm-map-modal-links a:hover {
    background-color: var(--modal-theme-color, #0182A4);
    color: white;
    transform: translateY(-2px);
}

.cm-map-btn-primary {
    display: block;
    width: 100%;
    padding: 12px 0;
    background-color: var(--modal-theme-color, #0182A4);
    color: white !important;
    text-decoration: none !important;
    border-radius: 8px;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.2s;
}

.cm-map-btn-primary:hover {
    filter: brightness(0.85);
}
