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

/* Панель объектов слева */
.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;
}

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

.vehicle-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.vehicle-subtitle {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 3px;
}

.vehicle-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 8px;
}

.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;
}

.details-section {
    padding: 20px;
    border-bottom: 1px solid #ecf0f1;
}

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

.data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.data-item {
    display: flex;
    flex-direction: column;
}

.data-label {
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 4px;
}

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

.sensors-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Детальная карточка датчика */
.sensor-card {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #3498db;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.sensor-card:hover {
    background: #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateX(2px);
}

.sensor-card.detailed-sensor {
    border-left-width: 4px;
}

.sensor-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.sensor-icon {
    font-size: 20px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.sensor-info {
    flex: 1;
}

.sensor-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 13px;
    margin-bottom: 2px;
}

.sensor-type {
    font-size: 11px;
    color: #7f8c8d;
}

.sensor-value {
    font-weight: 700;
    font-size: 15px;
    padding: 4px 8px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

.sensor-detail {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

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

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

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

/* Цвета для разных типов датчиков */
.sensor-card[data-type="fuel"] {
    border-left-color: #f39c12;
}

.sensor-card[data-type="temperature"] {
    border-left-color: #e74c3c;
}

.sensor-card[data-type="door"] {
    border-left-color: #9b59b6;
}

.sensor-card[data-type="engine"] {
    border-left-color: #27ae60;
}

.sensor-card[data-type="gps"] {
    border-left-color: #3498db;
}

/* Иконки данных */
.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;
}

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

/* Скелетон загрузки */
.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;
}

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

@media (max-width: 768px) {
    .objects-panel {
        width: 350px;
    }
    .vehicle-details-panel {
        width: 350px;
    }

    .map-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .map-controls {
        flex-wrap: wrap;
    }
    
    .sensor-header {
        flex-wrap: wrap;
    }
    
    .sensor-value {
        width: 100%;
        text-align: center;
        margin-top: 8px;
    }
    
    .sensor-details {
        grid-template-columns: 1fr;
    }
}
/* Стили для фильтров состояния */
.status-filters {
    padding: 20px;
    border-bottom: 1px solid #ecf0f1;
}

.filters-title {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-count {
    font-size: 12px;
    font-weight: 500;
    color: #7f8c8d;
    background: #f8f9fa;
    padding: 2px 8px;
    border-radius: 12px;
}

.filters-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s ease;
}

.filter-btn:hover::before {
    left: 100%;
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.filter-btn.active {
    border-width: 2px;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.filter-icon {
    font-size: 16px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.filter-btn.active .filter-icon {
    transform: scale(1.1);
}

/* Стили для конкретных фильтров */
.filter-btn.moving {
    color: #27ae60;
    border-color: #d5f4e1;
    background: linear-gradient(135deg, #f8fff9 0%, #e8f7ee 100%);
}

.filter-btn.moving.active {
    border-color: #27ae60;
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
}

.filter-btn.parked {
    color: #f39c12;
    border-color: #fdebd0;
    background: linear-gradient(135deg, #fffbf0 0%, #fef5e7 100%);
}

.filter-btn.parked.active {
    border-color: #f39c12;
    background: linear-gradient(135deg, #f39c12 0%, #f1c40f 100%);
    color: white;
}

.filter-btn.stopped {
    color: #e74c3c;
    border-color: #fadbd8;
    background: linear-gradient(135deg, #fff5f5 0%, #fdedec 100%);
}

.filter-btn.stopped.active {
    border-color: #e74c3c;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.filter-btn.offline {
    color: #7f8c8d;
    border-color: #ecf0f1;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.filter-btn.offline.active {
    border-color: #7f8c8d;
    background: linear-gradient(135deg, #7f8c8d 0%, #95a5a6 100%);
    color: white;
}

/* Индикатор количества в активном фильтре */
.filter-btn.active::after {
    content: '';
    position: absolute;
    top: -4px;
    right: -4px;
    width: 8px;
    height: 8px;
    background: #e74c3c;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    animation: pulse-badge 2s infinite;
}

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

/* Кнопка сброса фильтров */
.clear-filters {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #6c757d;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.clear-filters:hover {
    border-color: #3498db;
    background: #3498db;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.clear-filters:active {
    transform: translateY(0);
}

/* Анимация переключения фильтров */
@keyframes filterActivate {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.filter-btn.active {
    animation: filterActivate 0.3s ease;
}

/* Адаптивность для фильтров */
@media (max-width: 768px) {
    .filters-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .filter-btn {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .filter-icon {
        font-size: 14px;
        width: 18px;
        height: 18px;
    }
}

/* Эффект гласса для активных фильтров */
.filter-btn.active {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Плавное изменение счетчика фильтров */
.filter-count {
    transition: all 0.3s ease;
}

.filter-count.highlight {
    background: #3498db;
    color: white;
    animation: countPulse 0.6s ease;
}

@keyframes countPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}
