/* Frontend Styles for Interactive Map */

.imap-frontend {
    padding: 20px 0;
}

/* Map display */
.imap-map-display {
    position: relative;
}

.imap-map-display .imap-map-wrapper {
    position: relative;
    width: 100%;
}

.imap-map-display .imap-svg-img {
    display: block;
    width: 100%;
    height: auto;
}

/* Pins */
.imap-pin {
    position: absolute;
    width: 23px;
    height: 28px;
    transform: translate(-50%, -100%);
    cursor: pointer;
    z-index: 10;
    transition: transform 0.2s ease, filter 0.2s ease;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.35));
}

.imap-pin-icon {
    display: block;
    width: 100%;
    height: 100%;
}

.imap-pin:hover,
.imap-pin.active {
    transform: translate(-50%, -100%) scale(1.3);
    filter: drop-shadow(0 3px 8px rgba(0,0,0,0.5));
    z-index: 20;
}

/* Tooltip */
.imap-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    color: #000;
    padding: 16px 16px 22px;
    border-radius: 6px;
    font-size: 13px;
    white-space: normal;
    width: 260px;
    margin-bottom: 12px;
    pointer-events: auto;
    z-index: 30;
    box-shadow: 0 4px 16px rgba(0,0,0,0);
}

.imap-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #fff;
}

.imap-pin:hover .imap-tooltip,
.imap-pin.active .imap-tooltip {
    display: block;
}

/* Tooltip image */
.imap-tooltip-image {
    margin: -16px -16px 10px -16px;
    border-radius: 6px 6px 0 0;
    overflow: hidden;
}

.imap-tooltip-image img {
    display: block;
    width: 100%;
    height: 140px;
    object-fit: cover;
}

/* Tooltip title */
.imap-tooltip-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.3;
    color: #2494d2;
    font-family: 'GothamBold';
}

/* Tooltip rows (address, email, website, phone) */
.imap-tooltip-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 5px;
    line-height: 1.4;
}

.imap-tooltip-icon {
    flex-shrink: 0;
    width: 13px;
    height: 13px;
    margin-top: 2px;
}

.imap-tooltip-icon svg path {
    fill: #000;
}

.imap-tooltip-icon svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    display: block;
}

.imap-tooltip-text {
    color: #000;
    text-decoration: none;
    font-size: 12px;
    word-break: break-word;
}

a.imap-tooltip-text:hover {
    text-decoration: underline;
    color: #2494d2;
}

/* Tooltip HR */
.imap-tooltip-hr {
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.2);
    margin: 8px 0;
    height: 1px;
}

/* Tooltip socials */
.imap-tooltip-socials {
    display: flex;
    gap: 7px;
    justify-content: flex-start;
}

.imap-tooltip-social {
    display: inline-block;
    width: 14px;
    height: 14px;
    transition: opacity 0.2s ease;
}

.imap-tooltip-social svg path {
    fill: #000;
}

.imap-tooltip-social:hover {
    opacity: 0.7;
}

.imap-tooltip-social svg {
    width: 14px;
    height: 14px;
    fill: #fff;
    display: block;
}

/* Legend */
.imap-legend {
    background: #186c90;
    padding: 45px 35px;
    width: 100%;
    height: 100%;
}

.imap-legend-title {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    padding-bottom: 10px;
}

.imap-legend-category {
    margin-bottom: 5px;
    overflow: hidden;
}

.imap-legend-header {
    display: flex;
    align-items: center;
    padding: 10px 0;
    color: #fff;
    font-family: 'GothamBold';
    text-transform: uppercase;
    cursor: pointer;
    background: #186c90;
    transition: background 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.imap-legend-header:hover {
    background: #186c90;
}

.imap-legend-swatch {
    display: inline-block;
    width: 16px;
    height: 19px;
    margin-right: 10px;
    flex-shrink: 0;
}

.imap-legend-swatch svg {
    display: block;
    width: 100%;
    height: 100%;
}

.imap-legend-name {
    flex: 1;
    font-weight: 500;
    font-size: 14px;
}

.imap-legend-arrow {
    font-size: 10px;
    margin-right: 1.25rem;
    color: #f5ee2e;
    transition: transform 0.3s ease;
}

.imap-legend-category.open .imap-legend-arrow {
    transform: rotate(180deg);
}

.imap-legend-items {
    padding: 0;
    background: #186c90;
}

.imap-legend-item {
    padding: 8px 0;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.imap-legend-item:hover {
    background: #186c90;
}

.imap-legend-item.active {
    background: #186c90;
    font-weight: 600;
}

.imap-legend-empty {
    color: #d1e0e7;
    cursor: default;
}

/* Responsive */
@media (max-width: 767px) {
    .imap-frontend .col-md-9,
    .imap-frontend .col-md-3 {
        padding-bottom: 20px;
    }

    .imap-legend {
        margin-top: 20px;
    }
}
