/* ──────────────────────────────────────────────────────────
   Structures Locator – Modern Minimal Styles
   Prefix: .slc  (Structures Locator Component)
   ────────────────────────────────────────────────────────── */

:root {
    --slc-primary: #153E90;
    --slc-primary-rgb: 21, 62, 144;
    --slc-bg: #f8f9fa;
    --slc-surface: #ffffff;
    --slc-text-main: #2c3e50;
    --slc-text-light: #6c757d;
    --slc-border: #e9ecef;
    --slc-radius: 12px;
    --slc-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --slc-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.08);
    --slc-transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ─── Wrapper ─── */
.slc {
    display: flex;
    width: 100%;
    height: var(--slc-height, 600px);
    /* Inherit font-family from theme (Montserrat typically) */
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    color: var(--slc-text-main);
    background: var(--slc-surface);
    border: 1px solid var(--slc-border);
    border-radius: var(--slc-radius);
    overflow: hidden;
    box-shadow: var(--slc-shadow);
}

/* ─── Left panel (list + detail) ─── */
.slc__left {
    width: 40%;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--slc-bg);
    /* Light gray background for list context */
    border-right: 1px solid var(--slc-border);
    position: relative;
}

/* Panels wrapper: slides horizontally */
.slc__panels {
    display: flex;
    width: 200%;
    height: 100%;
    /* Ensure full height for scrolling context */
    transition: transform 0.4s cubic-bezier(0.2, 0, 0, 1);
}

.slc__panels--detail {
    transform: translateX(-50%);
}

.slc__list,
.slc__detail {
    width: 50%;
    flex-shrink: 0;
    height: 100%;
    overflow-y: auto;
    /* Scroll independently */
}

.slc__list {
    padding: 16px;
    /* Spacing for cards */
}

/* ─── Right panel (map) ─── */
.slc__right {
    width: 65%;
    position: relative;
    z-index: 1;
    /* Below other UI elements if needed */
}

.slc__map {
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* ─── Card (Floating Style) ─── */
.slc__card {
    display: flex;
    gap: 16px;
    padding: 20px;
    margin-bottom: 16px;
    background: var(--slc-surface);
    border: 1px solid transparent;
    /* Reserve space for border transition */
    border-radius: var(--slc-radius);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: var(--slc-transition);
}

.slc__card:last-child {
    margin-bottom: 0;
}

.slc__card:hover {
    transform: translateY(-2px);
    box-shadow: var(--slc-shadow-hover);
    border-color: rgba(var(--slc-primary-rgb), 0.1);
}

.slc__card--active {
    background: #fff;
    border-color: var(--slc-primary);
    box-shadow: 0 4px 12px rgba(var(--slc-primary-rgb), 0.15);
}

/* Card image */
.slc__card-img {
    flex-shrink: 0;
    width: 100px;
    height: 75px;
    display: block;
    object-fit: contain;
    border-radius: 8px;
    /* Slightly rounded images */
    background: white;
}

.slc__card-img--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    border-radius: 8px;
    background: #f1f3f5;
    color: #adb5bd;
    font-size: 24px;
    flex-shrink: 0;
}

/* Card body */
.slc__card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.slc__card-name {
    font-weight: 700;
    font-size: 16px;
    color: var(--slc-text-main);
    margin: 0 0 6px;
    line-height: 1.3;
    /* Multiline ellipsis */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.slc__card-address {
    font-size: 13px;
    color: var(--slc-text-light);
    margin: 0 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.slc__card-contact {
    font-size: 13px;
    color: var(--slc-primary);
    font-weight: 500;
    margin-top: 4px;
    /* Single line ellipsis */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.slc__card-contact a {
    color: var(--slc-primary);
    text-decoration: none;
    transition: opacity 0.2s;
}

.slc__card-contact a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* ─── Detail Panel ─── */
.slc__detail {
    background: var(--slc-surface);
    display: flex;
    flex-direction: column;
}

.slc__detail-back {
    padding: 16px 20px;
    border-bottom: 1px solid var(--slc-border);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.slc__detail-back-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--slc-primary);
    font-size: 14px;
    font-weight: 600;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: opacity 0.2s;
}

.slc__detail-back-btn:hover {
    opacity: 0.7;
}

/* ─── Image Carousel (Detail) ─── */
.slc__carousel {
    position: relative;
    width: 100%;
    background: #f8f9fa;
}

.slc__carousel-viewport {
    width: 100%;
    overflow: hidden;
}

.slc__carousel-track {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.slc__carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 340px;
    position: relative;
    overflow: hidden;
    background: #e9ecef;
}

/* Blurred background layer */
.slc__carousel-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(20px);
    opacity: 0.6;
    transform: scale(1.1);
    /* Hide white edges from blur */
    z-index: 1;
}

/* Foreground contained image */
.slc__carousel-img {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 2;
    /* On top of blur */
    display: block;
}

/* Carousel controls */
.slc__carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--slc-text-main);
    opacity: 0;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.slc__carousel:hover .slc__carousel-btn {
    opacity: 1;
}

.slc__carousel-btn:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.1);
}

.slc__carousel-btn--prev {
    left: 16px;
}

.slc__carousel-btn--next {
    right: 16px;
}

