/* Phase 2: Itinerary & Time Control UI Styles */

.itinerary-controls {
    background: #f0f9ff;
    border: 2px solid #0284c7;
    border-radius: 12px;
    padding: 15px;
    margin: 15px 0;
    display: grid;
    gap: 12px;
}

.itinerary-section-title {
    font-weight: 700;
    color: #0284c7;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

/* Time Control Section */
.time-control-panel {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    display: grid;
    gap: 10px;
}

.time-display {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.time-display-item {
    background: #f0f9ff;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #0284c7;
    text-align: center;
}

.time-display-label {
    font-size: 11px;
    color: #0284c7;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.time-display-value {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    font-family: 'Courier New', monospace;
}

.time-control-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
}

.time-btn {
    padding: 10px;
    border: 2px solid #0284c7;
    background: white;
    color: #0284c7;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.time-btn:hover {
    background: #0284c7;
    color: white;
    transform: translateY(-2px);
}

.time-btn:disabled {
    background: #ccc;
    color: #999;
    border-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.time-btn.active {
    background: #0284c7;
    color: white;
    box-shadow: 0 0 10px rgba(2, 132, 199, 0.5);
}

.speed-multiplier-control {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.speed-label {
    font-weight: 600;
    color: #333;
    font-size: 12px;
}

.speed-buttons {
    display: flex;
    gap: 4px;
}

.speed-btn {
    padding: 6px 10px;
    background: #f0f9ff;
    border: 1px solid #0284c7;
    color: #0284c7;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}

.speed-btn:hover {
    background: #0284c7;
    color: white;
}

.speed-btn.active {
    background: #0284c7;
    color: white;
    box-shadow: 0 0 8px rgba(2, 132, 199, 0.5);
}

/* Route Selection Section */
.route-selection-panel {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    display: grid;
    gap: 10px;
}

.route-selector {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.route-dropdown {
    padding: 10px;
    border: 2px solid #0284c7;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    background: white;
    color: #333;
    cursor: pointer;
    transition: all 0.3s;
}

.route-dropdown:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);
}

.assign-route-btn {
    padding: 10px 15px;
    background: #0284c7;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.assign-route-btn:hover {
    background: #0369a1;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(2, 132, 199, 0.3);
}

.assign-route-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.route-preview {
    background: #f0f9ff;
    padding: 10px;
    border-radius: 6px;
    border-left: 4px solid #0284c7;
    font-size: 12px;
    color: #333;
}

.route-preview-title {
    font-weight: 700;
    color: #0284c7;
    margin-bottom: 4px;
}

.route-preview-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 11px;
}

.route-detail-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
}

.route-detail-label {
    color: #666;
    font-weight: 600;
}

.route-detail-value {
    color: #0284c7;
    font-weight: 700;
}

.route-waypoints-list {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.waypoint-item {
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #0284c7;
    margin-bottom: 6px;
    font-size: 11px;
}

.waypoint-item.active {
    background: #dbeafe;
    border-left-color: #0284c7;
    box-shadow: inset 0 0 0 1px #0284c7;
}

.waypoint-item.completed {
    opacity: 0.6;
    background: #f0f0f0;
    border-left-color: #22c55e;
}

.waypoint-index {
    display: inline-block;
    background: #0284c7;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 700;
    margin-right: 6px;
    font-size: 10px;
}

.waypoint-name {
    font-weight: 600;
    color: #333;
    display: block;
    margin-bottom: 2px;
}

.waypoint-type {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    margin-right: 6px;
}

.waypoint-type.pickup {
    background: #dcfce7;
    color: #166534;
}

.waypoint-type.delivery {
    background: #fee2e2;
    color: #7f1d1d;
}

.waypoint-type.waypoint {
    background: #e0e7ff;
    color: #3730a3;
}

.waypoint-details {
    font-size: 10px;
    color: #666;
    margin-top: 2px;
}

/* Device Route Status (on device cards) */
.device-route-status {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    display: grid;
    gap: 6px;
    font-size: 11px;
}

.route-name-badge {
    display: inline-block;
    background: #0284c7;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 11px;
}

.waypoint-progress {
    display: flex;
    align-items: center;
    gap: 6px;
}

.waypoint-progress-bar {
    flex: 1;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.waypoint-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0284c7, #0369a1);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.waypoint-progress-text {
    font-weight: 600;
    color: #0284c7;
    min-width: 30px;
    text-align: right;
}

.current-waypoint-info {
    background: #f0f9ff;
    padding: 6px;
    border-radius: 4px;
    border-left: 3px solid #0284c7;
    font-size: 10px;
    color: #333;
}

.current-waypoint-label {
    font-weight: 600;
    color: #0284c7;
}

/* Route Control Buttons */
.route-control-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}

.clear-route-btn {
    padding: 8px;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.clear-route-btn:hover {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
}

.random-route-btn {
    padding: 8px;
    background: #dbeafe;
    border: 1px solid #7dd3fc;
    color: #0c4a6e;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.random-route-btn:hover {
    background: #0284c7;
    color: white;
    border-color: #0284c7;
}

/* Responsive */
@media (max-width: 768px) {
    .time-display {
        grid-template-columns: 1fr;
    }

    .time-control-buttons {
        grid-template-columns: 1fr 1fr;
    }

    .route-selector {
        grid-template-columns: 1fr;
    }

    .route-preview-details {
        grid-template-columns: 1fr;
    }

    .route-control-btns {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.time-btn.playing {
    animation: pulse 1s infinite;
}

.waypoint-item.active {
    animation: pulse 1.5s infinite;
}
