/* Enhanced Dynamic Toll Calculator Styles */

/* Custom animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

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

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Loading animation */
.loading {
  animation: spin 1s linear infinite;
}

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

.slide-in {
  animation: slideIn 0.3s ease-out;
}

/* Enhanced form styling */
.form-input:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  border-color: #3B82F6;
}

.form-input:hover {
  border-color: #6B7280;
}

/* Custom button styles */
.btn-primary {
  background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
  transition: all 0.3s ease;
  box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1D4ED8 0%, #1E3A8A 100%);
  box-shadow: 0 6px 20px 0 rgba(59, 130, 246, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: linear-gradient(135deg, #F3F4F6 0%, #E5E7EB 100%);
  color: #374151;
  border: 1px solid #D1D5DB;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #E5E7EB 0%, #D1D5DB 100%);
  transform: translateY(-1px);
}

/* Route card styles */
.route-card {
  border-left: 4px solid transparent;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.route-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.03) 0%, rgba(239, 68, 68, 0.03) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.route-card:hover::before {
  opacity: 1;
}

.route-card.shortest {
  border-left-color: #3B82F6;
}

.route-card.cheapest {
  border-left-color: #10B981;
}

.route-card:hover {
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}

/* Cost display */
.cost-highlight {
  background: linear-gradient(135deg, #FEF3C7 0%, #FCD34D 100%);
  color: #92400E;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-weight: 600;
  display: inline-block;
}

.cost-saving {
  background: linear-gradient(135deg, #D1FAE5 0%, #10B981 100%);
  color: #065F46;
}

/* Map container enhancements */
#mapContainer {
  background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
  border: 2px dashed #CBD5E1;
  border-radius: 12px;
  min-height: 400px;
  position: relative;
  overflow: hidden;
}

#mapContainer::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 25% 25%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

/* Progress indicators */
.progress-indicator {
  width: 100%;
  height: 4px;
  background-color: #E5E7EB;
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #3B82F6, #10B981);
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* Toll point indicators */
.toll-point {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  margin: 0.5rem 0;
  background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.toll-point:hover {
  border-color: #3B82F6;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.toll-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
}

/* Status indicators */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
}

.status-calculating {
  background-color: #FEF3C7;
  color: #92400E;
}

.status-success {
  background-color: #D1FAE5;
  color: #065F46;
}

.status-error {
  background-color: #FEE2E2;
  color: #991B1B;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .route-card {
    margin: 0.5rem 0;
  }
  
  #mapContainer {
    min-height: 300px;
  }
  
  .grid {
    gap: 1rem;
  }
  
  .btn-group {
    flex-direction: column;
  }
  
  .btn-group button {
    width: 100%;
    margin: 0.25rem 0;
  }
}

/* Export section enhancements */
.export-btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

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

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

/* Header enhancements */
.header-gradient {
  background: linear-gradient(135deg, #FFFFFF 0%, #F8FAFC 100%);
  border-bottom: 1px solid #E2E8F0;
}

/* Form enhancements */
.form-group {
  position: relative;
}

.form-label {
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
  display: block;
}

.form-select,
.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #E5E7EB;
  border-radius: 8px;
  background-color: #FFFFFF;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.form-select:focus,
.form-input:focus {
  outline: none;
  border-color: #3B82F6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Utility classes */
.text-gradient {
  background: linear-gradient(135deg, #3B82F6 0%, #10B981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass-effect {
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.shadow-soft {
  box-shadow: 0 2px 15px -3px rgba(0, 0, 0, 0.07), 0 10px 20px -2px rgba(0, 0, 0, 0.04);
}

/* Loading spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #E5E7EB;
  border-top: 2px solid #3B82F6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #F1F5F9;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #3B82F6, #10B981);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #1D4ED8, #059669);
}

/* Notification styles */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  max-width: 400px;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.notification.show {
  transform: translateX(0);
}

.notification.success {
  background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
  color: #065F46;
  border-left: 4px solid #10B981;
}

.notification.error {
  background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
  color: #991B1B;
  border-left: 4px solid #EF4444;
}