/* ===== menu tiles ===== */
.tiles-wrapper {
  margin: 2rem auto 0;
  max-width: 1100px;
  padding: 0 1rem;
  margin-bottom: 1rem;
}

.tiles-wrapper h1,
.tiles-wrapper p {
  text-align: center;
}

.tiles-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  margin-top: 1.5rem;
}

.itinerary-tile {
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  /*background-color: white;*/
  background-color: #43b0b3;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.itinerary-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.18);
}

.tile-image {
  width: 100%;
  aspect-ratio: 3 / 2;
  background-size: cover;
  background-position: center;
}

.tile-title {
  padding: 0.75rem 0.8rem;
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
  /*color: #334155;*/
  color: white;
}

@media (max-width: 1024px) {
  .tiles-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .tiles-wrapper {
    padding: 0;
  }

  .tiles-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.9rem;
  }

  .tile-title {
    font-size: 0.9rem;
    padding: 0.6rem;
  }
}


/* ===== itinerary ===== */
.itinerary-header {
    margin-top: 1rem;
  }

  .itinerary-item {
    padding: 0.8rem;
    margin-bottom: 0.6rem;
    background: rgba(255,255,255,0.08);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
  }

  .itinerary-item:hover {
    background: rgba(255,255,255,0.2);
  }

  .itinerary-item.active {
    background: #334155;
  }

  h1 {
    margin-top: 0;
  }

  .day-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
    padding: 1rem 1.5rem;
    width: 100%;
  }

  .map-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
    padding: 1rem 1.5rem;
    width: 100%;
    aspect-ratio: 4 / 1;
  }
  
  @media (max-width: 768px) {
    .map-card {
      aspect-ratio: 3 / 2;
    }
  }

  .day-card h2 {
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
  }

  .activity {
    background: #f1f5f9;
    border-radius: 8px;
    padding: 1rem;
    margin: 0.75rem 0;
  }
  
  /* Edit buttons (pencil & save) */
  .activity .edit-btn,
  .itinerary-title .edit-btn,
  .itinerary-description .edit-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #334155;
    font-size: 0.9rem;
    transition: color 0.2s;
    }

    .activity .edit-btn:hover,
    .itinerary-title .edit-btn:hover,
    .itinerary-description .edit-btn:hover {
    color: #1e293b;
    }

  .day-card .delete-btn,
  .day-card .delete-day-btn,
  .activity .delete-btn,
  .itinerary-title .delete-btn,
  .itinerary-description .delete-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #334155;
    font-size: 0.9rem;
    transition: color 0.2s;
    }

  .day-card .delete-btn:hover,
  .day-card .delete-day-btn:hover,
  .activity .delete-btn:hover,
  .itinerary-title .delete-btn:hover,
  .itinerary-description .delete-btn:hover {
    color: #1e293b;
    }

    .activity input[type="text"],
    .activity textarea {
    width: 70%;
    padding: 0.4rem 0.5rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    resize: vertical;
    }

    .activity button.save-btn {
    background: #757575;
    color: white;
    border: none;
    padding: 0.3rem 0.6rem;
    /*border-radius: 6px;*/
    cursor: pointer;
    font-size: 0.85rem;
    align-self: flex-start;
    transition: background 0.2s;
    }

    .activity button.save-btn:hover {
    background: #2563eb;
    }


  .activity h3 {
    margin: 0 0 0.25rem 0;
    color: #334155;
  }

  .activity p {
    margin: 0.3rem 0;
    font-size: 0.95rem;
  }

  /* ===== Location bubbles ===== */
  .location-bubble {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    position: relative;
    cursor: pointer;
  }

  .location-bubble.has-geo {
    background-color: #e6f4ea;
    color: #1e7e34;
  }

  .location-bubble.no-geo {
    background-color: #fff3cd;
    color: #856404;
  }

  .location-map-popup {
    position: absolute;
    width: 220px;
    height: 160px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    z-index: 999;
    overflow: hidden;
  }

  .location-map-popup .leaflet-container {
    width: 100%;
    height: 100%;
  }
  /* ===== Location bubbles ===== */

  .loading {
    text-align: center;
    font-size: 1.2rem;
    color: #64748b;
  }

  .new-activity-form {
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 1rem;
  margin: 0.5rem 0 1rem 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.new-activity-form input,
.new-activity-form textarea {
  width: 100%;
  padding: 0.6rem;
  margin-bottom: 0.8rem;
  font-size: 0.95rem;
  border: 1px solid #cfd4dc;
  border-radius: 6px;
  background: #f8fafc;
}

.new-activity-form textarea {
  resize: vertical;
  min-height: 70px;
}

.new-activity-form button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

.new-activity-form .save-btn {
  background: #43b36e;
  color: white;
  margin-right: 0.5rem;
}

.new-activity-form .cancel-btn {
  background: #e2e8f0;
  color: #333;
}

.new-empty-itinerary-form {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 1rem;
  margin: 0.5rem 0 1rem 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.new-empty-itinerary-form input {
  width: 90%;
  padding: 0.6rem;
  margin-bottom: 0.8rem;
  font-size: 0.95rem;
  border: 1px solid #cfd4dc;
  border-radius: 6px;
  background: #f8fafc;
}

.new-empty-itinerary-form button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

.add-activity-btn,
.generate-activity-btn {
  width: 100%;
  padding: 0.6rem;
  border: none;
  background: #43b0b3;
  color: white;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
  margin-top: 0.5rem;
}

.add-activity-btn:hover,
.generate-activity-btn:hover {
  background: #7589d5;
}


/* Arrow buttons styling */
.arrow-btn {
  display: none;           /* hidden until edit mode */
  border: none;
  background: transparent;
  font-size: 0.9rem;
  margin-left: 8px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  color: #666;             /* adjust to match your style */
}

.arrow-btn:hover {
  color: #222;
}

/* show arrows when in edit mode */
body.edit-mode .arrow-btn {
  display: inline-block;
}

/* small layout niceties */
.day-arrows { float: right; }
.activity-arrows { margin-left: 12px; margin-right: 8px; }
.activities-list .activity { display: block; margin-bottom: 8px; }

.edit-toggle {
  padding: 0.6rem;
  border: none;
  background: #43b0b3;
  color: white;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
  margin-top: 0.5rem;
}

.edit-toggle:hover {
  background: #7589d5;
}

.add-day-btn {
  width: 100%;
  padding: 0.6rem;
  border: none;
  background: #7589d5;
  color: white;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
  margin-top: 0.5rem;
}

.add-day-btn:hover {
  background: #43b0b3;
}

#hero-fullwidth {
  width: 100vw;
  height: 30vh;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  display: none;  
}

#hero-fullwidth.visible {
  display: block;
}

