﻿:root {
    --primary: #007bff;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f9fa;
    color: #333;
    line-height: 1.6;
    padding: 8px;

}

.container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 6px;


}
/* Компактный статус-бар */
.status-bar-compact {
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 8px 12px;
    display: flex;
    gap: 15px;
    align-items: center;
    flex: 0 0 auto; /* Фиксированная высота */
    height: 26px;
}

.status-item-compact {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-label {
    font-size: 14px;
    font-weight: 500;
    color: #495057;
}

.status-value {
    font-size: 14px;
    color: #212529;
}


/* Футер в стиле компактного хедера */
.footer {
    background: white;
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    text-align: center;
    flex: 0 0 auto; /* Фиксированная высота */
}

.footer h1 {
    font-size: 12px;
    margin-bottom: 4px;
    color: #333;
    font-weight: 600;
}

.footer p {
    font-size: 12px;
    color: #666;
    margin: 0;
    line-height: 1.3;
}


.panel {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);



}

/* Стили для первого грида */
.first-grid-panel {
    height: 400px; /* Фиксированная высота для панелей первого грида */
    display: flex;
    flex-direction: column;

}

.first-grid-panel .panel-content {
    flex: 1;
    overflow-y: auto; /* Вертикальный скролл для содержимого */
    margin-top: 0px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;

}

.btn {
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    margin: 5px;
    transition: background-color 0.3s;
}

.btn:hover {
    opacity: 0.9;
}

.btn-primary { background: var(--primary); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-secondary { background: #6c757d; color: white; }

.form-group {
    margin-bottom: 15px;
}

.form-control {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 5px;
}


.form-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Базовые стили для чекбоксов экспорта */
.select-all-container {
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #dee2e6;
}

.export-nodes-checkboxes {
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background-color: white;
}

.export-nodes-checkboxes label {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 5px;
    border-radius: 4px;
    transition: all 0.2s;
    cursor: pointer;
}

.export-nodes-checkboxes label:hover {
    background-color: #f1f8ff;
}

.export-nodes-checkboxes input[type="checkbox"] {
    margin-right: 10px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.export-nodes-checkboxes label.selected {
    background-color: #e8f5e9;
    border-left: 4px solid #27ae60;
}

.chart-container {
    height: 250px;
    margin: 2px 0;
}

.alert {
    padding: 2px;
    border-radius: 4px;
    margin: 2px 2px;
    text-align: center;
    font-family: monospace;
    padding: 6px;
}

.alert-success { background: #d4edda; color: #155724; }
.alert-error { background: #f8d7da; color: #721c24; }
.alert-info { background: #d1ecf1; color: #0c5460; }



/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 10px;
    width: 80%;
    max-width: 700px;
    max-height: 80%;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    position: relative;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
}

.close-btn:hover {
    color: #333;
}
/* Стили для карточек узлов */
.node-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 10px;
    margin: 8px 0;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}


.node-card-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.node-address {
    font-weight: 600;
    font-size: 12px;
    color: #212529;
    line-height: 1.3;
}

.node-id {
    font-size: 11px;
    color: #6c757d;
    font-family: 'Courier New', monospace;

}
/* Стиль для выделенной карточки */
.node-card-selected {
    border-color: #007bff;
    background-color: #edf2fb;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}


/* Стили для отображения текущих данных */
.alert-info strong {
    color: #0c5460;
}

/* Дополнительные стили для графика */
.chart-container canvas {
    border-radius: 8px;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
/* Стили для контейнера карты */
.map-container {
    width: 100%;
    height: 100%;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#map {
    width: 100%;
    height: 100%;
    min-height: 400px; /* Минимальная высота для видимости */
}
/* Стили для маркеров */
        .marker-container {
            background: transparent;
            border: none;
        }

        .custom-marker {
            width: 12px;
            height: 12px;

            border-radius: 50%;
            border: 1px solid;
            box-shadow: 0 2px 4px rgba(0,0,0,0.2);
            transition: transform 0.2s;
            position: relative;
        }
        .marker_blue {
            background: #0000FF;
        }
        .marker_red {
            background: #ff4757;
        }
        .custom-marker:hover {
            transform: scale(1.2);
            cursor: pointer;
        }
/* Стили для tooltip маркеров */
.custom-tooltip {
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    minwidth: 250px;
    maxwidth: 400px;	
}

.custom-tooltip::before {
    border-top-color: #ccc !important;
}

.marker-tooltip {
    text-align: left;
}

.tooltip-line1 {
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    
}

.tooltip-line2 {
    color: #666;
    font-size: 11px;
}
/* Основные стили для мобильных устройств */
@media (max-width: 768px) {
    body {
        padding: 5px;
    }

    .container {
        height: auto;
        min-height: 100vh;
        overflow: visible;
        gap: 5px;
    }

    .grid-2 {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    /* Статус-бар на мобильных */
    .status-bar-compact {
        flex-direction: row;
        flex-wrap: wrap;
        height: auto;
        padding: 8px;
        gap: 10px;
        justify-content: space-between;
    }

    .status-item-compact {
        flex: 1 0 auto;
        min-width: 45%;
        padding: 5px;
        justify-content: center;
    }

    /* Панель списка узлов с фиксированной высотой и скроллом */
    .first-grid-panel {
        height: 300px; /* Фиксированная высота для мобильных */
        min-height: 300px;
        display: flex;
        flex-direction: column;
    }

    .first-grid-panel .panel-content {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch; /* Для плавного скролла на iOS */
    }

    /* Карта на мобильных */
    .map-container {
        height: 300px;
        min-height: 300px;
    }

    /* Графики на мобильных */
    .panel {
        min-height: 200px;
    }

    .chart-container {
        height: 200px;
        min-height: 200px;
    }

    /* Карточки узлов на мобильных */
    .node-card {
        padding: 8px;
        margin: 4px 0;
    }

    .node-address {
        font-size: 12px;
    }

    .node-id {
        font-size: 11px;
        padding: 2px 4px;
    }

    /* Текущие данные на мобильных */
    #current-data, #current-data4 {
        font-size: 11px;
    }

    .alert {
        padding: 4px 6px;
        font-size: 11px;
    }

    /* Модальное окно на мобильных */
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 15px;
    }
}
/* Дополнительные улучшения для очень маленьких экранов */
@media (max-width: 480px) {


    .first-grid-panel {
        height: 300px;
        min-height: 300px;
    }

    .map-container {
        height: 300px;
        min-height: 300px;
    }

    .panel-header h2 {
        font-size: 1rem;
    }
}