/* css/tracking.css - Real-Time Tracking Animations */

/* Driver Marker Animations */
.driver-marker-animated {
    animation: driverPulse 2s infinite;
}

.driver-tracker-pulse {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.driver-tracker-pulse .pulse {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 3px solid #10b981;
    border-radius: 50%;
    animation: expandPulse 2s infinite;
    opacity: 1;
}

.driver-tracker-pulse .dot {
    position: relative;
    z-index: 10;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: rgba(16, 185, 129, 0.2);
    border-radius: 50%;
    animation: rotateDot 3s linear infinite;
}

@keyframes driverPulse {
    0%, 100% {
        filter: drop-shadow(0 0 3px rgba(16, 185, 129, 0.4));
    }
    50% {
        filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.8));
    }
}

@keyframes expandPulse {
    0% {
        width: 15px;
        height: 15px;
        opacity: 0.9;
    }
    100% {
        width: 40px;
        height: 40px;
        opacity: 0;
    }
}

@keyframes rotateDot {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Marker Bounce Animation */
.marker-bounce {
    animation: markerBounce 0.6s ease-in-out;
}

@keyframes markerBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* Geofence Ring Animation */
.geofence-ring {
    animation: geofencePulse 2s infinite;
}

@keyframes geofencePulse {
    0%, 100% { stroke-opacity: 0.6; }
    50% { stroke-opacity: 1; }
}

/* Optimized Route Glow */
.optimized-route {
    filter: drop-shadow(0 0 4px rgba(52, 152, 219, 0.6));
    animation: routeGlow 3s ease-in-out infinite;
}

@keyframes routeGlow {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(52, 152, 219, 0.6)); }
    50% { filter: drop-shadow(0 0 8px rgba(52, 152, 219, 1)); }
}

/* Map Controls Enhancement */
.leaflet-control-container .leaflet-top,
.leaflet-control-container .leaflet-bottom {
    z-index: 999;
}

.leaflet-control {
    background: rgba(30, 41, 59, 0.8) !important;
    border: 1px solid rgba(46, 204, 113, 0.3) !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    backdrop-filter: blur(10px);
}

.leaflet-control button {
    background: rgba(30, 41, 59, 0.9) !important;
    border: 1px solid rgba(46, 204, 113, 0.2) !important;
    color: rgba(255, 255, 255, 0.8) !important;
    transition: all 0.3s ease !important;
    border-radius: 4px !important;
}

.leaflet-control button:hover {
    background: rgba(46, 204, 113, 0.2) !important;
    border-color: rgba(46, 204, 113, 0.5) !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.2) !important;
}

/* Popup Styling */
.leaflet-popup-content-wrapper {
    background: rgba(30, 41, 59, 0.95) !important;
    border: 1px solid rgba(46, 204, 113, 0.3) !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
    backdrop-filter: blur(10px);
}

.leaflet-popup-tip {
    background: rgba(30, 41, 59, 0.95) !important;
    border: 1px solid rgba(46, 204, 113, 0.3) !important;
}

.leaflet-popup-content {
    margin: 0 !important;
    color: white;
}

/* Scale Control */
.leaflet-control-scale-line {
    background: rgba(30, 41, 59, 0.8) !important;
    border: 1px solid rgba(46, 204, 113, 0.3) !important;
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 500 !important;
    backdrop-filter: blur(10px);
}

/* Breadcrumb Trail */
.driver-path-trail {
    filter: drop-shadow(0 0 2px rgba(16, 185, 129, 0.4));
}

/* Bike Marker Animations */
.bike-marker {
    animation: bikePulse 1.5s ease-in-out infinite;
    transform-origin: center;
}

.bike-marker-animated {
    animation: bikeFloat 2s ease-in-out infinite;
}

@keyframes bikePulse {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 0 3px rgba(243, 156, 18, 0.6));
    }
    50% {
        transform: scale(1.1) rotate(3deg);
        filter: drop-shadow(0 0 8px rgba(243, 156, 18, 1));
    }
}

@keyframes bikeFloat {
    0%, 100% {
        transform: translateY(0px) scale(1);
    }
    50% {
        transform: translateY(-8px) scale(1.05);
    }
}

.bike-path-animation {
    animation: bikeMove 20s linear infinite;
}

@keyframes bikeMove {
    0% { offset-distance: 0%; }
    100% { offset-distance: 100%; }
}

