/**
 * SLJ OSM Map Styles
 *
 * Uses CSS variables from Jobify Child Theme (jobify-classic)
 * --color-primary, --color-accent, --color-body-text, etc.
 *
 * @package SLJ_OSM
 */

/* ==========================================================================
   Map Container
   ========================================================================== */

.slj-osm-map {
    position: relative;
    width: 100%;
    z-index: 1;
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.slj-osm-loading {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 1.1em;
}

.slj-osm-map--loading .slj-osm-loading {
    display: flex;
}

.slj-osm-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: slj-osm-spin 1s ease-in-out infinite;
}

@keyframes slj-osm-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Marker Cluster
   ========================================================================== */

.slj-osm-cluster-icon {
    background: transparent !important;
}

.slj-osm-cluster {
    --size: 60px;

    display: flex;
    justify-content: center;
    align-items: center;
    width: var(--size);
    height: var(--size);
    margin-left: calc(var(--size) / -2);
    margin-top: calc(var(--size) / -2);

    background: var(--color-primary, #3f6745);
    border: 4px solid #fff;
    border-radius: 50%;

    color: #fff;
    font-size: 1.5em;
    font-weight: bold;

    transition: background-color 0.2s ease;
}

.slj-osm-cluster:hover {
    background: var(--color-accent, #3f6745);
    filter: brightness(0.85);
}

/* ==========================================================================
   Popup
   ========================================================================== */

.slj-osm-popup {
    min-width: 200px;
    max-width: 280px;
}

.slj-osm-popup__logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1em;
}

.slj-osm-popup__logo img {
    max-width: 100%;
    max-height: 80px;
    height: auto;
}

.slj-osm-popup__title {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 0.75em;
    line-height: 1.3;
    color: var(--color-body-text, #333);
}

.slj-osm-popup__company,
.slj-osm-popup__location {
    font-size: 0.95em;
    margin-bottom: 0.5em;
    color: var(--color-body-text, #555);
    opacity: 0.85;
}

.slj-osm-popup__label {
    font-weight: bold;
    color: var(--color-body-text, #333);
}

.slj-osm-popup__link {
    margin-top: 1.25em;
}

.slj-osm-popup__link a {
    display: block;
    text-align: center;
    padding: 10px 20px;

    background-color: var(--color-primary, #3f6745);
    border-radius: 5px;

    color: #fff !important;
    font-size: 1em;
    text-decoration: none !important;

    transition: background-color 0.2s ease, filter 0.2s ease;
}

.slj-osm-popup__link a:hover {
    background-color: var(--color-accent, #3f6745);
    filter: brightness(1.15);
}

/* ==========================================================================
   Leaflet Overrides
   ========================================================================== */

.leaflet-popup-content {
    margin: 15px 18px;
}

.leaflet-popup-content-wrapper {
    border-radius: 8px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .slj-osm-cluster {
        --size: 50px;
        font-size: 1.2em;
    }

    .slj-osm-popup {
        min-width: 180px;
    }

    .slj-osm-popup__title {
        font-size: 1.1em;
    }
}
