/* map.css - SD Auto Route Finder Styles */

/*
  IMPORTANT:
  This stylesheet is included on a Jekyll "post" layout page.
  Avoid global resets (e.g., * { margin:0 }) and body-level overrides here,
  because they break typography spacing site-wide and can create "double spacing"
  or weird layout shifts.

  Scope styles to the route page wrapper: .route-page
*/

.route-page,
.route-page * {
  box-sizing: border-box;
}

.route-page {
  color: #1e293b;
}

.route-page p {
  margin: 0;
}

/* CONTAINER CARD */
.route-form {
  max-width: 900px;
  margin: 0 auto 40px;
  padding: 40px 48px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 28px;
  box-shadow: 
    0 4px 6px -1px rgba(0, 102, 204, 0.05),
    0 10px 15px -3px rgba(0, 102, 204, 0.08),
    0 20px 25px -5px rgba(0, 102, 204, 0.05);
  border: 1px solid rgba(0, 102, 204, 0.08);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.route-form::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #0066cc, #06b6d4, #0066cc);
  background-size: 200% 100%;
  animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.route-form:hover {
  transform: translateY(-4px);
  box-shadow: 
    0 10px 15px -3px rgba(0, 102, 204, 0.1),
    0 20px 25px -5px rgba(0, 102, 204, 0.1),
    0 25px 50px -12px rgba(0, 102, 204, 0.15);
}

.route-form h2 {
  font-size: 32px;
  font-weight: 800;
  text-align: center;
  background: linear-gradient(135deg, #0066cc 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.route-form > p {
  text-align: center;
  font-size: 15px;
  color: #64748b !important;
  margin-bottom: 32px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* INPUT GROUP */
.input-group {
  margin-bottom: 24px;
}

.input-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #0066cc;
  margin-bottom: 8px;
  letter-spacing: 0.025em;
}

.input-group input,
.input-group select {
  width: 100%;
  padding: 16px 20px;
  font-size: 15px;
  background-color: #f8fafc;
  color: #1e293b;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
}

.input-group input::placeholder {
  color: #94a3b8;
}

.input-group input:hover,
.input-group select:hover {
  border-color: #cbd5e1;
  background-color: #ffffff;
}

.input-group input:focus,
.input-group select:focus {
  border-color: #0066cc;
  background-color: #ffffff;
  box-shadow: 
    0 0 0 4px rgba(0, 102, 204, 0.1),
    0 4px 12px rgba(0, 102, 204, 0.08);
  outline: none;
}

/* CTA BUTTON */
button#fetch_routes_btn {
  width: 100%;
  padding: 18px 32px;
  background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
  color: white;
  font-weight: 700;
  border: none;
  border-radius: 16px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.025em;
  margin-top: 8px;
}

button#fetch_routes_btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

button#fetch_routes_btn:hover {
  background: linear-gradient(135deg, #0052a3 0%, #004080 100%);
  transform: translateY(-2px);
  box-shadow: 
    0 10px 20px -5px rgba(0, 102, 204, 0.4),
    0 4px 8px -2px rgba(0, 102, 204, 0.2);
}

button#fetch_routes_btn:hover::before {
  left: 100%;
}

button#fetch_routes_btn:active {
  transform: translateY(0);
}

/* MAP STYLING */
#map {
  height: 550px;
  max-width: 900px;
  margin: 0 auto 40px;
  border-radius: 24px;
  border: none;
  box-shadow: 
    0 10px 15px -3px rgba(0, 102, 204, 0.1),
    0 20px 25px -5px rgba(0, 102, 204, 0.08),
    0 25px 50px -12px rgba(0, 102, 204, 0.1);
  overflow: hidden;
  position: relative;
}

/* ROUTE DETAILS */
#result {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 0 60px;
}

#result h4 {
  margin-top: 32px;
  margin-bottom: 16px;
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.25px;
}

#result ul {
  list-style: none;
  padding-left: 0;
}

#result li {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-left: 4px solid #0066cc;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 12px;
  color: #1e293b;
  font-size: 15px;
  line-height: 1.6;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 102, 204, 0.05);
}

#result li:hover {
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.1);
}

/* Route info styling */
#result .route-info {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 24px;
}

#result .route-card {
  flex: 1;
  min-width: 250px;
  background: white;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 
    0 4px 6px -1px rgba(0, 102, 204, 0.05),
    0 10px 15px -3px rgba(0, 102, 204, 0.08);
  border: 1px solid rgba(0, 102, 204, 0.08);
  transition: all 0.3s ease;
}

#result .route-card:hover {
  transform: translateY(-4px);
  box-shadow: 
    0 10px 15px -3px rgba(0, 102, 204, 0.1),
    0 20px 25px -5px rgba(0, 102, 204, 0.1);
}

/* Loading state */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  color: #0066cc;
  font-weight: 600;
}

