/* Enhanced Autostrada Toll Calculator - Modern Green UI Design System */
/* Version: 2.0 - Complete Green Theme */

/* ========================================
   1. CSS Variables & Design Tokens
   ======================================== */
:root {
  /* Modern Green Color Palette */
  --primary: #10B981;
  --primary-light: #34D399;
  --primary-dark: #059669;
  --primary-rgb: 16, 185, 129;
  
  --secondary: #064E3B;
  --secondary-light: #065F46;
  --secondary-dark: #022C22;
  
  --success: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;
  --info: #3B82F6;
  
  /* Neutral Colors */
  --gray-50: #FAFBFC;
  --gray-100: #F4F6F8;
  --gray-200: #E9EDF0;
  --gray-300: #D7DFE5;
  --gray-400: #B8C4CE;
  --gray-500: #8B9AAB;
  --gray-600: #6B7C8E;
  --gray-700: #4A5568;
  --gray-800: #2D3748;
  --gray-900: #1A202C;
  
  /* Spacing Scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  
  /* Typography */
  --font-system: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", monospace;
  
  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  /* Shadows (Modern elevation system) */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);
  --shadow-2xl: 0 24px 64px rgba(0, 0, 0, 0.24);
  
  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Dark mode variables */
@media (prefers-color-scheme: dark) {
  :root {
    --gray-50: #1A202C;
    --gray-100: #2D3748;
    --gray-900: #FAFBFC;
    --glass-bg: rgba(26, 32, 44, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
  }
}

/* ========================================
   2. Base Styles & Typography
   ======================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-system);
  line-height: 1.6;
  color: var(--gray-900);
   min-height: 100vh;
}

/* Modern Typography Scale */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--secondary);
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h4 { font-size: clamp(1.125rem, 2.5vw, 1.5rem); }

/* ========================================
   3. Main Container
   ======================================== */
.ate-enhanced-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-xl);
  animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   4. Progress Indicator (Modern Stepper)
   ======================================== */
.ate-progress {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2xl);
  padding: var(--space-xl);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-xl);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  position: relative;
}

.ate-progress::before {
  content: "";
  position: absolute;
  top: 40%;
	left: 15%;
  height: 2px;
  background: linear-gradient(90deg, 
    var(--primary) 0%, 
    var(--gray-300) 30%,
    var(--gray-300) 100%);
  z-index: 0;
  transition: var(--transition-base);
	width: 72%;
	
}

.ate-step {
  position: relative;
  z-index: 1;
  text-align: center;
  flex: 1;
  cursor: pointer;
  transition: var(--transition-base);
}

.ate-step-num {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-sm);
  background: white;
  border: 3px solid var(--gray-300);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 18px;
  color: var(--gray-500);
  transition: all var(--transition-spring);
  position: relative;
}

.ate-step.active .ate-step-num {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-color: transparent;
  color: white;
  transform: scale(1.1);
  box-shadow: 0 0 0 8px rgba(var(--primary-rgb), 0.1),
              0 4px 12px rgba(var(--primary-rgb), 0.3);
}

.ate-step.completed .ate-step-num {
  background: var(--success);
  border-color: transparent;
  color: white;
}

.ate-step.completed .ate-step-num::after {
  content: "✓";
  position: absolute;
  font-size: 20px;
}

.ate-step-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-600);
  transition: var(--transition-base);
}

.ate-step.active .ate-step-label {
  color: var(--primary);
  transform: translateY(-2px);
}

/* ========================================
   5. Panels & Cards
   ======================================== */
.ate-panel {
  display: none;
  background: white;
  padding: var(--space-2xl);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  margin-bottom: var(--space-xl);
  position: relative;
  overflow: hidden;
}

.ate-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
}

.ate-panel.active {
  display: block;
  animation: slideIn 0.4s ease-out;
}

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