/* Dots */
.slc__carousel-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 2;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

.slc__carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.slc__carousel-dot:hover {
    background: rgba(255, 255, 255, 0.8);
}

.slc__carousel-dot--active {
    background: #fff;
    transform: scale(1.2);
}

/* ─── Detail Info ─── */
.slc__detail-info {
    padding: 30px;
}

.slc__detail-name {
    font-size: 26px;
    font-weight: 800;
    color: var(--slc-primary);
    margin: 0 0 8px;
    line-height: 1.2;
}

.slc__detail-region {
    font-size: 14px;
    color: var(--slc-text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 24px;
    display: inline-block;
    background: rgba(0, 0, 0, 0.04);
    padding: 4px 10px;
    border-radius: 6px;
}

/* Data Grid */
.slc__detail-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.slc__detail-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.slc__detail-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(21, 62, 144, 0.08);
    /* primary 8% opacity */
    color: var(--slc-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.slc__detail-content {
    flex: 1;
}

.slc__detail-label {
    font-size: 12px;
    color: var(--slc-text-light);
    margin-bottom: 4px;
    font-weight: 600;
}

.slc__detail-value {
    font-size: 16px;
    color: var(--slc-text-main);
    line-height: 1.5;
    font-weight: 500;
}

.slc__detail-value a {
    color: var(--slc-text-main);
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    transition: color 0.2s;
}

.slc__detail-value a:hover {
    color: var(--slc-primary);
    border-color: var(--slc-primary);
}

.slc__detail-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--slc-border);
}

.slc__detail-actions>a:first-child {
    grid-column: 1 / -1;
    /* Full width */
}

.slc-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
}

.slc-btn--primary {
    background: var(--slc-primary);
    color: #fff;
    box-shadow: 0 4px 10px rgba(var(--slc-primary-rgb), 0.25);
}

.slc-btn--primary:hover {
    background: #0f2d6b;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(var(--slc-primary-rgb), 0.3);
}

.slc-btn--secondary {
    background: white;
    color: var(--slc-text-main);
    border: 1px solid var(--slc-border);
}

.slc-btn--secondary:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
}

/* ─── Custom Leaflet Marker (CSS Only) ─── */
.slc-marker {
    display: block;
    width: 30px;
    height: 30px;
    background: var(--slc-primary);
    border: 3px solid #fff;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    /* Point down */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.3, 2, 0.6, 1);
    position: relative;
}

.slc-marker::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.slc-marker:hover {
    transform: rotate(-45deg) scale(1.15) translateY(-4px);
    /* Combined transform */
}

/* ─── Custom Leaflet popup ─── */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 0;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 0 !important;
    padding: 0 !important;
    width: 260px !important;
}

.leaflet-popup-tip {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.leaflet-container a.leaflet-popup-close-button {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    font-size: 18px;
    padding: 8px;
    width: 30px;
    height: 30px;
    top: 5px;
    right: 5px;
    z-index: 10;
}

.slc-popup {
    font-family: inherit;
    font-size: 13px;
    line-height: 1.5;
    background: #fff;
}

.slc-popup__body {
    padding: 16px;
}

.slc-popup__name {
    font-size: 15px;
    font-weight: 700;
    color: var(--slc-primary);
    margin-bottom: 8px;
    line-height: 1.3;
    border-bottom: 1px solid #f1f3f5;
    padding-bottom: 8px;
}

.slc-popup__row {
    color: var(--slc-text-main);
    font-size: 12px;
    margin-bottom: 6px;
    display: flex;
    gap: 6px;
    align-items: flex-start;
}

.slc-popup__row a {
    color: var(--slc-text-main);
    text-decoration: none;
}

.slc-popup__row a:hover {
    color: var(--slc-primary);
    text-decoration: underline;
}

.slc-popup__action {
    display: block;
    margin-top: 12px;
    font-weight: 600;
    color: var(--slc-primary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: right;
    text-decoration: none;
    cursor: pointer;
}

.slc-popup__action:hover {
    text-decoration: underline;
}

/* ─── Marker cluster overrides ─── */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
    background-color: rgba(21, 62, 144, 0.2) !important;
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
    background-color: var(--slc-primary) !important;
    color: #fff !important;
    font-weight: 700;
    font-family: inherit;
    box-shadow: 0 4px 10px rgba(21, 62, 144, 0.3);
}

/* ─── Empty state ─── */
.slc__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 40px;
    color: var(--slc-text-light);
}

.slc__empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* ─── Responsive ─── */
@media (max-width: 992px) {
    .slc {
        flex-direction: column;
        border-radius: 0;
        /* Full bleed on mobile often looks better */
        border: none;
        height: auto;
        /* Allow flexible height */
    }

    .slc__left {
        width: 100%;
        height: 60vh;
        /* Fixed height for list part on mobile */
        border-right: none;
        border-bottom: 1px solid var(--slc-border);
    }

    .slc__right {
        width: 100%;
        height: 40vh;
        /* Map height on mobile */
    }

    .slc__card {
        padding: 16px;
        margin-bottom: 12px;
    }

    .slc__card-img {
        width: 80px;
        height: 80px;
    }

    .slc__carousel-slide img {
        height: 240px;
    }
}