/* Стили для страницы мониторинга */

/* Панель объектов слева */
.objects-panel {
    width: 450px;
    background: white;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.panel-header {
    padding: 20px;
    border-bottom: 1px solid #ecf0f1;
}

.panel-title {
    font-size: 16px;
    font-weight: 500;
    color: #2c3e50;
}

.search-box {
    padding: 20px;
    border-bottom: 1px solid #ecf0f1;
}

.search-input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.objects-list {
    flex: 1;
    overflow-y: auto;
}

.object-item {
    padding: 15px 20px;
    border-bottom: 1px solid #ecf0f1;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.object-item:hover {
    background: #f8f9fa;
}

.object-item.active {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-left: 4px solid #2196F3;
    transform: translateX(2px);
    transition: all 0.3s ease;
}

/* Стили для статус индикаторов */
.status-indicator {
    position: relative;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.3s ease;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Стиль для точки выбора */
.selection-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #2196F3;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    animation: pulse-selection 2s infinite;
}

@keyframes pulse-selection {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

.status-online {
    background: #27ae60;
    animation: pulse-online 2s infinite;
}

.status-warning {
    background: #f39c12;
    animation: pulse-warning 2s infinite;
}

.status-offline {
    background: #e74c3c;
}

@keyframes pulse-online {
    0% { box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(39, 174, 96, 0); }
    100% { box-shadow: 0 0 0 0 rgba(39, 174, 96, 0); }
}

@keyframes pulse-warning {
    0% { box-shadow: 0 0 0 0 rgba(243, 156, 18, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(243, 156, 18, 0); }
    100% { box-shadow: 0 0 0 0 rgba(243, 156, 18, 0); }
}

.object-details {
    flex: 1;
}

.object-name {
    font-weight: 500;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.object-info {
    font-size: 12px;
    color: #7f8c8d;
    display: flex;
    justify-content: space-between;
    margin-bottom: 3px;
}

/* Улучшенная карточка датчика в списке */
.object-sensors {
    font-size: 11px;
    color: #2c3e50;
    margin-top: 8px;
    padding: 8px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 6px;
    border-left: 3px solid #3498db;
    animation: slideDown 0.3s ease;
    max-height: 200px;
    overflow-y: auto;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.object-item.active .object-sensors {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-left-color: #2196F3;
}

.sensor-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.sensor-item:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.sensor-item span:first-child {
    font-weight: 500;
    color: #34495e;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sensor-item span:last-child {
    font-weight: 600;
    text-align: right;
}

.object-status {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

/* Карта справа */
.map-panel {
    flex: 1;
    background: white;
    display: flex;
    flex-direction: column;
    position: relative;
}

.map-header {
    padding: 20px;
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.map-controls {
    display: flex;
    gap: 10px;
}

.map-control-btn {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.map-control-btn:hover {
    background: #f8f9fa;
}

.map-container {
    flex: 1;
    position: relative;
    min-height: 500px;
}

#map {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* Стили для отладки карты */
.map-debug {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 10px;
    border-radius: 5px;
    font-size: 12px;
    z-index: 1000;
    display: none;
    max-width: 300px;
}

/* Детальная информация об объекте */
.vehicle-details-panel {
    width: 500px;
    background: white;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #e0e0e0;
    flex-shrink: 0;
    overflow-y: auto;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    position: relative;
    z-index: 10;
}

/* Заголовок объекта */
.vehicle-header {
    padding: 20px;
    border-bottom: 1px solid #ecf0f1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 11;
}

.vehicle-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: white;
}

.vehicle-subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 4px;
    color: rgba(255,255,255,0.9);
}

.vehicle-status {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 10px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
}

/* Секции с данными */
.details-section {
    padding: 20px;
    border-bottom: 1px solid #ecf0f1;
    background: white;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f8f9fa;
}

/* Сетка данных */
.data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.data-item {
    display: flex;
    flex-direction: column;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.data-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.data-label {
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-value {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

/* Датчики в детальной панели */
.sensors-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sensor-card.detailed-sensor {
    border-left: 4px solid #3498db;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.sensor-card.detailed-sensor:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

/* Цвета для разных типов датчиков */
.sensor-card.detailed-sensor[data-type="fuel"] {
    border-left-color: #f39c12;
    background: linear-gradient(135deg, #fef9e7 0%, #fcf3cf 100%);
}

.sensor-card.detailed-sensor[data-type="power"] {
    border-left-color: #3498db;
    background: linear-gradient(135deg, #e8f4fd 0%, #d6eaf8 100%);
}

.sensor-card.detailed-sensor[data-type="ignition"] {
    border-left-color: #27ae60;
    background: linear-gradient(135deg, #e8f8f1 0%, #d1f2eb 100%);
}

.sensor-card.detailed-sensor[data-type="temperature"] {
    border-left-color: #e74c3c;
    background: linear-gradient(135deg, #fdedec 0%, #fadbd8 100%);
}

.sensor-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 12px;
    background: rgba(255,255,255,0.8);
    border-radius: 6px;
}

.sensor-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.sensor-info {
    flex: 1;
    min-width: 0;
}

.sensor-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sensor-type {
    font-size: 12px;
    color: #7f8c8d;
    font-weight: 500;
}

.sensor-value {
    font-weight: 700;
    font-size: 16px;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-width: 80px;
    text-align: center;
    flex-shrink: 0;
}

.sensor-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.sensor-detail {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    background: rgba(255,255,255,0.6);
    border-radius: 4px;
}

.sensor-detail.full-width {
    grid-column: 1 / -1;
}

.detail-label {
    font-size: 10px;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.detail-value {
    font-size: 12px;
    color: #2c3e50;
    font-weight: 500;
    word-break: break-word;
}

/* Специальные стили для значений */
.detail-value.calibration-value {
    color: #e74c3c;
    font-weight: 700;
    font-size: 13px;
}

.detail-value.calibration-info {
    color: #f39c12;
    font-size: 11px;
    line-height: 1.3;
}

.detail-value.source {
    color: #3498db;
    font-family: monospace;
    font-size: 11px;
}

/* Нет данных */
.no-data {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    padding: 30px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

/* Анимации */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.vehicle-details-panel {
    animation: slideInRight 0.3s ease-out;
}

/* Адаптивность */
@media (max-width: 1200px) {
    .vehicle-details-panel {
        width: 450px;
    }
}

@media (max-width: 1024px) {
    .vehicle-details-panel {
        width: 400px;
    }
    
    .data-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .vehicle-details-panel {
        width: 100%;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 1000;
        box-shadow: -5px 0 15px rgba(0,0,0,0.3);
    }
    
    .sensor-details {
        grid-template-columns: 1fr;
    }
    
    .sensor-header {
        flex-wrap: wrap;
    }
    
    .sensor-value {
        width: 100%;
        text-align: center;
        margin-top: 8px;
    }
}

/* Скроллбар для детальной панели */
.vehicle-details-panel::-webkit-scrollbar {
    width: 6px;
}

.vehicle-details-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.vehicle-details-panel::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.vehicle-details-panel::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Индикатор загрузки для детальной панели */
.details-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #7f8c8d;
}

.details-loading::before {
    content: "⏳";
    font-size: 24px;
    margin-bottom: 10px;
    animation: rotate 2s linear infinite;
}

/* Кнопка закрытия детальной панели */
.details-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    font-size: 18px;
    font-weight: bold;
}

.details-close-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

/* Статусы в детальной панели */
.status-moving {
    background: #d4edda;
    color: #155724;
}

.status-parked {
    background: #fff3cd;
    color: #856404;
}

.status-stopped {
    background: #f8d7da;
    color: #721c24;
}

.status-online {
    background: #d4edda;
    color: #155724;
}

.status-offline {
    background: #e2e3e5;
    color: #383d41;
}

/* Иконки данных */
.data-icon {
    margin-right: 4px;
}

/* Технические элементы */
.technical-item .data-label {
    display: flex;
    align-items: center;
}

.technical-item .data-icon {
    font-size: 16px;
}

/* Индикатор загрузки датчиков */
.sensors-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #7f8c8d;
}

.sensors-loading::before {
    content: "⏳";
    margin-right: 8px;
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Статус обновления датчиков */
.sensor-update-status {
    font-size: 10px;
    color: #27ae60;
    padding: 2px 6px;
    background: #d4edda;
    border-radius: 3px;
    margin-left: 8px;
}

.sensor-update-status.outdated {
    color: #f39c12;
    background: #fff3cd;
}

.sensor-update-status.error {
    color: #e74c3c;
    background: #f8d7da;
}

/* Скелетон загрузки */
.loading-skeleton {
    padding: 20px;
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
}

/* Скроллбар для датчиков */
.object-sensors::-webkit-scrollbar {
    width: 4px;
}

.object-sensors::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05);
    border-radius: 2px;
}

.object-sensors::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 2px;
}

.object-sensors::-webkit-scrollbar-thumb:hover {
    background: #2196F3;
}