/* Delivery Agent Animations */
.delivery-agent-marker {
    animation: agentBounce 1s ease-in-out infinite;
    transform-origin: center;
}

.delivery-agent-animated {
    animation: agentFloat 2.5s ease-in-out infinite;
}

@keyframes agentBounce {
    0%, 100% {
        transform: translateY(0px) scale(1);
        filter: drop-shadow(0 0 2px rgba(231, 76, 60, 0.6));
    }
    25% {
        transform: translateY(-12px) scale(1.05);
        filter: drop-shadow(0 0 6px rgba(231, 76, 60, 0.8));
    }
    50% {
        transform: translateY(-8px) scale(1.08);
        filter: drop-shadow(0 0 8px rgba(231, 76, 60, 1));
    }
    75% {
        transform: translateY(-4px) scale(1.05);
        filter: drop-shadow(0 0 6px rgba(231, 76, 60, 0.8));
    }
}

@keyframes agentFloat {
    0%, 100% {
        transform: translateY(0px) scale(1);
    }
    50% {
        transform: translateY(-10px) scale(1.08);
    }
}

/* Waypoint Path Hyphen Dashes */
.waypoint-path {
    animation: waypointDash 1.5s linear infinite;
}

@keyframes waypointDash {
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -10; }
}

.delivery-path-line {
    stroke: #e74c3c;
    stroke-width: 3;
    stroke-dasharray: 5, 5;
    opacity: 0.6;
    filter: drop-shadow(0 0 2px rgba(231, 76, 60, 0.5));
    animation: waypointDash 2s linear infinite;
}

/* Live Status Indicator */
.live-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 16px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.9), rgba(16, 185, 129, 0.7));
    border: 1px solid rgba(16, 185, 129, 0.5);
    border-radius: 20px;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    animation: liveIndicatorPulse 2s infinite;
    z-index: 1000;
}

.live-indicator::before {
    content: "🟢";
    animation: livePulse 1s infinite;
}

@keyframes liveIndicatorPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

@keyframes livePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Enhanced Delivery Agent with Location Pin Design */
.delivery-agent-marker-enhanced {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.delivery-agent-animated-enhanced {
    animation: agentPulse 1.5s ease-in-out infinite;
}

@keyframes agentPulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 2px 6px rgba(231, 76, 60, 0.5));
    }
    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 4px 12px rgba(231, 76, 60, 0.8));
    }
}

/* Location Pin Animation */
.location-pin-glow {
    animation: pinGlow 1.5s ease-in-out infinite;
}

@keyframes pinGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(231, 76, 60, 0.4), inset 0 1px 2px rgba(255,255,255,0.2);
    }
    50% {
        box-shadow: 0 0 20px rgba(231, 76, 60, 0.8), inset 0 1px 2px rgba(255,255,255,0.3);
    }
}

/* Waypoint Marker Animation */
.waypoint-marker {
    animation: waypointBounce 1.2s ease-in-out infinite;
}

@keyframes waypointBounce {
    0%, 100% {
        transform: translateY(0px) scale(1);
    }
    50% {
        transform: translateY(-8px) scale(1.05);
    }
}

/* Delivery Path Line with Enhanced Design */
.delivery-path-enhanced {
    stroke: linear-gradient(90deg, #3498db, #2ecc71);
    stroke-width: 4;
    stroke-dasharray: 10, 5;
    opacity: 0.8;
    filter: drop-shadow(0 0 3px rgba(52, 152, 219, 0.6));
    animation: pathFlow 2s linear infinite;
}

@keyframes pathFlow {
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -15; }
}

/* Status Badge Animation */
.status-badge-delivery {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.9), rgba(52, 152, 219, 0.9));
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    animation: badgePulse 1.5s ease-in-out infinite;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 16px rgba(46, 204, 113, 0.5);
    }
}

/* Delivery Complete Animation */
.delivery-complete-popup {
    animation: completeSwing 0.8s ease-in-out;
}

@keyframes completeSwing {
    0% {
        transform: scale(0.8) rotate(-10deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.1) rotate(5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Location Symbol Glow */
.location-symbol {
    display: inline-block;
    animation: symbolGlow 1.5s ease-in-out infinite;
}

@keyframes symbolGlow {
    0%, 100% {
        text-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
    }
    50% {
        text-shadow: 0 0 15px rgba(52, 152, 219, 1);
    }
}

