/* --- Основний контейнер --- */
.eco-wrapper {
    display: flex;
    height: 750px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #ccc;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    position: relative;
}

/* --- Бокова панель (Список) --- */
.eco-sidebar {
    width: 300px;
    background: #fdfdfd;
    border-right: 1px solid #eee;
    display: flex;
    flex-direction: column;
    z-index: 2;
}

.eco-sidebar-header {
    padding: 18px;
    background: #2c3e50;
    color: white;
    font-weight: bold;
    font-size: 16px;
}

.eco-list-container {
    overflow-y: auto;
    flex-grow: 1;
}

.eco-list-item {
    padding: 15px 18px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s;
}

.eco-list-item:hover { background: #f0f7f2; }

.eco-list-item.active { 
    background: #f0f7f2; 
    border-left: 4px solid #27ae60; 
    padding-left: 14px;
}

.eco-list-name { 
    font-weight: bold; 
    color: #2c3e50; 
    display: block; 
    margin-bottom: 3px; 
}

.eco-list-time { 
    font-size: 11px; 
    color: #999; 
}

/* --- Карта --- */
#main-eco-map { 
    flex-grow: 1; 
    height: 100%; 
    z-index: 1; 
}

/* --- Мобільна панель --- */
.eco-mobile-panel {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: white !important;
    z-index: 2147483647 !important;
    padding: 0;
    margin: 0;
    flex-direction: column;
}

.eco-mobile-panel.active {
    display: flex !important;
}

.eco-mobile-panel-header {
    text-transform: uppercase;
    padding: 15px 20px;
    background: #2c3e50;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.eco-close-btn {
    background: transparent;
    color: white;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.eco-close-btn:hover {
    background: rgba(255,255,255,0.15);
}

.eco-mobile-content {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
    -webkit-overflow-scrolling: touch;
}

/* --- Кастомні маркери --- */
.station-label-custom {
    background: rgba(44, 62, 80, 0.90);
    border: 1px solid #27ae60;
    border-radius: 6px;
    color: white;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    white-space: nowrap;
}

/* --- Адаптивність --- */
@media (max-width: 1023px) {
    .eco-wrapper { 
        flex-direction: column; 
        height: auto; 
        border: none;
        gap: 0;
    }

    .eco-sidebar { 
        width: 100%; 
        height: 38vh;
        order: 1; 
        border-right: none;
        border-top: 1px solid #eee;
        overflow-y: auto;
    }

    #main-eco-map { 
        height: 55vh;
        order: 2;
        width: 100%;
    }

    body.panel-open {
        overflow: hidden !important;
        position: fixed;
        width: 100%;
        height: 100%;
    }
}

/* --- Desktop popup --- */
.eco-popup {
    min-width: 240px;
    font-family: 'Segoe UI', Tahoma, sans-serif;
}

.eco-popup-title {
    margin: 0;
    color: #2c3e50;
    font-size: 16px;
}

.eco-popup-meta {
    font-size: 11px;
    color: #7f8c8d;
    margin: 8px 0 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.eco-popup-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.eco-popup-row {
    border-bottom: none;
}

.eco-popup-row:last-child {
    border-bottom: none;
}

.eco-popup-left {
    padding: 4px 0;
    position: relative;
    border-bottom: 1px solid #e0e0e0;
}


.eco-popup-right {
    text-align: right;
    vertical-align: middle;
    font-weight: bold;
    color: #27ae60;
    position: relative;
    padding-bottom: 6px;
    border-bottom: 1px solid #e0e0e0;
}

.eco-popup-right::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -1px;
    height: 3px;
    width: 100%;
    background: #27ae60;
    opacity: 0.8;
    z-index: 1;
}

.eco-popup-name {
    color: #2c3e50;
}

.eco-popup-sensor {
    color: #999;
    font-size: 10px;
}

.eco-popup-unit {
    color: #777;
    font-weight: normal;
}

.eco-popup-divider {
    height: 3px;
    background: #27ae60;
    opacity: 0.35;
    margin: 10px 0;
}