/**
 * Map Truck List Styles
 * Sliding overlay panel showing truck list on the map view
 */

/* Left Truck List Panel - Absolute overlay on map */
.map-truck-list-panel {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    background: rgba(13, 17, 23, 0.98);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--border-primary);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    z-index: 20;
    transform: translateX(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.map-truck-list-panel.hidden {
    transform: translateX(-100%);
    pointer-events: none;
}

/* Truck List Header */
.map-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(30, 41, 59, 0.6);
    border-bottom: 1px solid var(--border-primary);
}

.map-list-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.map-list-title i {
    color: var(--accent);
}

.map-list-count {
    background: var(--accent);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
}

.map-list-collapse-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.map-list-collapse-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Search/Filter Section */
.map-list-search {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-primary);
}

.map-list-search-input {
    width: 100%;
    padding: 8px 10px 8px 32px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 12px;
    outline: none;
    transition: border-color 0.2s ease;
}

.map-list-search-input:focus {
    border-color: var(--accent);
}

.map-list-search-input::placeholder {
    color: var(--text-muted);
}

.map-list-search-wrapper {
    position: relative;
}

.map-list-search-wrapper i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 13px;
}

/* Filter Chips */
.map-list-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    padding: 6px 10px;
    border-bottom: 1px solid var(--border-primary);
}

.map-list-filter {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.map-list-filter:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.map-list-filter.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.map-list-filter .filter-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 1px 5px;
    border-radius: 8px;
    font-size: 10px;
}

.map-list-filter.active .filter-count {
    background: rgba(255, 255, 255, 0.3);
}

/* Truck List Container */
.map-list-trucks {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}

.map-list-trucks::-webkit-scrollbar {
    width: 6px;
}

.map-list-trucks::-webkit-scrollbar-thumb {
    background: var(--border-primary);
    border-radius: 3px;
}

.map-list-trucks::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Individual Truck Card */
.map-truck-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    margin-bottom: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.map-truck-card:hover {
    border-color: var(--accent);
    background: rgba(88, 166, 255, 0.08);
}

.map-truck-card.active {
    border-color: var(--accent);
    background: rgba(88, 166, 255, 0.15);
    box-shadow: 0 0 0 1px var(--accent);
}

.map-truck-card.highlighted {
    border-color: var(--accent);
    background: rgba(88, 166, 255, 0.1);
    box-shadow: 0 0 8px rgba(88, 166, 255, 0.3);
}

/* Status Indicator */
.map-truck-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.map-truck-status-dot.running {
    background: var(--status-active);
    box-shadow: 0 0 8px rgba(63, 185, 80, 0.5);
    animation: pulse-status 2s infinite;
}

.map-truck-status-dot.parked {
    background: var(--text-muted);
}

.map-truck-status-dot.dormant {
    background: #f97316;
}

.map-truck-status-dot.out-of-service {
    background: var(--status-danger);
}

@keyframes pulse-status {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(63, 185, 80, 0);
    }
}

/* Truck Info */
.map-truck-info {
    flex: 1;
    min-width: 0;
}

.map-truck-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.map-truck-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-secondary);
}

.map-truck-meta .status-text {
    text-transform: uppercase;
    font-weight: 500;
}

.map-truck-meta .status-text.running {
    color: var(--status-active);
}

.map-truck-meta .status-text.parked {
    color: var(--text-muted);
}

.map-truck-meta .status-text.dormant {
    color: #f97316;
}

.map-truck-meta .speed {
    font-family: 'JetBrains Mono', monospace;
}

/* Truck Fuel Indicator */
.map-truck-fuel {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-secondary);
}

.map-truck-fuel i {
    font-size: 10px;
}

.map-truck-fuel.low {
    color: #f97316;
}

.map-truck-fuel.critical {
    color: var(--status-danger);
}

/* Empty State */
.map-list-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.map-list-empty i {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.map-list-empty p {
    font-size: 13px;
}

/* Map Area fills entire container */
.map-area-with-list {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Responsive - panel becomes full-width overlay on very small screens */
@media (max-width: 480px) {
    .map-truck-list-panel {
        width: 100%;
    }
}
