/* GlobalDealHunter - Custom Styles */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #7c3aed;
  --accent: #f97316;
  --success: #16a34a;
  --danger: #dc2626;
}

* { box-sizing: border-box; }

body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } 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.5; } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: -1000px 0; } 100% { background-position: 1000px 0; } }
@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.fade-in { animation: fadeIn 0.4s ease-out; }
.slide-in { animation: slideIn 0.3s ease-out; }
.spin { animation: spin 1s linear infinite; }

/* Hero gradient */
.hero-gradient {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 30%, #7c3aed 60%, #4f46e5 100%);
  background-size: 400% 400%;
  animation: gradientMove 15s ease infinite;
}

/* Glass morphism */
.glass {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-dark {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Search Tabs */
.search-tab {
  padding: 10px 20px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  color: rgba(255,255,255,0.7);
  border: none;
  background: rgba(255,255,255,0.1);
}
.search-tab:hover { color: white; background: rgba(255,255,255,0.2); }
.search-tab.active {
  background: white;
  color: #1d4ed8;
  font-weight: 600;
}

/* Search Card */
.search-card {
  background: white;
  border-radius: 0 12px 12px 12px;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

/* Input styles */
.search-input {
  width: 100%;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.search-input:focus { border-color: #2563eb; }

.search-input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 14px;
}

/* Result cards */
.result-card {
  background: white;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  transition: all 0.2s ease;
  overflow: hidden;
}
.result-card:hover {
  border-color: #2563eb;
  box-shadow: 0 8px 30px rgba(37,99,235,0.15);
  transform: translateY(-2px);
}

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-green { background: #dcfce7; color: #16a34a; }
.badge-orange { background: #fed7aa; color: #c2410c; }
.badge-purple { background: #ede9fe; color: #6d28d9; }
.badge-red { background: #fee2e2; color: #dc2626; }
.badge-gray { background: #f3f4f6; color: #6b7280; }

/* Price display */
.price-tag { font-size: 24px; font-weight: 800; color: #1d4ed8; line-height: 1; }
.price-sub { font-size: 12px; color: #6b7280; margin-top: 2px; }

/* Best deal indicator */
.best-deal-badge {
  background: linear-gradient(135deg, #f97316, #ef4444);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Cheapest badge */
.cheapest-badge {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

/* Stars */
.star { color: #fbbf24; }
.star-empty { color: #d1d5db; }

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
  border-radius: 6px;
}

/* Sidebar filter */
.filter-section { border-bottom: 1px solid #e5e7eb; padding-bottom: 20px; margin-bottom: 20px; }
.filter-section:last-child { border-bottom: none; margin-bottom: 0; }
.filter-label { font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 12px; }

/* Range slider */
input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: #dbeafe;
  border-radius: 2px;
  outline: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: #2563eb;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* Checkbox */
.custom-checkbox { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; color: #374151; padding: 4px 0; }
.custom-checkbox input[type=checkbox] { width: 16px; height: 16px; accent-color: #2563eb; cursor: pointer; }

/* Nav */
.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: #4b5563;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
}
.nav-link:hover { color: #2563eb; background: #eff6ff; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
  backdrop-filter: blur(4px);
}
.modal-box {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideIn 0.3s ease;
  box-shadow: 0 25px 80px rgba(0,0,0,0.3);
}

/* Toast notifications */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  padding: 14px 20px;
  border-radius: 10px;
  color: white;
  font-size: 14px;
  font-weight: 500;
  min-width: 280px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  animation: slideIn 0.3s ease;
}
.toast-success { background: #16a34a; }
.toast-error { background: #dc2626; }
.toast-info { background: #2563eb; }
.toast-warning { background: #d97706; }

/* Flight timeline */
.flight-line { height: 2px; background: #d1d5db; flex: 1; position: relative; }
.flight-line::after {
  content: '';
  position: absolute;
  right: 0;
  top: -4px;
  width: 10px;
  height: 10px;
  border-right: 2px solid #d1d5db;
  border-top: 2px solid #d1d5db;
  transform: rotate(45deg);
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
}
.btn-primary:hover { background: linear-gradient(135deg, #1d4ed8, #1e40af); transform: translateY(-1px); box-shadow: 0 4px 15px rgba(37,99,235,0.4); }
.btn-secondary { background: white; color: #2563eb; font-weight: 600; padding: 10px 24px; border-radius: 8px; border: 2px solid #2563eb; cursor: pointer; transition: all 0.2s; font-size: 14px; }
.btn-secondary:hover { background: #eff6ff; }
.btn-accent { background: linear-gradient(135deg, #f97316, #ea580c); color: white; font-weight: 600; padding: 10px 24px; border-radius: 8px; border: none; cursor: pointer; transition: all 0.2s; font-size: 14px; }
.btn-accent:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(249,115,22,0.4); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 14px 32px; font-size: 16px; }

/* Dashboard */
.stat-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  border: 1px solid #e5e7eb;
  transition: all 0.2s;
}
.stat-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.08); }

/* Search panel autocomplete */
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  z-index: 100;
  max-height: 200px;
  overflow-y: auto;
  margin-top: 4px;
}
.autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.15s;
}
.autocomplete-item:hover { background: #f0f7ff; }

/* Tabs */
.tab-btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  background: transparent;
  color: #6b7280;
}
.tab-btn.active { background: #2563eb; color: white; }
.tab-btn:hover:not(.active) { background: #f3f4f6; color: #1f2937; }

/* Sort bar */
.sort-btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid #e5e7eb;
  background: white;
  color: #6b7280;
  transition: all 0.2s;
}
.sort-btn.active {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

/* Mobile */
@media (max-width: 768px) {
  .search-card { border-radius: 12px; padding: 20px; }
  .hero-gradient { padding: 40px 16px 80px; }
  .price-tag { font-size: 20px; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Provider logos */
.provider-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #4b5563;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  padding: 3px 10px;
  border-radius: 20px;
}

/* AI Recommendation */
.ai-badge {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Chart container */
.chart-container {
  position: relative;
  width: 100%;
  height: 200px;
}

/* Loading spinner */
.loader {
  width: 40px;
  height: 40px;
  border: 4px solid #e5e7eb;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Hero search tabs responsive */
@media (max-width: 640px) {
  .search-tabs-wrapper { display: flex; overflow-x: auto; gap: 4px; padding-bottom: 0; }
  .search-tab { white-space: nowrap; font-size: 12px; padding: 8px 12px; }
}
