/* ── Wrapper ──────────────────────────────────────────────────────────────── */
.scmm-map-wrapper {
    display: flex;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    position: relative;

    --color-primary: #f50300;
    --color-secondary: #03224d;
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.scmm-sidebar {
    max-width: 350px;
    min-width: 300px;
    background: #fff;
    display: flex;
    flex-direction: column;
    z-index: 10;
    overflow: hidden;
}
.scmm-sidebar.collapsed {
    width: 0;
    min-width: 0;
}

.scmm-sidebar-header {
    padding: 16px;
    background: var(--color-secondary);
    color: #fff;
    flex-shrink: 0;
}
.scmm-sidebar-header h3 {
    margin: 0;
    font-size: 30px;
    font-weight: bold;
    color: #fff;
}

.scmm-sidebar-header p {
    margin-bottom: 20px;
}

/* Search input */
.scmm-search-wrap {
    display: flex;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: border-color 0.2s;
}
.scmm-search-wrap:focus-within {
    border-color: rgba(255, 255, 255, 0.8);
}

#scmm-city-search {
    flex: 1;
    border: none;
    padding: 8px 12px;
    font-size: 0.875rem;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    outline: none;
}
#scmm-city-search::placeholder {
    color: rgba(255, 255, 255, 0.6);
}
#scmm-city-search:focus {
    background: rgba(255, 255, 255, 0.22);
}

#scmm-search-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    color: #fff;
    display: flex;
    align-items: center;
    transition: background 0.2s;
}
#scmm-search-btn:hover {
    background: rgba(255, 255, 255, 0.28);
}

#scmm-search-status {
    margin-top: 8px;
    font-size: 0.75rem;
    min-height: 18px;
    color: rgba(255, 255, 255, 0.8);
}
#scmm-search-status.error {
    color: #e71300;
}
#scmm-search-status.success {
    color: #03ea45;
}
#scmm-search-status.loading {
    color: rgba(255, 255, 255, 0.7);
}

/* search spin svg  */
.spinner {
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ── City List ────────────────────────────────────────────────────────────── */
.scmm-city-list {
    list-style: none;
    margin: 0;
    padding: 0 !important;
    overflow-y: auto;
    flex: 1;
    min-height: 200px !important;
}
.scmm-city-list::-webkit-scrollbar {
    width: 4px;
}
.scmm-city-list::-webkit-scrollbar-track {
    background: #f5f5f5;
}
.scmm-city-list::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 2px;
}

.scmm-city-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    transition: background 0.15s;
    border-left: 4px solid transparent;
    border-bottom: 1px solid #5da0ef26;
    color: #333;
    font-size: 0.9rem;
    cursor: pointer !important;
}
.scmm-city-item:hover {
    background: #f0f7ff;
    border-left-color: var(--color-primary);
}
.scmm-city-item.active {
    background: #e8f4fd;
    border-left-color: var(--color-primary);
    font-weight: 600;
    color: var(--color-primary);
}
.scmm-city-item.searched {
    border-left-color: #e67e22;
    color: #795548;
}
.scmm-city-item.searched:hover {
    background: #fff8f0;
    border-left-color: #e67e22;
}
.scmm-city-item.hidden {
    display: none;
}

.scmm-pin-icon {
    font-size: 0.9rem;
    flex-shrink: 0;
}
.scmm-city-name {
    flex: 1;
}
.scmm-arrow {
    flex-shrink: 0;
    opacity: 0.4;
    transition:
        opacity 0.15s,
        transform 0.15s;
}
.scmm-city-item:hover .scmm-arrow {
    opacity: 1;
    transform: translateX(2px);
}

.scmm-no-results {
    padding: 20px 16px;
    color: #888;
    font-size: 0.85rem;
    text-align: center;
}

/* ── Map Container ────────────────────────────────────────────────────────── */
.scmm-map-container {
    flex: 1;
    position: relative;
}
#scmm-map {
    width: 100%;
    height: 100%;
}

/* ── Sidebar Toggle ───────────────────────────────────────────────────────── */
.scmm-sidebar-toggle {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1000;
    background: #fff;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    width: 34px;
    height: 34px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
    transition: background 0.2s;
}
.scmm-sidebar-toggle:hover {
    background: #f4f4f4;
}

/* ── Leaflet Popup ────────────────────────────────────────────────────────── */
.scmm-popup-inner {
    padding: 4px 2px;
    min-width: 180px;
    text-align: center;
}

.scmm-popup-inner h4 {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 700;
}

.scmm-popup-inner p {
    margin: 0 !important;
    color: #8e8e8e;
}
.scmm-popup-badge {
    font-size: 0.7rem;
    background: #e8f4fd;
    color: var(--color-primary);
    border-radius: 20px;
    padding: 2px 8px;
    margin-bottom: 10px;
    display: inline-block;
}

.scmm-popup-btn {
    display: inline-block;
    background: var(--color-primary);
    color: #fff !important;
    text-decoration: none !important;
    padding: 12px 19px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
    margin-top: 4px;
}
.scmm-popup-btn:hover {
    background: #3a80d2;
}

.leaflet-popup-content-wrapper {
    border-radius: 8px !important;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.2) !important;
}
.leaflet-popup-tip-container {
    margin-top: -1px;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .scmm-map-wrapper {
        flex-direction: column;
    }
    .scmm-sidebar {
        width: 100% !important;
        min-width: 100% !important;
        max-height: 400px;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }
    .scmm-sidebar.collapsed {
        max-height: 0;
    }
    .scmm-map-container {
        min-height: 350px;
    }
    .scmm-sidebar-toggle {
        left: auto;
        right: 10px;
    }
}
