.map-container {
    position: relative;
    height: calc(100vh - 64px);
    margin-top: 64px;
    overflow: hidden;
}

#map {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.map-sidebar {
    position: absolute;
    top: 16px;
    left: 60px;
    bottom: 16px;
    width: 398px;
    background: #FFFFFF;
    border-radius: 12px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 16px;
    gap: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.map-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #FAFAF8;
    border-radius: 8px;
    flex-shrink: 0;
}

.map-search__input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    color: #212E38;
    outline: none;
}

.map-search__input::placeholder {
    color: #9699A5;
}

.map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.map-header__count {
    font-size: 14px;
    font-weight: 600;
    color: #212E38;
}

.map-posts-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0 -16px;
    padding: 0 16px;
}

.map-posts-list::-webkit-scrollbar {
    width: 6px;
}

.map-posts-list::-webkit-scrollbar-track {
    background: transparent;
}

.map-posts-list::-webkit-scrollbar-thumb {
    background: #E5E7F1;
    border-radius: 3px;
}

.map-post-card {
    background: #FAFAF8;
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.map-post-card:hover {
    background: #F3F3EA;
}

.map-post-card__header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

.map-post-card__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: #212E38;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.map-post-card__avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.map-post-card__avatar span {
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 600;
}

.map-post-card__author {
    flex: 1;
}

.map-post-card__author-name {
    font-size: 12px;
    font-weight: 600;
    color: #212E38;
    display: block;
}

.map-post-card__date {
    font-size: 12px;
    color: #212E38;
    opacity: 0.6;
}

.map-post-card__title {
    font-size: 14px;
    font-weight: 600;
    color: #212E38;
    margin-bottom: 12px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.map-post-card__meta {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 12px;
}

.map-post-card__meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: #212E38;
}

.map-post-card__meta-item img {
    filter: brightness(0) saturate(100%) invert(15%) sepia(10%) saturate(1000%) hue-rotate(180deg);
}

.map-post-card__meta-item span {
    white-space: nowrap;
}

.map-post-card__image {
    height: 180px;
    background: #D9D9D9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
}

.map-post-card__cover-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.map-post-card__transport-icon {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 1;
    width: 40px;
    height: 40px;
    background: #212E38;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-post-card__transport-icon img {
    filter: brightness(0) invert(1);
}

.map-post-card__reactions {
    display: flex;
    gap: 17px;
}

.map-post-card__reaction {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #212E38;
}

.map-filters {
    position: absolute;
    top: 16px;
    left: 474px;
    z-index: 999;
    display: flex;
    gap: 16px;
}

.map-filter {
    background: #FFFFFF;
    border: none;
    border-radius: 8px;
    padding: 10px 12px;
    min-width: 140px;
    height: 40px;
    font-size: 14px;
    color: #212E38;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 6L8 10L12 6' stroke='%23212E38' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.map-filter:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-content {
    margin: 12px;
}

.leaflet-popup-content h3 {
    font-size: 14px;
    font-weight: 600;
    color: #212E38;
    margin: 0 0 8px 0;
}

.leaflet-popup-content p {
    font-size: 12px;
    color: #212E38;
    margin: 0 0 8px 0;
}

.leaflet-popup-content a {
    font-size: 12px;
    color: #FFCA62;
    text-decoration: none;
    font-weight: 600;
}

.leaflet-popup-content a:hover {
    text-decoration: underline;
}

.map-marker-wrapper {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #FFCA62;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #FFFFFF;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.map-marker-wrapper img {
    filter: brightness(0) saturate(100%) invert(15%) sepia(10%) saturate(1000%) hue-rotate(180deg);
}

.leaflet-div-icon {
    background: transparent !important;
    border: none !important;
}

.clear-routes-btn {
    position: absolute;
    top: 80px;
    right: 16px;
    z-index: 1000;
    padding: 10px 16px;
    background: #FFCA62;
    color: #212E38;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s;
}

.clear-routes-btn:hover {
    background: #f5c14e;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.clear-routes-btn:active {
    transform: translateY(0);
}

.map-filters__search-btn {
    display: none;
}

.map-toggle-btn {
    display: none;
}

@media (max-width: 768px) {
    .map-container {
        height: calc(100vh - 56px);
        margin-top: 56px;
    }

    /* ====== FILTERS BAR (shared: map + list views) ====== */
    .map-filters {
        top: 8px;
        left: 8px;
        right: 8px;
        gap: 8px;
        z-index: 1001;
    }

    .map-filters__search-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: #FFFFFF;
        border: none;
        border-radius: 8px;
        cursor: pointer;
        flex-shrink: 0;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .map-filter {
        flex: 1;
        min-width: 0;
        padding: 8px 28px 8px 10px;
        font-size: 13px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* ====== SIDEBAR (hidden in map view, full-page in list view) ====== */
    .map-sidebar {
        display: none;
    }

    .map-container--list-view .map-sidebar {
        display: flex;
        position: absolute;
        top: 56px;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 0;
        box-shadow: none;
        padding: 12px 16px;
        gap: 12px;
        z-index: 1000;
        background: #FFFFFF;
    }

    .map-container--list-view #map {
        display: none;
    }

    /* ====== SEARCH (hidden in sidebar on mobile, shown in list view) ====== */
    .map-search {
        padding: 8px 12px;
    }

    .map-search__input {
        font-size: 13px;
    }

    /* ====== POST COUNT ====== */
    .map-header__count {
        font-size: 13px;
    }

    /* ====== POST CARDS ====== */
    .map-posts-list {
        gap: 10px;
        margin: 0 -16px;
        padding: 0 16px 76px;
    }

    .map-post-card {
        padding: 10px;
    }

    .map-post-card__header {
        margin-bottom: 8px;
    }

    .map-post-card__avatar {
        width: 36px;
        height: 36px;
    }

    .map-post-card__avatar span {
        font-size: 14px;
    }

    .map-post-card__author-name {
        font-size: 11px;
    }

    .map-post-card__date {
        font-size: 11px;
    }

    .map-post-card__title {
        font-size: 13px;
        margin-bottom: 8px;
    }

    .map-post-card__meta {
        gap: 16px;
        margin-bottom: 8px;
    }

    .map-post-card__meta-item {
        font-size: 13px;
    }

    .map-post-card__image {
        height: 160px;
        margin-bottom: 8px;
    }

    .map-post-card__transport-icon {
        width: 32px;
        height: 32px;
        top: 8px;
        left: 8px;
    }

    .map-post-card__reactions {
        gap: 14px;
    }

    .map-post-card__reaction {
        font-size: 11px;
    }

    /* ====== TOGGLE BUTTONS (yellow, bottom) ====== */
    .map-toggle-btn {
        position: fixed;
        bottom: 16px;
        left: 50%;
        transform: translateX(-50%);
        background: #FFCA62;
        color: #212E38;
        border: none;
        border-radius: 8px;
        padding: 12px 48px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        z-index: 1002;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        display: block;
        white-space: nowrap;
    }

    .map-toggle-btn--map {
        display: none;
    }

    .map-container--list-view .map-toggle-btn--list {
        display: none;
    }

    .map-container--list-view .map-toggle-btn--map {
        display: block;
    }

    /* ====== CLEAR ROUTES BTN ====== */
    .clear-routes-btn {
        top: auto;
        bottom: 72px;
        right: 16px;
        padding: 8px 14px;
        font-size: 13px;
        z-index: 1002;
    }

    /* ====== LEAFLET CONTROLS ====== */
    .leaflet-control-zoom {
        display: none;
    }
}
