@import url("https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=Outfit:wght@300;400;500;600;700&display=swap");

:root {
  /* Palette from user image */
  --text-dark: #263238;
  /* Dark Blue/Charcoal */
  --bg-white: #ffffff;
  /* Background */
  --primary-tan: #c19a6b;
  /* Primary Beige/Tan */
  --secondary-slate: #546e7a;
  /* Secondary Slate Grey */
  --accent-green: #1a4d2e;
  /* Accent Green (kept similar, slightly adjusted) */

  /* Mappings */
  --primary-green: var(--accent-green);
  --primary-green-dark: #143d24;
  --bg-cream: #fafafa;
  /* Very light grey/white for page bg */
  --white: var(--bg-white);
  --text-muted: var(--secondary-slate);
  --border-light: #e0e0e0;
  --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.08);
  --radius-card: 24px;
  --radius-pill: 50px;
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: "Outfit", sans-serif;
  background-color: var(--bg-cream);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.page-wrapper {
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

/* Header */
.main-header {
  text-align: center;
  position: relative;
  z-index: 10;
}

.main-header h1 {
  font-family: "DM Serif Display", serif;
  font-size: 48px;
  color: var(--primary-green);
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}

.main-header p {
  font-size: 16px;
  color: #777;
  font-weight: 400;
}

/* Map Card - Modern Flat/* Map Card - Modern Flat Design */
.map-card {
  background: var(--white);
  width: 100%;
  border-radius: 32px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0, 0, 0, 0.05);
  margin-top: 20px;
  position: relative;
  z-index: 1;
}

/* Map Header (Filters) */
.map-header {
  padding: 24px 32px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
}

.filter-scroll-container {
  overflow-x: auto;
  width: 100%;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filter-scroll-container::-webkit-scrollbar {
  display: none;
}

.main-header {
  text-align: center;
  padding: 20px 0;
  background: transparent;
}

.header-logo {
  max-width: 600px;
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .header-logo {
    max-width: 90%;
  }
}

.filter-chips {
  display: flex;
  gap: 12px;
}

.filter-chip {
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 50px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #3c4043;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: "Roboto", Arial, sans-serif;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3),
    0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

.filter-chip i {
  font-size: 14px;
  color: #70757a;
}

.filter-chip:hover {
  background-color: #f1f3f4;
  color: #202124;
}

.filter-chip.active {
  background-color: #e8f0fe;
  color: #1967d2;
  border-color: #e8f0fe;
  box-shadow: none;
}

.filter-chip.active i {
  color: #1967d2;
}

/* Map Area - Footer Style */
#map-container {
  position: relative;
  width: 100%;
  height: 400px;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 400px;
  /* Fallback */
  z-index: 0;
  cursor: default !important;
}

.maplibregl-canvas {
  cursor: default !important;
}

.maplibregl-canvas-container.maplibregl-interactive {
  cursor: default !important;
}

#reset-map-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.2s ease;
}

#reset-map-btn:hover {
  background-color: #f1f3f4;
  transform: rotate(180deg);
}

#reset-map-btn i {
  color: #546e7a;
  font-size: 18px;
}

/* Al Basateen Logo Marker Overlay */
.map-logo-marker {
  position: absolute;
  top: 45%;
  left: 48%;
  transform: translate(-50%, -100%);
  z-index: 5;
  pointer-events: none;
}

.map-logo-marker img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
  animation: bounce 2s ease-in-out infinite;
  position: relative;
  z-index: 2;
}

.marker-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(26, 77, 46, 0.3);
  animation: pulse 2s ease-out infinite;
  z-index: 1;
}

@keyframes pulse {
  0% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 1;
  }

  100% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0;
  }
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

/* Map Footer (Search & Stats) */
.map-footer {
  padding: 32px;
  background: var(--white);
}

.search-bar-container {
  display: flex;
  align-items: center;
  background: #f5f7fa;
  border: 1px solid #e0e0e0;
  border-radius: 50px;
  /* More rounded */
  padding: 12px 20px;
  margin-bottom: 24px;
  transition: var(--transition);
  position: relative;
  /* For results dropdown */
}

.search-bar-container:focus-within {
  background: white;
  border-color: var(--primary-tan);
  box-shadow: 0 4px 12px rgba(193, 154, 107, 0.15);
}

.search-bar-container i {
  color: #999;
  font-size: 18px;
  margin-right: 15px;
}

.search-bar-container input {
  border: none;
  outline: none;
  width: 100%;
  font-size: 16px;
  font-family: inherit;
  color: var(--text-dark);
}

.search-bar-container input::placeholder {
  color: #999;
}