.ate-panel h3 {
  margin-bottom: var(--space-xl);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* ========================================
   6. Form Elements (Modern Inputs)
   ======================================== */
.ate-field {
  margin-bottom: var(--space-lg);
}

.ate-field label {
  display: block;
  margin-bottom: var(--space-sm);
  font-weight: 600;
  color: var(--gray-700);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ate-field input[type="text"],
.ate-field input[type="number"],
.ate-field select {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 16px;
  background: white;
  transition: all var(--transition-base);
  position: relative;
}

.ate-field input:hover,
.ate-field select:hover {
  border-color: var(--gray-300);
}

.ate-field input:focus,
.ate-field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
  transform: translateY(-1px);
}

.ate-field input.error {
  border-color: var(--error);
  background: #FFF5F5;
  animation: shake 0.3s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Modern Select Dropdown */
.ate-field select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg width='14' height='8' viewBox='0 0 14 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M1 1L7 7L13 1' stroke='%236B7C8E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

/* ========================================
   7. Vehicle Selection (Modern Cards)
   ======================================== */
.ate-vehicles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.ate-vehicle {
  position: relative;
  cursor: pointer;
}

.ate-vehicle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ate-vehicle-box {
  padding: var(--space-lg);
  background: white;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ate-vehicle-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  opacity: 0;
  transition: opacity var(--transition-base);
  z-index: 0;
}

.ate-vehicle:hover .ate-vehicle-box {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.ate-vehicle input:checked + .ate-vehicle-box {
  border-color: var(--primary);
  background: linear-gradient(135deg, #F0FDF4 0%, #DCFCE7 100%);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.2);
}

.ate-vehicle input:checked + .ate-vehicle-box::after {
  content: "✓";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
  from {
    transform: scale(0);
  }
  to {
    transform: scale(1);
  }
}

.ate-v-icon {
  font-size: 42px;
  margin-bottom: var(--space-sm);
  filter: grayscale(0.3);
  transition: all var(--transition-base);
  position: relative;
  z-index: 1;
}

.ate-vehicle input:checked + .ate-vehicle-box .ate-v-icon {
  filter: grayscale(0);
  transform: scale(1.1);
  animation: bounce 0.5s ease-out;
}

@keyframes bounce {
  0%, 100% { transform: scale(1.1); }
  50% { transform: scale(1.2); }
}

.ate-v-name {
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: var(--space-xs);
  font-size: 15px;
  position: relative;
  z-index: 1;
}

.ate-v-rate {
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

/* Custom vehicle styling */
.custom-vehicle-item {
  background: linear-gradient(135deg, #F0FFF4 0%, #E6FFED 100%);
  border-color: var(--success);
}

.ate-custom-vehicle-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: var(--space-lg);
  transition: all var(--transition-base);
  box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.3);
}

.ate-custom-vehicle-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.4);
}

/* ========================================
   8. Quick Picks (Modern Pills)
   ======================================== */
.ate-quick-picks {
  margin-top: var(--space-md);
  padding: var(--space-lg);
  background: var(--gray-50);
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  color: white;
}

.ate-picks-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.ate-pick-btn {
  padding: 10px 16px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-700);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.ate-pick-btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  background: var(--primary);
  transform: translate(-50%, -50%) scale(0);
  border-radius: var(--radius-full);
  transition: transform var(--transition-base);
  z-index: 0;
}

.ate-pick-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.ate-pick-btn.selected,
.ate-pick-btn:active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.ate-pick-btn span {
  position: relative;
  z-index: 1;
}

/* ========================================
   9. Waypoints Styling
   ======================================== */
.ate-waypoint {
  position: relative;
  margin: 15px 0;
  padding: 20px;
  padding-right: 50px;
  background: linear-gradient(135deg, #F0FDF4 0%, #DCFCE7 100%);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  animation: slideIn 0.3s ease;
}

.ate-waypoint-remove {
  position: absolute;
  top: 50%;
  right: 15px;
  transform: translateY(-50%);
  background: var(--error);
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.ate-waypoint-remove:hover {
  background: #DC2626;
  transform: translateY(-50%) rotate(90deg);
}

.ate-waypoint-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-weight: 600;
  color: var(--secondary);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ate-waypoint input,
.ate-waypoint-input {
  width: 100%;
  padding: 12px;
  border: 2px solid #D1FAE5;
  border-radius: 8px;
  font-size: 15px;
  background: white;
  transition: all var(--transition-base);
}

.ate-waypoint input:focus,
.ate-waypoint-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.ate-add-stop {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px auto;
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

.ate-add-stop:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.4);
}

.ate-add-stop:disabled {
  background: var(--gray-300);
  cursor: not-allowed;
  box-shadow: none;
}

/* ========================================
   10. Map Container (Modern Card)
   ======================================== */
.ate-map-container {
  background: white;
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  margin-bottom: var(--space-xl);
  overflow: hidden;
}

.ate-map-controls {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.ate-map-control {
  display: flex;
  align-items: center;
  color: white !important;
  gap: var(--space-sm);
  padding: 10px 16px;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition-base);
  border: 2px solid transparent;
}

.ate-map-control:hover {
  background: var(--gray-100);
  transform: translateY(-1px);
}

.ate-map-control:has(input:checked) {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

#ate-map {
  width: 100%;
  height: 450px;
  border-radius: var(--radius-md);
  border: 2px solid var(--gray-200);
  transition: all var(--transition-base);
}

/* ========================================
   11. Navigation Buttons (Modern CTAs)
   ======================================== */
.ate-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-xl);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  position: sticky;
  bottom: var(--space-xl);
  z-index: 100;
  box-shadow: var(--shadow-xl);
}

