/* Card Styles for Delivery and Lorry Details Pages */

/* Enhanced Card Styles */
.delivery-card,
.lorry-card {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius-xl);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-8);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.delivery-card:hover,
.lorry-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

.delivery-card::before,
.lorry-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, var(--primary-500), var(--accent-500));
}

.delivery-card h2,
.lorry-card h2 {
  color: var(--primary-700);
  font-size: 1.5rem;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--neutral-200);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.delivery-info,
.lorry-info {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.info-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  background: rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-md);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.info-group:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-2px);
}

.info-group label {
  font-weight: 600;
  color: var(--neutral-600);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.info-group label i {
  color: var(--primary-500);
}

.info-group span {
  font-size: 1.1rem;
  color: var(--neutral-800);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--neutral-200);
}

/* Status Badge Styling */
.status {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status.pending {
  background-color: var(--warning-100);
  color: var(--warning-800);
}

.status.in-transit {
  background-color: var(--primary-100);
  color: var(--primary-800);
}

.status.delivered {
  background-color: var(--success-100);
  color: var(--success-800);
}

.status.available {
  background-color: var(--success-100);
  color: var(--success-800);
}

.status.unavailable {
  background-color: var(--error-100);
  color: var(--error-800);
}

/* Nearby Deliveries Section */
.nearby-deliveries {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--neutral-200);
}

.nearby-deliveries h2 {
  color: var(--primary-700);
  margin-bottom: var(--space-4);
  font-size: 1.3rem;
}

.delivery-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-4);
}

.delivery-item {
  background: var(--glass-bg);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.delivery-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.delivery-info h3 {
  font-size: 1.1rem;
  margin-bottom: var(--space-2);
  color: var(--primary-700);
}

.delivery-details p {
  margin-bottom: var(--space-2);
  font-size: 0.9rem;
}

.delivery-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: auto;
}

/* Loading Animation */
.loading-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(240, 248, 255, 0.9) 100%);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  overflow: hidden;
}

.loading-container.show {
  opacity: 1;
  visibility: visible;
}

/* Truck Road Container */
.truck-road {
  position: relative;
  width: 100%;
  max-width: 900px;
  height: 200px;
  margin-bottom: 40px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Truck Wrapper */
.truck-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: truckMove 4s cubic-bezier(0.42, 0, 0.58, 1) infinite;
}

/* Truck Container */
.truck {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.3));
}

/* Truck Shadow */
.truck::before {
  content: '';
  position: absolute;
  bottom: -50px;
  left: 50%;
  transform: translateX(-50%) scaleX(1.5) scaleY(0.3);
  width: 120px;
  height: 40px;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.3) 0%, transparent 70%);
  border-radius: 50%;
  animation: shadowMove 4s cubic-bezier(0.42, 0, 0.58, 1) infinite;
  z-index: -1;
}

.truck-icon {
  font-size: 90px;
  color: var(--primary-600);
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.4)) 
          drop-shadow(0 0 8px rgba(59, 130, 246, 0.3));
  animation: truckBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite alternate;
  transform-style: preserve-3d;
  transition: transform 0.1s ease-out;
}

/* Truck Wheels with 3D Effect */
.truck-wheels {
  position: relative;
  display: flex;
  gap: 70px;
  margin-top: -20px;
  z-index: 5;
}

.wheel {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.wheel::before {
  content: '';
  position: absolute;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle, #555 30%, #222 70%);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.2),
              0 2px 6px rgba(0, 0, 0, 0.6);
  z-index: -1;
}

.wheel i {
  font-size: 28px;
  color: #1a1a1a;
  animation: wheelSpin 0.4s linear infinite;
  position: relative;
  z-index: 1;
}

.wheel::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle, #444 0%, #111 100%);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Loading Text */
.loading-text {
  margin-top: 30px;
  font-weight: 600;
  color: var(--primary-700);
  letter-spacing: 2px;
  font-size: 1.3rem;
  animation: textPulse 1.5s ease-in-out infinite;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Animations */
@keyframes truckMove {
  0% {
    transform: translateX(-25%) scale(0.95);
  }
  25% {
    transform: translateX(-5%) scale(1);
  }
  50% {
    transform: translateX(25%) scale(1);
  }
  75% {
    transform: translateX(5%) scale(1);
  }
  100% {
    transform: translateX(-25%) scale(0.95);
  }
}

@keyframes shadowMove {
  0% {
    transform: translateX(-25%) scaleX(1.5) scaleY(0.3);
    opacity: 0.6;
  }
  25% {
    transform: translateX(-5%) scaleX(1.3) scaleY(0.35);
    opacity: 0.7;
  }
  50% {
    transform: translateX(25%) scaleX(1.5) scaleY(0.3);
    opacity: 0.6;
  }
  75% {
    transform: translateX(5%) scaleX(1.3) scaleY(0.35);
    opacity: 0.7;
  }
  100% {
    transform: translateX(-25%) scaleX(1.5) scaleY(0.3);
    opacity: 0.6;
  }
}

@keyframes truckBounce {
  0% {
    transform: translateY(0px) rotateZ(0deg);
  }
  50% {
    transform: translateY(-3px) rotateZ(1deg);
  }
  100% {
    transform: translateY(-6px) rotateZ(-1deg);
  }
}

@keyframes wheelSpin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}


@keyframes textPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.05);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .truck-road {
    height: 180px;
    max-width: 100%;
  }
  
  .truck-icon {
    font-size: 70px;
  }
  
  .truck-wheels {
    gap: 55px;
    margin-top: -15px;
  }
  
  .wheel {
    width: 28px;
    height: 28px;
  }
  
  .wheel::before {
    width: 24px;
    height: 24px;
  }
  
  .wheel i {
    font-size: 22px;
  }
  
  .wheel::after {
    width: 16px;
    height: 16px;
  }
  
  .loading-text {
    font-size: 1.1rem;
    margin-top: 20px;
  }
}

/* Pulse Animation for Cards */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
  }
}

/* Responsive Styles */
@media (max-width: 768px) {
  .delivery-info,
  .lorry-info {
    grid-template-columns: 1fr;
  }
  
  .actions {
    flex-direction: column;
  }
  
  .delivery-list {
    grid-template-columns: 1fr;
  }
}