@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Reset and Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
}

body {
    margin: 0;
    line-height: inherit;
    font-weight: 400;
}

button, input {
    font-family: inherit;
    font-size: 100%;
    font-weight: 500;
    color: inherit;
    margin: 0;
    padding: 0;
    border: 0;
    background-color: transparent;
}

/* Layout */
.min-h-screen { min-height: 100vh; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.inline-block { display: inline-block; }
.hidden { display: none; }
.fixed { position: fixed; }
.absolute { position: absolute; }
.relative { position: relative; }

.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }

/* Sizing */
.w-full { width: 100%; }
.w-2 { width: 0.5rem; }
.w-5 { width: 1.25rem; }
.w-16 { width: 4rem; }
.max-w-4xl { max-width: 64rem; }
.max-w-2xl { max-width: 42rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

.h-2 { height: 0.5rem; }
.h-5 { height: 1.25rem; }
.h-16 { height: 4rem; }

/* Spacing */
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-5 { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.pl-14 { padding-left: 3.5rem; }
.pr-8 { padding-right: 2rem; }

.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.75rem; }
.mr-4 { margin-right: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

.gap-4 { gap: 1rem; }
.space-x-2 > :not([hidden]) ~ :not([hidden]) { margin-left: 0.5rem; }
.space-y-4 > :not([hidden]) ~ :not([hidden]) { margin-top: 1rem; }
.space-y-6 > :not([hidden]) ~ :not([hidden]) { margin-top: 1.5rem; }

/* Position */
.top-6 { top: 1.5rem; }
.right-6 { right: 1.5rem; }
.left-5 { left: 1.25rem; }
.top-1\/2 { top: 50%; }
.z-50 { z-index: 50; }
.z-10 { z-index: 10; }

/* Typography */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-center { text-align: center; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.025em; }
.whitespace-nowrap { white-space: nowrap; }

/* Colors */
.text-white { color: rgb(255 255 255); }
.text-slate-400 { color: rgb(148 163 184); }
.text-slate-500 { color: rgb(100 116 139); }
.text-slate-600 { color: rgb(71 85 105); }
.text-slate-900 { color: rgb(15 23 42); }
.text-blue-600 { color: rgb(37 99 235); }
.text-blue-700 { color: rgb(29 78 216); }
.text-blue-900 { color: rgb(30 58 138); }
.text-yellow-500 { color: rgb(234 179 8); }
.text-blue-400 { color: rgb(96 165 250); }
.text-red-500 { color: rgb(239 68 68); }
.text-red-700 { color: rgb(185 28 28); }
.text-green-700 { color: rgb(21 128 61); }
.text-orange-700 { color: rgb(194 65 12); }
.text-gray-700 { color: rgb(55 65 81); }

.bg-white { background-color: rgb(255 255 255); }
.bg-slate-50 { background-color: rgb(248 250 252); }
.bg-slate-200 { background-color: rgb(226 232 240); }
.bg-blue-600 { background-color: rgb(37 99 235); }
.bg-green-400 { background-color: rgb(74 222 128); }
.bg-red-50 { background-color: rgb(254 242 242); }
.bg-green-100 { background-color: rgb(220 252 231); }
.bg-blue-100 { background-color: rgb(219 234 254); }
.bg-orange-100 { background-color: rgb(255 237 213); }
.bg-red-100 { background-color: rgb(254 226 226); }
.bg-gray-100 { background-color: rgb(243 244 246); }
.bg-gray-800 { background-color: rgb(31 41 55); }
.bg-gray-700 { background-color: rgb(55 65 81); }
.bg-gray-600 { background-color: rgb(75 85 99); }

/* Borders */
.border { border-width: 1px; }
.border-2 { border-width: 2px; }
.border-gray-200 { border-color: rgb(229 231 235); }
.border-gray-600 { border-color: rgb(75 85 99); }
.border-gray-700 { border-color: rgb(55 65 81); }
.border-red-200 { border-color: rgb(254 202 202); }
.border-red-800 { border-color: rgb(153 27 27); }
.border-green-200 { border-color: rgb(187 247 208); }
.border-blue-200 { border-color: rgb(191 219 254); }
.border-orange-200 { border-color: rgb(254 215 170); }
.border-gray-100 { border-color: rgb(243 244 246); }

.rounded-full { border-radius: 9999px; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-3xl { border-radius: 1.5rem; }

/* Effects */
.shadow-lg { box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1); }
.opacity-80 { opacity: 0.8; }

/* Transitions */
.transition-colors { transition-property: color, background-color, border-color; transition-duration: 150ms; }
.transition-all { transition-property: all; transition-duration: 150ms; }
.duration-200 { transition-duration: 200ms; }
.duration-300 { transition-duration: 300ms; }

.transform { transform: translate(var(--tw-translate-x), var(--tw-translate-y)); }
.-translate-y-1\/2 { transform: translateY(-50%); }

.cursor-not-allowed { cursor: not-allowed; }

/* Focus States */
.focus\:outline-none:focus { outline: 2px solid transparent; outline-offset: 2px; }
.focus\:ring-2:focus { box-shadow: 0 0 0 3px rgb(59 130 246 / 0.5); }
.focus\:ring-4:focus { box-shadow: 0 0 0 6px rgb(59 130 246 / 0.3); }
.focus\:border-transparent:focus { border-color: transparent; }
.focus\:border-blue-400:focus { border-color: rgb(96 165 250); }
.focus\:ring-blue-300:focus { box-shadow: 0 0 0 3px rgb(147 197 253 / 0.5); }

/* Background Gradients */
.bg-gradient-to-br { background-image: linear-gradient(to bottom right, var(--tw-gradient-from), var(--tw-gradient-to)); }
.bg-gradient-to-r { background-image: linear-gradient(to right, var(--tw-gradient-from), var(--tw-gradient-to)); }

.from-slate-50 { --tw-gradient-from: rgb(248 250 252); }
.via-blue-50 { --tw-gradient-to: rgb(239 246 255); }
.to-indigo-100 { --tw-gradient-to: rgb(224 231 255); }
.from-blue-600 { --tw-gradient-from: rgb(37 99 235); }
.to-indigo-600 { --tw-gradient-to: rgb(79 70 229); }
.to-indigo-700 { --tw-gradient-to: rgb(67 56 202); }

.hover\:from-blue-700:hover { --tw-gradient-from: rgb(29 78 216); }
.hover\:to-indigo-700:hover { --tw-gradient-to: rgb(67 56 202); }

/* Dark Mode */
.dark .dark\:from-gray-900 { --tw-gradient-from: rgb(17 24 39); }
.dark .dark\:via-gray-800 { --tw-gradient-to: rgb(31 41 55); }
.dark .dark\:to-gray-900 { --tw-gradient-to: rgb(17 24 39); }
.dark .dark\:bg-gray-800 { background-color: rgb(31 41 55); }
.dark .dark\:bg-gray-700 { background-color: rgb(55 65 81); }
.dark .dark\:bg-gray-600 { background-color: rgb(75 85 99); }
.dark .dark\:bg-red-900 { background-color: rgb(127 29 29); }
.dark .dark\:border-gray-700 { border-color: rgb(55 65 81); }
.dark .dark\:border-gray-600 { border-color: rgb(75 85 99); }
.dark .dark\:border-red-800 { border-color: rgb(153 27 27); }
.dark .dark\:text-white { color: rgb(255 255 255); }
.dark .dark\:text-slate-300 { color: rgb(203 213 225); }
.dark .dark\:text-slate-400 { color: rgb(148 163 184); }
.dark .dark\:text-slate-500 { color: rgb(100 116 139); }
.dark .dark\:text-gray-300 { color: rgb(209 213 219); }
.dark .dark\:text-gray-500 { color: rgb(107 114 128); }
.dark .dark\:text-red-300 { color: rgb(252 165 165); }
.dark .dark\:text-red-400 { color: rgb(248 113 113); }
.dark .dark\:placeholder-gray-400::placeholder { color: rgb(156 163 175); }

.dark .bg-slate-50 { background-color: rgb(55 65 81 / 0.5); }
.dark .bg-slate-200 { background-color: rgb(75 85 99); }

.dark .bg-green-100 { background-color: rgba(34, 197, 94, 0.2); }
.dark .text-green-700 { color: rgb(74, 222, 128); }
.dark .border-green-200 { border-color: rgba(34, 197, 94, 0.3); }

.dark .bg-blue-100 { background-color: rgba(59, 130, 246, 0.2); }
.dark .text-blue-700 { color: rgb(96, 165, 250); }
.dark .border-blue-200 { border-color: rgba(59, 130, 246, 0.3); }

.dark .bg-orange-100 { background-color: rgba(249, 115, 22, 0.2); }
.dark .text-orange-700 { color: rgb(251, 146, 60); }
.dark .border-orange-200 { border-color: rgba(249, 115, 22, 0.3); }

.dark .bg-red-100 { background-color: rgba(239, 68, 68, 0.2); }
.dark .text-red-700 { color: rgb(248, 113, 113); }
.dark .border-red-200 { border-color: rgba(239, 68, 68, 0.3); }

/* Custom Components */
.icon {
    width: 1.25rem;
    height: 1.25rem;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-lg {
    width: 2rem;
    height: 2rem;
}

.input-focus {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.input-focus:focus {
    transform: translateY(-2px);
}

.button-hover {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.button-hover:hover:not(:disabled) {
    transform: translateY(-2px);
}

.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
}

.status-pulse {
    position: relative;
    overflow: hidden;
}

.status-pulse::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

.aircraft-highlight {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe, #93c5fd);
    position: relative;
    overflow: hidden;
}

.aircraft-highlight::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    animation: rotate 8s linear infinite;
}

.floating {
    animation: float 3s ease-in-out infinite;
}

.dark-mode-toggle {
    transition: all 0.3s ease;
}

.dark-mode-toggle:hover {
    transform: scale(1.05);
}

/* Ensure input container can shrink and not overflow */
.relative.flex-1.min-w-0 {
    min-width: 0;
}

/* Prevent button from shrinking */
.flex-shrink-0 {
    flex-shrink: 0;
}

/* Responsive: stack input and button vertically on small screens */
@media (max-width: 500px) {
  .flex.flex-wrap.gap-4.mb-4.justify-center {
    flex-direction: column;
    gap: 0.5rem;
  }
  .flex.flex-wrap.gap-4.mb-4.justify-center > .relative.flex-1.min-w-0,
  .flex.flex-wrap.gap-4.mb-4.justify-center > .flex-shrink-0 {
    width: 100%;
    max-width: 100%;
  }
  .flex.flex-wrap.gap-4.mb-4.justify-center > .flex-shrink-0 {
    margin-left: 0;
  }
}

.route-tooltip {
  display: none;
  position: absolute;
  left: 50%;
  top: 120%;
  transform: translateX(-50%);
  margin-top: 0.5em;
  background: #fff;
  color: #334155;
  border: 1px solid #e5e7eb;
  border-radius: 0.75em;
  box-shadow: 0 4px 16px rgba(30, 41, 59, 0.10);
  padding: 0.5em 1em;
  z-index: 50;
  white-space: nowrap;
  font-size: 0.85em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s cubic-bezier(.4,0,.2,1);
}
.dark .route-tooltip {
  background: #1e293b;
  color: #e0e7ef;
  border: 1px solid #334155;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.route-tooltip.show {
  display: block;
  opacity: 1;
  pointer-events: auto;
}
.route-tooltip::after {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 0 8px 8px 8px;
  border-style: solid;
  border-color: transparent transparent #fff transparent;
}
.dark .route-tooltip::after {
  border-color: transparent transparent #1e293b transparent;
}