.quick-stats {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  flex: 1;
  min-width: 120px;
}

.stat-item:hover {
  transform: translateY(-5px);
}

.stat-item i {
  font-size: 24px;
  color: #529c7e;
  margin-bottom: 10px;
}

.stat-time {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 5px;
}

.stat-name {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Custom Info Window (Pop-up) Styling */
/* Note: Google Maps InfoWindow content is styled here */
.gm-style .gm-style-iw-c {
  padding: 0 !important;
  border-radius: 16px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

.gm-style-iw-d {
  overflow: hidden !important;
  padding: 0 !important;
}

.gm-ui-hover-effect {
  display: none !important;
  /* Hide default close button if we want a custom one, or style it */
}

.custom-info-window {
  display: flex;
  width: 320px;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
}

.info-window-image {
  width: 100px;
  height: 100px;
  /* Fixed height for the row layout */
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.info-window-content {
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.info-window-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.info-window-address {
  font-size: 12px;
  color: #777;
  margin-bottom: 8px;
}

.info-window-link {
  font-size: 12px;
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
}

.info-window-link:hover {
  text-decoration: underline;
}

/* Custom Al Basateen Compound Marker */
.basateen-custom-marker {
  cursor: pointer;
}

.basateen-icon-wrapper {
  width: 150px;
  height: 150px;
}

.basateen-icon-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.basateen-icon-wrapper:hover img {
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

/* Google Maps Style Popup Card */
.leaflet-popup-content-wrapper {
  padding: 0;
  border-radius: 8px;
  box-shadow: 0 2px 7px 1px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.leaflet-popup-content {
  margin: 0 !important;
  width: 300px !important;
}

.google-maps-card {
  font-family: "Roboto", Arial, sans-serif;
  background: white;
  color: #202124;
}

.google-card-image {
  width: 100%;
  height: 120px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.google-card-content {
  padding: 16px 24px;
}

.google-card-title {
  font-size: 22px;
  font-weight: 400;
  margin: 0 0 4px 0;
  color: #202124;
}

.google-card-subtitle {
  font-size: 14px;
  color: #70757a;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.google-rating {
  display: flex;
  align-items: center;
  font-size: 14px;
  margin-bottom: 12px;
}

.google-rating-score {
  font-weight: 500;
  color: #202124;
  margin-right: 4px;
}

.google-rating-stars {
  color: #fbbc04;
  font-size: 12px;
  margin-right: 4px;
}

.google-rating-count {
  color: #70757a;
}

.google-actions {
  display: flex;
  gap: 12px;
  margin: 16px 0;
  border-bottom: 1px solid #e8eaed;
  padding-bottom: 16px;
}

.google-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  color: #1a73e8;
  font-size: 12px;
  font-weight: 500;
  padding: 0;
}

.google-action-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #dadce0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #1a73e8;
  transition: background 0.2s;
}

.google-action-btn:hover .google-action-icon {
  background: #f1f3f4;
}

.google-action-btn.primary .google-action-icon {
  background: #1a73e8;
  color: white;
  border: none;
}

.google-action-btn.primary:hover .google-action-icon {
  background: #1557b0;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3),
    0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

.google-details {
  font-size: 14px;
  line-height: 1.5;
}

.google-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  color: #202124;
}

.google-detail-icon {
  color: #70757a;
  font-size: 16px;
  margin-top: 2px;
  width: 20px;
  text-align: center;
}

.google-open-status {
  color: #d93025;
  /* Closed color */
  font-weight: 500;
}

.google-open-status.open {
  color: #188038;
  /* Open color */
}

/* Hide default leaflet popup close button and style a custom one if needed, 
   but for now let's keep the default one but style it to match Google */
.leaflet-popup-close-button {
  color: white !important;
  font-size: 24px !important;
  top: 10px !important;
  right: 10px !important;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

/* Modern Pin Design */
.modern-pin {
  width: 32px;
  height: 32px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  border: 2px solid white;
  transition: all 0.3s ease;
}

.modern-pin:hover {
  transform: rotate(-45deg) scale(1.1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  z-index: 100;
}

.modern-pin i {
  transform: rotate(45deg);
  color: white;
  font-size: 16px;
}

/* Old marker styles - kept for compatibility */
.custom-marker-modern {
  background: transparent;
  border: none;
}

.marker-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.marker-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  background-color: white;
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
}

.marker-icon:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.marker-icon i {
  font-size: 18px;
}

.marker-pointer {
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 12px solid;
  position: relative;
  top: -2px;
  z-index: 1;
}

/* Old marker styles - kept for compatibility */
.custom-marker {
  background: transparent;
  border: none;
}

.marker-pin {
  width: 30px;
  height: 42px;
  border-radius: 50% 50% 50% 0;
  background: #1a4d2e;
  position: absolute;
  transform: rotate(-45deg);
  left: 50%;
  top: 50%;
  margin: -21px 0 0 -15px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.marker-pin::after {
  content: "";
  width: 20px;
  height: 20px;
  margin: 0 0 8px 8px;
  background: #fff;
  position: absolute;
  border-radius: 50%;
}

.marker-label {
  position: absolute;
  transform: rotate(45deg);
  font-size: 16px;
  z-index: 10;
  margin: 0 0 8px 8px;
}

/* Leaflet Popup Customization */
.leaflet-popup-content-wrapper {
  padding: 0;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-content {
  margin: 0;
  width: auto !important;
}

.leaflet-popup-tip-container {
  display: none;
}

/* Responsive */
@media (max-width: 768px) {
  .main-header h1 {
    font-size: 32px;
  }

  .map-header {
    padding: 15px;
  }

  .filter-chip {
    padding: 8px 16px;
    font-size: 13px;
  }

  #map-container {
    height: 400px;
  }

  .quick-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .stat-item {
    min-width: auto;
  }
}

/* Google Navigation Card Style */
.google-nav-card {
  font-family: "Roboto", Arial, sans-serif;
  padding: 16px;
  min-width: 300px;
}

.google-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.google-nav-title {
  font-size: 18px;
  font-weight: 400;
  color: #202124;
  margin: 0;
}

.google-nav-route-info {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.google-nav-time {
  font-size: 24px;
  font-weight: 500;
  color: #188038;
  /* Green for good traffic */
}

.google-nav-time.traffic-heavy {
  color: #d93025;
  /* Red for heavy traffic */
}

.google-nav-distance {
  font-size: 16px;
  color: #70757a;
}

.google-nav-traffic-label {
  font-size: 12px;
  color: #70757a;
  margin-bottom: 16px;
}

.google-nav-actions {
  display: flex;
  gap: 10px;
}

.google-nav-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}

.google-nav-btn.start {
  background-color: #1a73e8;
  color: white;
  border: none;
}

.google-nav-btn.start:hover {
  background-color: #1557b0;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3),
    0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

.google-nav-btn.secondary {
  background-color: white;
  color: #1a73e8;
  border: 1px solid #dadce0;
}

.google-nav-btn.secondary:hover {
  background-color: #f1f3f4;
}

/* Results List Styles */
.results-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 10px;
}

.result-card {
  display: flex;
  gap: 16px;
  padding: 12px;
  background: white;
  border-radius: 12px;
  border: 1px solid #e0e0e0;
  cursor: pointer;
  transition: all 0.2s;
}

.result-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: transparent;
  background-color: #f8f9fa;
}

.result-image {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.result-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.result-title {
  font-size: 16px;
  font-weight: 500;
  color: #202124;
  margin-bottom: 4px;
}

.result-rating {
  font-size: 13px;
  color: #70757a;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.result-meta {
  font-size: 13px;
  color: #70757a;
}

/* Detailed Place View Styles */
.place-details {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.place-header-image {
  width: 100%;
  height: 200px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.place-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  color: #5f6368;
  z-index: 10;
  transition: background 0.2s;
}

.place-close-btn:hover {
  background: #f1f3f4;
}

.place-content {
  padding: 24px;
}

.place-title {
  font-size: 24px;
  font-weight: 400;
  color: #202124;
  margin-bottom: 8px;
}

.place-rating-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 14px;
  color: #70757a;
}

.place-category {
  color: #70757a;
  font-size: 14px;
  margin-bottom: 24px;
}

/* Action Buttons Row */
.place-actions {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.action-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 60px;
  background: none;
  border: none;
  cursor: pointer;
  color: #1a73e8;
  font-size: 12px;
  font-weight: 500;
  padding: 0;
}

.action-icon-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #dadce0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #1a73e8;
  transition: background 0.2s;
}

.action-button:hover .action-icon-circle {
  background: #f1f3f4;
}

.action-button.primary .action-icon-circle {
  background: #1a73e8;
  color: white;
  border: none;
}

.action-button.primary:hover .action-icon-circle {
  background: #1557b0;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3),
    0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

/* Info List */
.place-info-list {
  border-top: 1px solid #e0e0e0;
  padding-top: 16px;
}

.info-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  color: #3c4043;
  font-size: 14px;
  line-height: 1.5;
  align-items: flex-start;
}

.info-icon {
  color: #70757a;
  font-size: 18px;
  width: 24px;
  text-align: center;
  margin-top: 2px;
}