.ate-prev,
.ate-next,
.ate-calc,
.ate-new {
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  position: relative;
  overflow: hidden;
}

/* Previous button */
.ate-prev {
  background: white;
  color: var(--gray-700);
  border: 2px solid var(--gray-200);
}

.ate-prev:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
  transform: translateX(-4px);
}

/* Next and Calculate buttons */
.ate-next,
.ate-calc {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.3);
  position: relative;
}

.ate-next::before,
.ate-calc::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%) scale(0);
  border-radius: var(--radius-md);
  transition: transform var(--transition-base);
}

.ate-next:hover,
.ate-calc:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.4);
}

.ate-next:hover::before,
.ate-calc:hover::before {
  transform: translate(-50%, -50%) scale(2);
}

.ate-calc {
  background: linear-gradient(135deg, #059669 0%, #34D399 100%);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
  }
  50% {
    box-shadow: 0 4px 24px rgba(16, 185, 129, 0.5);
  }
}

/* ========================================
   12. Results Section (Modern Display)
   ======================================== */
.ate-results {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-top: var(--space-2xl);
  animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ate-results-header {
  padding: var(--space-2xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.ate-results-header::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  animation: rotate 30s linear infinite;
}

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

.ate-results-header h2 {
  color: white;
  font-size: 32px;
  margin-bottom: var(--space-lg);
  position: relative;
}

.ate-route-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xl);
  color: white;
  font-size: 20px;
  position: relative;
}

/* Cost Display Cards */
.ate-cost-cards {
  padding: var(--space-2xl);
  background: white;
}

.ate-total-card {
  background: linear-gradient(135deg, #064E3B 0%, #10B981 100%);
  color: white;
  padding: var(--space-2xl);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-xl);
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  box-shadow: 0 16px 48px rgba(16, 185, 129, 0.3);
  position: relative;
  overflow: hidden;
}

.ate-total-card::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  animation: rotate 20s linear infinite reverse;
}

.ate-cost-icon {
  font-size: 64px;
  width: 100px;
  height: 100px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.ate-cost-value {
  color: var(--e-global-color-accent) !important;
  font-size: 48px;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.ate-cost-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-lg);
}

.ate-cost-card {
  background: white;
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  border: 2px solid var(--gray-100);
  text-align: center;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.ate-cost-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  transform: scaleX(0);
  transition: transform var(--transition-base);
}

.ate-cost-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.ate-cost-card:hover::before {
  transform: scaleX(1);
}

.ate-cost-icon-small {
  font-size: 36px;
  margin-bottom: var(--space-sm);
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.ate-cost-value-small {
  font-size: 28px;
  font-weight: 700;
  color: var(--secondary);
}

.ate-cost-label {
  font-size: 14px;
  color: white;
  opacity: 0.9;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ate-cost-content {
  position: relative;
  z-index: 1;
}

.ate-cost-breakdown {
  font-size: 16px;
  opacity: 0.95;
}

/* ========================================
   13. Details Section
   ======================================== */
.ate-details-section {
  background: var(--gray-50);
  margin: 0 var(--space-2xl) var(--space-2xl);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.ate-details-header {
  background: white;
  padding: var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all var(--transition-base);
}

.ate-details-header:hover {
  background: var(--gray-50);
}

.ate-details-header h3 {
  margin: 0;
  color: var(--secondary);
  font-size: 19px;
}

.ate-toggle-details {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-600);
  transition: transform var(--transition-base);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ate-toggle-details.active {
  transform: rotate(180deg);
}

.ate-details-content {
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0, 1, 0, 1);
}

.ate-details-content.show {
  max-height: 800px;
  padding: var(--space-xl);
  transition: max-height 0.5s ease-in-out;
}

/* ========================================
   14. Action Buttons
   ======================================== */
.ate-action-buttons {
  padding: var(--space-2xl);
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  background: var(--gray-50);
}

.ate-action-buttons button {
  flex: 1;
  min-width: 150px;
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.ate-share {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.3);
}

.ate-share:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.4);
}