.loading::before {
  content: '';
  width: 24px;
  height: 24px;
  border: 3px solid #e2e8f0;
  border-top-color: #0066cc;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Success/Error states */
.success-message {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-left: 4px solid #10b981;
  border-radius: 12px;
  padding: 16px 20px;
  color: #065f46;
  font-weight: 500;
}

.error-message {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border-left: 4px solid #ef4444;
  border-radius: 12px;
  padding: 16px 20px;
  color: #991b1b;
  font-weight: 500;
}

/* DARK MODE SUPPORT */
.dark .route-form {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-color: rgba(148, 163, 184, 0.1);
}

.dark .route-form::before {
  background: linear-gradient(90deg, #0066cc, #06b6d4, #0066cc);
}

.dark .input-group label {
  color: #60a5fa;
}

.dark .input-group input,
.dark .input-group select {
  background-color: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}

.dark .input-group input:hover,
.dark .input-group select:hover {
  border-color: #475569;
  background-color: #1e293b;
}

.dark .input-group input:focus,
.dark .input-group select:focus {
  border-color: #60a5fa;
  background-color: #1e293b;
  box-shadow: 
    0 0 0 4px rgba(96, 165, 250, 0.15),
    0 4px 12px rgba(96, 165, 250, 0.1);
}

.dark .input-group input::placeholder {
  color: #64748b;
}

.dark #result li {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-color: #3b82f6;
  color: #e2e8f0;
}

.dark #result li:hover {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.dark #result .route-card {
  background: #1e293b;
  border-color: rgba(148, 163, 184, 0.1);
}

/* WEATHER WIDGET */
.weather-widget {
  max-width: 900px;
  margin: 0 auto 24px;
  padding: 20px 28px;
  background: linear-gradient(135deg, #0066cc 0%, #0052a3 50%, #06b6d4 100%);
  border-radius: 20px;
  color: white;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  box-shadow: 0 10px 25px -5px rgba(0, 102, 204, 0.3);
}

.weather-main {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 200px;
}

.weather-icon {
  font-size: 48px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.weather-temp {
  display: flex;
  flex-direction: column;
}

.weather-temp span:first-child {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
}

.weather-condition {
  font-size: 14px;
  opacity: 0.9;
  margin-top: 4px;
}

.weather-details {
  display: flex;
  gap: 24px;
  flex: 2;
  justify-content: center;
}

.weather-detail {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

.weather-detail-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.8;
  margin-bottom: 4px;
}

.weather-detail-value {
  font-size: 16px;
  font-weight: 700;
}

.weather-advisory {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(251, 191, 36, 0.2);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 10px;
  margin-top: 8px;
}

.weather-advisory-icon {
  font-size: 20px;
}

.weather-advisory-text {
  font-size: 13px;
  font-weight: 500;
}

/* SHARE MODAL */
.share-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.share-modal.active {
  display: flex;
}

.share-modal-content {
  background: white;
  border-radius: 24px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: modal-slide-up 0.3s ease;
}

@keyframes modal-slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.share-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 24px 0;
}

.share-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
}

.share-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f1f5f9;
  border: none;
  font-size: 24px;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.share-modal-close:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.share-modal-body {
  padding: 20px 24px 24px;
}

.share-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.share-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
}

.share-option:hover {
  border-color: #0066cc;
  background: #f0f7ff;
}

.share-option-icon {
  font-size: 24px;
}

.share-option-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

.qr-code-container {
  text-align: center;
  padding: 20px;
  background: #f8fafc;
  border-radius: 16px;
}

.qr-code-title {
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 16px;
}

/* Dark mode weather and share */
.dark .weather-widget {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  border: 1px solid rgba(148, 163, 184, 0.1);
}

.dark .share-modal-content {
  background: #1e293b;
}

.dark .share-modal-title {
  color: white;
}

.dark .share-modal-close {
  background: #334155;
  color: #94a3b8;
}

.dark .share-option {
  background: #0f172a;
  border-color: #334155;
}

.dark .share-option:hover {
  border-color: #0066cc;
  background: rgba(0, 102, 204, 0.1);
}

.dark .share-option-label {
  color: #94a3b8;
}

.dark .qr-code-container {
  background: #0f172a;
}

.dark #share-route-summary {
  background: #0f172a !important;
}

.dark #share-route-summary > div:first-child {
  color: white !important;
}

/* MOBILE FRIENDLY */
@media (max-width: 768px) {
  .route-form {
    margin: 0 16px 30px;
    padding: 28px 24px;
    border-radius: 20px;
  }

  .route-form h2 {
    font-size: 26px;
  }

  .route-form > p {
    font-size: 14px;
    margin-bottom: 24px;
  }

  .input-group input,
  .input-group select {
    padding: 14px 16px;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  #map {
    height: 400px;
    margin: 0 16px 30px;
    border-radius: 20px;
  }

  button#fetch_routes_btn {
    padding: 16px 24px;
    font-size: 15px;
  }

  #result {
    padding: 0 16px 40px;
  }

  #result h4 {
    font-size: 20px;
  }

  #result li {
    padding: 14px 16px;
  }

  .weather-widget {
    margin: 0 16px 20px;
    padding: 16px 20px;
    gap: 16px;
  }

  .weather-icon {
    font-size: 36px;
  }

  .weather-temp span:first-child {
    font-size: 28px;
  }

  .weather-details {
    gap: 12px;
    flex-wrap: wrap;
  }

  .weather-detail {
    padding: 10px 14px;
  }

  .share-options {
    grid-template-columns: repeat(2, 1fr);
  }
}  

