/* ============================================
   Vuelos Baratos - Estilos Globales
   ============================================ */

:root {
  --primary: #667eea;
  --primary-dark: #5a67d8;
  --primary-light: #a3bffa;
  --secondary: #764ba2;
  --accent: #f6ad55;
  --success: #48bb78;
  --danger: #fc8181;
  --warning: #ecc94b;
  --dark: #2d3748;
  --gray-900: #1a202c;
  --gray-700: #4a5568;
  --gray-500: #a0aec0;
  --gray-300: #e2e8f0;
  --gray-100: #f7fafc;
  --white: #ffffff;
  --gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 8px;
  --radius-lg: 12px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--dark);
  background: var(--gray-100);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ---- Navbar ---- */
.navbar {
  background: var(--white);
  box-shadow: var(--shadow);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.navbar-brand span {
  font-size: 1.5rem;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.navbar-nav a {
  padding: 8px 16px;
  border-radius: var(--radius);
  color: var(--gray-700);
  font-weight: 500;
  transition: all 0.2s;
}

.navbar-nav a:hover,
.navbar-nav a.active {
  background: var(--gray-100);
  color: var(--primary);
  text-decoration: none;
}

.navbar-auth {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---- Hero ---- */
.hero {
  background: var(--gradient);
  padding: 60px 24px;
  text-align: center;
  color: var(--white);
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.hero p {
  font-size: 1.15rem;
  opacity: 0.9;
}

/* ---- Container ---- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.btn-primary {
  background: var(--gradient);
  color: var(--white);
}

.btn-secondary {
  background: var(--white);
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}

.btn-success {
  background: var(--success);
  color: var(--white);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1.1rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ---- Forms ---- */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gray-700);
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: border-color 0.2s;
  background: var(--white);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

/* ---- Search Box ---- */
.search-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  margin-top: -40px;
  position: relative;
  z-index: 10;
}

.search-box .form-row {
  grid-template-columns: 1fr 1fr 1fr 1fr auto;
  align-items: end;
}

/* ---- Autocomplete ---- */
.autocomplete-wrapper {
  position: relative;
}

.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border: 2px solid var(--gray-300);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  max-height: 250px;
  overflow-y: auto;
  z-index: 50;
  display: none;
}

.autocomplete-list.active {
  display: block;
}

.autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--gray-100);
}

.autocomplete-item:hover,
.autocomplete-item.highlighted {
  background: var(--gray-100);
}

.autocomplete-item .code {
  font-weight: 700;
  color: var(--primary);
  margin-right: 8px;
}

.autocomplete-item .city {
  font-weight: 500;
}

.autocomplete-item .country {
  font-size: 0.85rem;
  color: var(--gray-500);
}

/* ---- Page header ---- */
.page-header {
  padding: 32px 0 16px;
}

.page-header h2 {
  font-size: 1.5rem;
}

/* ---- Alerts/Notifications ---- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-weight: 500;
}

.alert-error {
  background: #fff5f5;
  color: #c53030;
  border: 1px solid #feb2b2;
}

.alert-success {
  background: #f0fff4;
  color: #276749;
  border: 1px solid #9ae6b4;
}

.alert-info {
  background: #ebf8ff;
  color: #2b6cb0;
  border: 1px solid #90cdf4;
}

/* ---- Loading spinner ---- */
.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--gray-300);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-lg {
  width: 48px;
  height: 48px;
  border-width: 4px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  gap: 16px;
  color: var(--gray-500);
}

/* ---- Empty state ---- */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--gray-500);
}

.empty-state .icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

/* ---- Footer ---- */
.footer {
  background: var(--gray-900);
  color: var(--gray-500);
  text-align: center;
  padding: 24px;
  margin-top: 60px;
  font-size: 0.9rem;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 1.75rem;
  }

  .search-box .form-row {
    grid-template-columns: 1fr;
  }

  .navbar-nav {
    display: none;
  }

  .container {
    padding: 0 16px;
  }

  .search-box {
    padding: 20px;
    margin-top: -24px;
  }
}

/* ---- Utilities ---- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.hidden { display: none !important; }

/* Badge */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-success { background: #c6f6d5; color: #276749; }
.badge-warning { background: #fefcbf; color: #975a16; }
.badge-danger { background: #fed7d7; color: #9b2c2c; }