.ate-print {
  background: var(--secondary);
  color: white;
}

.ate-print:hover {
  background: var(--secondary-dark);
  transform: translateY(-2px);
}

.ate-new {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
}

.ate-new:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.4);
}

/* ========================================
   15. Loading States
   ======================================== */
.ate-loading {
  text-align: center;
  padding: var(--space-3xl);
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.ate-spin {
  width: 60px;
  height: 60px;
  margin: 0 auto var(--space-xl);
  position: relative;
}

.ate-spin::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 4px solid var(--gray-200);
  border-radius: var(--radius-full);
}

.ate-spin::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 4px solid transparent;
  border-top-color: var(--primary);
  border-radius: var(--radius-full);
  animation: spin 1s linear infinite;
}

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

/* ========================================
   16. Alerts & Messages
   ======================================== */
.ate-error,
.ate-success,
.ate-warning,
.ate-info {
  padding: 16px 20px;
  margin-bottom: var(--space-lg);
  border-radius: var(--radius-md);
  font-weight: 500;
  animation: slideDown 0.3s ease-out;
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  box-shadow: var(--shadow-md);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ate-error {
  background: #FEF2F2;
  border-left: 4px solid var(--error);
  color: #991B1B;
}

.ate-success {
  background: #F0FDF4;
  border-left: 4px solid var(--success);
  color: #166534;
}

.ate-warning {
  background: #FFFBEB;
  border-left: 4px solid var(--warning);
  color: #92400E;
}

.ate-info {
  background: #F0FDF4;
  border-left: 4px solid var(--info);
  color: #065F46;
}

/* ========================================
   17. Modal
   ======================================== */
.ate-custom-vehicle-modal {
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ate-modal-content {
  background: white;
  padding: var(--space-2xl);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2xl);
  width: 90%;
  max-width: 500px;
  position: relative;
  animation: scaleIn 0.3s ease-out;
}

.ate-modal-content h3 {
  margin-bottom: var(--space-xl);
  color: var(--secondary);
}

.ate-close {
  position: absolute;
  right: var(--space-lg);
  top: var(--space-lg);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--gray-100);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  font-size: 20px;
  color: var(--gray-600);
}

.ate-close:hover {
  background: var(--error);
  color: white;
  transform: rotate(90deg);
}

.ate-btn-save {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: var(--space-xl);
  transition: all var(--transition-base);
  box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.3);
}

.ate-btn-save:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.4);
}

/* ========================================
   18. Accessibility
   ======================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

*:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: var(--radius-sm);
  z-index: 9999;
}

.skip-link:focus {
  top: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --primary: #059669;
    --gray-200: #D1D5DB;
    --gray-700: #374151;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========================================
   19. Responsive Design
   ======================================== */
@media (max-width: 768px) {
  .ate-enhanced-container {
    padding: var(--space-md);
  }
  
  .ate-panel {
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
  }
  
  .ate-progress {
    padding: var(--space-md);
    gap: var(--space-xs);
  }
  
  .ate-step-num {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
  
  .ate-step-label {
    font-size: 12px;
  }
  
  .ate-vehicles {
    grid-template-columns: 1fr;
  }
  
  .ate-cost-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .ate-cost-value {
    font-size: 36px;
  }
  
  .ate-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: var(--space-lg);
  }
  
  .ate-action-buttons {
    flex-direction: column;
  }
  
  .ate-action-buttons button {
    width: 100%;
  }
  
  #ate-map {
    height: 300px;
  }
  
  .ate-total-card {
    flex-direction: column;
    text-align: center;
  }
  
  .ate-route-summary {
    flex-direction: column;
    gap: var(--space-md);
    font-size: 16px;
  }
  
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
}

@media (max-width: 480px) {
  .ate-cost-grid {
    grid-template-columns: 1fr;
  }
  
  .ate-picks-grid {
    flex-direction: column;
  }
  
  .ate-pick-btn {
    width: 100%;
  }
}

/* ========================================
   20. Print Styles
   ======================================== */
@media print {
  .ate-enhanced-container {
    max-width: 100%;
  }
  
  .ate-nav,
  .ate-progress,
  .ate-action-buttons,
  .ate-add-stop,
  .ate-custom-vehicle-btn,
  .ate-map-controls,
  .ate-toggle-details {
    display: none !important;
  }
  
  .ate-results {
    box-shadow: none;
    page-break-inside: avoid;
  }
  
  * {
    background: white !important;
    color: black !important;
  }
}