#hero-fullwidth.visible .hero-image {
  opacity: 1;
}

.hero-image {
  height: 100%;                /* 30% of viewport height */
  min-height: 240px;           /* keeps it nice on small screens */
  width: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  margin-bottom: 24px;
  position: relative;
  
  -webkit-mask-image: linear-gradient(black 80%, transparent);
  mask-image: linear-gradient(black 80%, transparent);
  /*
  position: sticky;
  top: 0;
  z-index: 0;*/
}

/* Optional dark overlay for readability */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.35),
    rgba(0,0,0,0.55)
  );
  display: flex;
  align-items: flex-end;
  padding: 24px;
}

.hero-title {
  color: white;
  font-size: 2rem;
  margin: 0;
}

.hero-credit {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
  z-index: 10;
  pointer-events: none; /* ensures it doesn't block clicks */
}


#days-container > * {
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  #days-container > * {
    max-width: 100%;
    box-sizing: border-box;
    /*padding-left: 0;
    padding-right: 0;*/
  }
}







/* AI Helper Button */
.ai-helper-button {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: linear-gradient(135deg, #43b0b3, #7589d5);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(67, 176, 179, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-helper-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(67, 176, 179, 0.6);
}

.ai-helper-button span {
  font-size: 1.2rem;
}

/* AI Popup Overlay */
.ai-popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.ai-popup-overlay.active {
  display: flex;
}

/* AI Popup Content */
.ai-popup-content {
  background: white;
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

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

.ai-popup-header {
  background: linear-gradient(135deg, #43b0b3, #7589d5);
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ai-popup-header h3 {
  margin: 0;
  font-size: 1.3rem;
}

.ai-popup-close {
  background: transparent;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
}

.ai-popup-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.ai-popup-body {
  padding: 24px;
}

#ai-change-request {
  width: 100%;
  padding: 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  min-height: 150px;
  transition: border-color 0.2s;
}

#ai-change-request:focus {
  outline: none;
  border-color: #43b0b3;
}

.ai-submit-btn {
  width: 100%;
  background: linear-gradient(135deg, #43b0b3, #7589d5);
  color: white;
  border: none;
  padding: 14px;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.ai-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(67, 176, 179, 0.3);
}

.ai-submit-btn:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
  transform: none;
}

/* Loading Overlay */
.ai-loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 3000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.ai-loading-overlay.active {
  display: flex;
}

.ai-loading-image {
  width: 100px;
  height: 100px;
  margin-bottom: 20px;
}

.ai-loading-overlay p {
  color: white;
  font-size: 1.2rem;
  font-weight: 500;
}

@media (max-width: 600px) {
  .ai-helper-button {
    bottom: 16px;
    right: 16px;
    padding: 12px 20px;
    font-size: 0.9rem;
  }
  
  .ai-popup-content {
    width: 95%;
    margin: 16px;
  }
}


.share-card-btn {
  display: inline-flex; 
  align-items: center;
  background: var(--brand-accent);
  color: white;
  font-size: 14px; 
  font-weight: 700;
  
  padding: 0.6rem;
  border: none;
  color: white;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
  margin-top: 0.5rem;
}
.share-card-btn:hover { transform: translateY(-2px); }
.share-card-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.map-route-legend {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(44,95,138,0.12); border: 1px solid rgba(44,95,138,0.25);
  border-radius: 20px; padding: 4px 12px;
  font-size: 12px; color: #2C5F8A; margin-top: 6px;
}
.map-route-legend span {
  width: 20px; height: 3px;
  background: linear-gradient(90deg, #2C5F8A, #F4A829);
  border-radius: 2px; display: inline-block;
}