/* ============================================
   Стили для графиков параметров воды
   Использует переменные из style.css
   ============================================ */

/* ===== МОДАЛЬНОЕ ОКНО ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-card);
    border: 2px solid var(--accent);
    border-radius: 15px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0, 168, 255, 0.3);
    /* Flexbox: заголовок фиксирован, тело скроллится */
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0; /* не сжимается */
}

.modal-header h2 {
    color: var(--accent-light);
    margin: 0;
    font-size: 1.5em;
}

.modal-close {
    color: var(--text-muted);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
}

.modal-close:hover { color: var(--accent); }

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1; /* занимает всё оставшееся место — не нужен магический calc() */
}

/* ===== ВКЛАДКИ ГРАФИКОВ ===== */
.chart-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.chart-tab {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 8px 16px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9em;
    font-family: inherit;
}

.chart-tab:hover {
    background: var(--bg-card-hover);
    color: var(--accent-light);
    border-color: var(--accent);
}

.chart-tab.active {
    background: var(--accent);
    color: var(--bg-base);
    border-color: var(--accent);
}

/* ===== КОНТЕЙНЕР ГРАФИКА ===== */
.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
    margin-bottom: 20px;
}

/* ===== ЛЕГЕНДА ===== */
.chart-legend {
    padding: 15px;
    background: var(--bg-input);
    border-radius: 10px;
    border: 1px solid var(--border);
}

/* Элементы легенды — классы используются в charts.js */
.legend-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.legend-label { color: var(--text-muted); }

.legend-value          { color: var(--accent-light); }
.legend-value--bold    { color: var(--accent-light); font-weight: bold; }
.legend-value--success { color: var(--success); }
.legend-value--danger  { color: var(--danger); }

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 768px) {
    .modal-content  { width: 95%; }
    .chart-container { height: 300px; }
    .chart-tab      { padding: 6px 12px; font-size: 0.8em; }
    .modal-header h2 { font-size: 1.2em; }
}
