
/* ========== СТИЛІ ДЛЯ ГРАФІКА АКТИВНОСТІ ========== */

/* Модальне вікно графіка */
.chart-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.chart-modal-content {
    background: linear-gradient(180deg, rgba(15,22,34,0.98), rgba(11,17,26,0.99));
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 16px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.chart-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(15,22,34,0.6);
}

.chart-modal-header h3 {
    color: #e7edf6 !important;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.chart-modal-close {
    background: rgba(108,117,125,0.6);
    border: 1px solid rgba(255,255,255,0.15);
    color: #e7edf6;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.chart-modal-close:hover {
    background: rgba(220,53,69,0.8);
    border-color: rgba(220,53,69,0.5);
    transform: scale(1.1);
}

/* Легенда графіка */
.chart-legend {
    display: flex;
    gap: 25px;
    padding: 15px 25px;
    background: rgba(15,22,34,0.4);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #a9b6c7;
    font-size: 14px;
}

.legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #fff;
}

.legend-dot.primary {
    background: #28a745;
}

.legend-dot.secondary {
    background: #ffc107;
}

/* Контролі zoom */
.chart-zoom-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    background: rgba(0,0,0,0.3);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
}

.zoom-btn {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(79,156,255,0.2);
    color: #e7edf6;
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-weight: bold;
}

.zoom-btn:hover {
    background: rgba(79,156,255,0.4);
    border-color: rgba(79,156,255,0.5);
    transform: scale(1.05);
}

.zoom-btn:active {
    transform: scale(0.95);
}

.zoom-btn.reset {
    font-size: 16px;
    margin-left: 4px;
}

.zoom-level {
    color: #a9b6c7;
    font-size: 13px;
    font-weight: 600;
    min-width: 45px;
    text-align: center;
}

/* Підказка для zoom */
.chart-hint {
    text-align: center;
    padding: 10px 20px;
    color: #6c757d;
    font-size: 12px;
    background: rgba(15,22,34,0.4);
    border-top: 1px solid rgba(255,255,255,0.05);
}

/* Контейнер графіка */
.chart-container {
    padding: 20px;
    background: #1a1a2e;
}

#activityChartCanvas {
    width: 100%;
    height: 400px;
    border-radius: 8px;
}

/* Модальне вікно деталей точки */
.point-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    backdrop-filter: blur(3px);
}

.point-modal-content {
    background: linear-gradient(180deg, rgba(15,22,34,0.98), rgba(11,17,26,0.99));
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    padding: 20px;
    position: relative;
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
}

.point-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(108,117,125,0.6);
    border: 1px solid rgba(255,255,255,0.15);
    color: #e7edf6;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.point-modal-close:hover {
    background: rgba(220,53,69,0.8);
    border-color: rgba(220,53,69,0.5);
}

#maintenancePointDetails {
    margin-top: 10px;
}

#maintenancePointDetails .maintenance-item {
    margin: 0;
}

/* Кнопка графіка активності */
button[onclick="openActivityChart()"] {
    padding: 8px 16px !important;
    background: linear-gradient(135deg, #17a2b8, #138496) !important;
    color: white !important;
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

button[onclick="openActivityChart()"]:hover {
    background: linear-gradient(135deg, #1ab4cc, #17a2b8) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(23,162,184,0.3);
}

/* Адаптивність для мобільних */
@media (max-width: 768px) {
    .chart-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .chart-modal-header {
        padding: 15px 20px;
    }
    
    .chart-modal-header h3 {
        font-size: 16px;
    }
    
    .chart-legend {
        flex-wrap: wrap;
        gap: 12px;
        padding: 12px 20px;
    }
    
    .chart-zoom-controls {
        width: 100%;
        justify-content: center;
        margin-top: 8px;
    }
    
    .chart-container {
        padding: 15px;
    }
    
    #activityChartCanvas {
        height: 300px;
    }
    
    .point-modal-content {
        width: 95%;
        padding: 15px;
    }
    
    .chart-hint {
        font-size: 11px;
        padding: 8px 15px;
    }
}

@media (max-width: 480px) {
    .chart-modal-header h3 {
        font-size: 14px;
    }
    
    .legend-item {
        font-size: 12px;
    }
    
    #activityChartCanvas {
        height: 250px;
    }
    
    .zoom-btn {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
    
    .zoom-level {
        font-size: 12px;
        min-width: 40px;
    }
}