/* Custom styles for Sandwich Host Availability - Premium UI */

/* Premium Typography */
* {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  overflow-x: hidden;
  width: 100%;
}

body {
  background: linear-gradient(135deg, #E8F8FF 0%, #D6F1FB 100%);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

/* Icon replacements */
.lucide-search::before { content: '🔍'; }
.lucide-locate::before { content: '📍'; }
.lucide-navigation::before { content: '🧭'; }
.lucide-clock::before { content: '🕐'; }
.lucide-phone::before { content: '📞'; }
.lucide-alert-circle::before { content: '⚠️'; }
.lucide-map::before { content: '🗺️'; }
.lucide-map-pin::before { content: '📌'; }

/* Premium Card Shadows */
.premium-card {
  box-shadow:
    0 1px 3px rgba(35, 99, 131, 0.08),
    0 4px 12px rgba(35, 99, 131, 0.06);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(71, 179, 203, 0.12);
  background: white;
}

.premium-card:hover {
  box-shadow:
    0 4px 12px rgba(35, 99, 131, 0.1),
    0 8px 24px rgba(35, 99, 131, 0.08);
  transform: translateY(-2px);
  border-color: rgba(71, 179, 203, 0.2);
}

.premium-card-header {
  box-shadow:
    0 2px 6px rgba(35, 99, 131, 0.08),
    0 6px 18px rgba(35, 99, 131, 0.06);
  border: 1px solid rgba(71, 179, 203, 0.12);
  background: white;
}

/* Premium Buttons */
.btn-primary {
  background: linear-gradient(135deg, #007E8C 0%, #006570 100%);
  box-shadow: 0 2px 6px rgba(0, 126, 140, 0.2);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #006570 0%, #005059 100%);
  box-shadow: 0 4px 10px rgba(0, 126, 140, 0.3);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0px);
  box-shadow: 0 1px 3px rgba(0, 126, 140, 0.25);
}

.btn-secondary {
  background: linear-gradient(135deg, #47B3CB 0%, #3A9FB5 100%);
  box-shadow: 0 2px 6px rgba(71, 179, 203, 0.2);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #3A9FB5 0%, #2F8FA3 100%);
  box-shadow: 0 4px 10px rgba(71, 179, 203, 0.3);
  transform: translateY(-1px);
}

/* Premium Input Fields */
.premium-input {
  border: 1.5px solid rgba(71, 179, 203, 0.25);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: white;
  box-shadow: 0 1px 2px rgba(35, 99, 131, 0.04);
}

.premium-input:focus {
  border-color: #47B3CB;
  box-shadow: 0 0 0 3px rgba(71, 179, 203, 0.12), 0 1px 3px rgba(35, 99, 131, 0.08);
  outline: none;
}

/* Top 3 Host Cards - Premium Highlight */
.top-host-card {
  background: white;
  border: 1.5px solid;
  position: relative;
  overflow: hidden;
}

.top-host-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.top-host-1 {
  border-color: rgba(251, 191, 36, 0.25);
  box-shadow:
    0 2px 8px rgba(251, 191, 36, 0.08),
    0 4px 16px rgba(35, 99, 131, 0.06);
}

.top-host-1::before {
  background: linear-gradient(90deg, #FCD34D 0%, #FBBF24 100%);
  box-shadow: 0 2px 4px rgba(251, 191, 36, 0.3);
}

.top-host-2 {
  border-color: rgba(156, 163, 175, 0.25);
  box-shadow:
    0 2px 8px rgba(156, 163, 175, 0.08),
    0 4px 16px rgba(35, 99, 131, 0.06);
}

.top-host-2::before {
  background: linear-gradient(90deg, #D1D5DB 0%, #9CA3AF 100%);
  box-shadow: 0 2px 4px rgba(156, 163, 175, 0.3);
}

.top-host-3 {
  border-color: rgba(217, 119, 6, 0.25);
  box-shadow:
    0 2px 8px rgba(217, 119, 6, 0.08),
    0 4px 16px rgba(35, 99, 131, 0.06);
}

.top-host-3::before {
  background: linear-gradient(90deg, #F59E0B 0%, #D97706 100%);
  box-shadow: 0 2px 4px rgba(217, 119, 6, 0.3);
}

/* Badge/Pill Styling */
.premium-badge {
  background: linear-gradient(135deg, #EAF8FF 0%, #D8F3FB 100%);
  border: 1px solid rgba(0, 126, 140, 0.15);
  box-shadow: 0 1px 2px rgba(0, 126, 140, 0.08);
}

/* Prevent badge text from wrapping alongside host names */
/* Target the badge elements to ensure they don't wrap awkwardly */
.premium-card h3 + div[class*="flex-shrink-0"] {
  white-space: nowrap;
}

/* Improve layout on smaller screens - allow controlled wrapping */
@media (max-width: 768px) {
  /* Allow badge to wrap to new line on tablets */
  .premium-card .flex.items-center.gap-3.flex-wrap {
    row-gap: 0.75rem;
  }
  
  /* Ensure badges don't shrink and maintain spacing */
  .premium-card h3 + div[class*="flex-shrink-0"] {
    flex-shrink: 0;
  }
}

@media (max-width: 640px) {
  /* On mobile, ensure proper stacking for readability */
  .premium-card .flex.items-center.gap-3.flex-wrap {
    flex-wrap: wrap;
    row-gap: 0.75rem;
  }
  
  /* Keep host name from being too cramped with badge */
  .premium-card h3.flex-1 {
    flex-basis: 100%;
    margin-bottom: 0.25rem;
  }
}

/* Info Box Styling */
.info-box {
  background: #FAFCFD;
  border: 1px solid rgba(71, 179, 203, 0.12);
  border-radius: 12px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(35, 99, 131, 0.04);
}

.info-box:hover {
  border-color: rgba(71, 179, 203, 0.22);
  background: #F5FAFB;
  box-shadow: 0 2px 4px rgba(35, 99, 131, 0.06);
  transform: translateY(-1px);
}

/* Warning Box for Notes */
.warning-box {
  background: #FFFBF5;
  border: 1px solid rgba(251, 173, 63, 0.25);
  border-left: 3px solid #FBAD3F;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(251, 173, 63, 0.06);
}

/* Distance Sorting Banner */
.distance-banner {
  background: linear-gradient(135deg, #EAF8FF 0%, #D8F3FB 100%);
  border: 1.5px solid rgba(71, 179, 203, 0.25);
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(71, 179, 203, 0.12);
}

/* Modal Backdrop */
.modal-backdrop {
  backdrop-filter: blur(6px);
  animation: fadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  animation: slideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    0 8px 32px rgba(35, 99, 131, 0.15),
    0 4px 12px rgba(35, 99, 131, 0.1);
}

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

/* Rank Badges */
.rank-badge {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
  border: 2.5px solid white;
  font-weight: 700;
  font-size: 0.75rem;
}

/* Smooth transitions */
.transition-all {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Better mobile tap targets */
@media (max-width: 640px) {
  button, a {
    min-height: 44px;
  }
}

/* Mobile responsive fixes - prevent overflow */
@media (max-width: 768px) {
  * {
    max-width: 100%;
  }
  
  img {
    max-width: 100%;
    height: auto;
  }
  
  .premium-card, .premium-card-header {
    overflow-x: hidden;
  }
  
  /* Ensure text wraps properly */
  h1, h2, h3, h4, h5, h6, p, span, div {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  /* Prevent horizontal scroll on containers */
  .container, [class*="max-w"] {
    max-width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Prevent overflow on all screen sizes */
.container, [class*="container"] {
  overflow-x: hidden;
}

/* Ensure flex containers don't overflow */
.flex, [class*="flex"] {
  min-width: 0;
}

/* Text truncation for long content */
.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Loading spinner for geocoding */
.geocoding-spinner {
  border: 3px solid rgba(71, 179, 203, 0.2);
  border-top: 3px solid #007E8C;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Print styles */
@media print {
  .no-print {
    display: none !important;
  }

  body {
    background: white !important;
  }

  .premium-card, .premium-card-header {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
}

/* Accessibility improvements */
a:focus, button:focus, input:focus {
  outline: 2px solid #007E8C;
  outline-offset: 2px;
}

/* Map Container */
#map {
  border-radius: 0 0 16px 16px;
  border: 1px solid rgba(71, 179, 203, 0.15);
  box-shadow: inset 0 1px 2px rgba(35, 99, 131, 0.04);
}

/* View Toggle Buttons */
.view-toggle-btn {
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1.5px solid transparent;
}

.view-toggle-btn:not(.active) {
  background: white !important;
  color: #236383 !important;
  border-color: rgba(71, 179, 203, 0.25);
  box-shadow: 0 1px 2px rgba(35, 99, 131, 0.04);
}

.view-toggle-btn:not(.active):hover {
  border-color: rgba(71, 179, 203, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(71, 179, 203, 0.12);
}

.view-toggle-btn.active {
  box-shadow: 0 2px 6px rgba(0, 126, 140, 0.2);
}