/* ═══════════════════════════════════════════════════════
   Wishes Layer — Shared CSS
   Single source of truth for all wish-related styles.
   Imported by index.html, explore/index.html, map/index.html
   ═══════════════════════════════════════════════════════ */

/* ── Shops / Wishes Layer Toggle ── */
.map-layer-toggle {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 24px;
  padding: 4px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
  gap: 2px;
}
.map-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.5rem 1.2rem;
  border: none;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--sans);
  cursor: pointer;
  background: transparent;
  color: var(--muted);
  transition: all 0.25s ease;
}
.map-toggle-btn.active {
  background: var(--green);
  color: #fff;
  box-shadow: 0 2px 8px rgba(200,118,6,0.25);
}
.map-toggle-btn:not(.active):hover {
  background: rgba(200,118,6,0.08);
  color: var(--text);
}

/* ── Make a Wish FAB ── */
.wish-fab {
  position: absolute;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 550;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.65rem 1.4rem;
  border: none;
  border-radius: 24px;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: var(--sans);
  cursor: pointer;
  background: linear-gradient(135deg, #c87606, #e8a040);
  color: #fff;
  box-shadow: 0 4px 16px rgba(200,118,6,0.35);
  transition: transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}
.wish-fab:hover {
  transform: translateX(-50%) scale(1.04);
  box-shadow: 0 6px 20px rgba(200,118,6,0.45);
}
@media (max-width: 768px) {
  .wish-fab {
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    font-size: 0.82rem;
    padding: 0.55rem 1.1rem;
  }
}

/* ── Wish Bubble Map Markers (SVG-based) ── */
.wish-marker-wrapper {
  background: none !important;
  border: none !important;
}

/* ── Wish Cluster Markers (thought bubble) ── */
.wish-cluster-wrapper {
  background: none !important;
  border: none !important;
}
@keyframes wishClusterPopIn {
  0%   { opacity: 0; transform: scale(0.35) translateY(12px); }
  60%  { transform: scale(1.07) translateY(-2px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.wish-cluster-inner {
  animation: wishClusterPopIn 0.38s cubic-bezier(0.34,1.56,0.64,1);
}
.wish-cluster-inner:hover {
  filter: brightness(1.04);
  transform: scale(1.06);
  transition: transform 0.15s ease;
}

.wish-bubble-marker {
  position: relative;
  width: 230px;
  min-height: 70px;
  filter: drop-shadow(0 3px 10px rgba(0,0,0,0.13));
  animation: wishBounceIn 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes wishBounceIn {
  0% { opacity: 0; transform: scale(0.3) translateY(14px); }
  60% { transform: scale(1.06) translateY(-3px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* SVG shape stretches to fill entire marker */
.wish-svg-bg {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* Content overlay sits on top of SVG */
.wish-bubble-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px 14px 14px;
  max-width: 210px;
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #4a4440;
  white-space: normal;
  line-height: 1.4;
}

.wish-bubble-emoji {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  font-size: 15px;
}

.wish-bubble-text {
  word-break: break-word;
  overflow-wrap: break-word;
}

/* ── Direct upvote button on bubble marker ── */
.wish-bubble-vote {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  margin-left: 4px;
  border: 1.5px solid #c87606;
  border-radius: 10px;
  background: #fff;
  font-size: 10px;
  font-weight: 700;
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #c87606;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
  line-height: 1;
}
.wish-bubble-vote:hover {
  background: #c8760615;
  transform: scale(1.08);
}
.wish-bubble-vote.upvoted {
  background: #c87606;
  color: #fff;
  border-color: #c87606;
}
.wish-bubble-vote.upvoted:hover {
  background: #b06a05;
}

/* ── Wish Map Popup — comic speech bubble ── */
.wish-map-popup {
  margin-bottom: 4px;
}
.wish-map-popup .leaflet-popup-content-wrapper {
  border-radius: 24px 24px 24px 6px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.10);
  border: 2.5px solid #ddd4c6;
  padding: 0;
  background: #fffcf7;
}
.wish-map-popup .leaflet-popup-content {
  margin: 14px 16px;
}
.wish-map-popup .leaflet-popup-tip-container {
  width: 30px;
  height: 20px;
  margin-top: -2px;
  overflow: visible;
  margin-left: -15px;
}
.wish-map-popup .leaflet-popup-tip {
  background: transparent;
  border: none;
  box-shadow: none;
  width: 24px;
  height: 18px;
  margin: 0;
  padding: 0;
}
.wish-map-popup .leaflet-popup-tip-container::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 18px;
  background: #ddd4c6;
  clip-path: path('M2 0 L22 0 Q14 12, 12 18 Q10 10, 2 0 Z');
}
.wish-map-popup .leaflet-popup-tip-container::after {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 15px;
  background: #fffcf7;
  clip-path: path('M2 0 L18 0 Q12 10, 10 15 Q8 8, 2 0 Z');
}
.wish-map-popup .leaflet-popup-close-button {
  color: #bbb;
  font-size: 18px;
  top: 8px;
  right: 10px;
}
.wish-map-popup .leaflet-popup-close-button:hover {
  color: #888;
}
.wish-popup {
  padding: 2px;
  min-width: 180px;
}

/* ── Wish Modal ── */
.wish-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.wish-modal {
  position: relative;
  background: var(--card, #fff);
  border-radius: 20px;
  max-width: 420px;
  width: 100%;
  padding: 2rem 1.5rem 1.5rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  animation: wishModalSlideUp 0.3s ease-out;
}
@keyframes wishModalSlideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
.wish-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
}
.wish-modal-icon {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.wish-modal-title {
  text-align: center;
  font-family: var(--serif);
  font-size: 1.2rem;
  margin: 0 0 0.5rem;
}
.wish-category-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 0.5rem;
}
.wish-cat-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.35rem 0.7rem;
  border: 2px solid #eee;
  border-radius: 14px;
  background: #fff;
  font-size: 0.78rem;
  font-weight: 500;
  font-family: var(--sans);
  cursor: pointer;
  transition: all 0.2s;
  color: #555;
}
.wish-cat-btn.active {
  border-color: var(--cat-color, #c87606);
  background: color-mix(in srgb, var(--cat-color, #c87606) 10%, white);
  color: var(--cat-color, #c87606);
  font-weight: 700;
}
.wish-cat-btn:hover:not(.active) {
  border-color: #ccc;
}
.wish-textarea {
  width: 100%;
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: var(--sans);
  font-size: 0.9rem;
  resize: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.wish-textarea:focus {
  outline: none;
  border-color: #c87606;
}
.wish-submit-btn {
  display: block;
  width: 100%;
  margin-top: 1rem;
  padding: 0.75rem;
  border: none;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--sans);
  cursor: pointer;
  background: linear-gradient(135deg, #c87606, #e8a040);
  color: #fff;
  box-shadow: 0 3px 12px rgba(200,118,6,0.25);
  transition: transform 0.15s, box-shadow 0.15s;
}
.wish-submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(200,118,6,0.35);
}
.wish-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Wish Sidebar Cards ── */
.wish-sidebar-card {
  background: var(--card, #fff);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.85rem;
  margin-bottom: 0.75rem;
  transition: box-shadow 0.2s;
}
.wish-sidebar-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.wish-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}
.wish-sidebar-cat {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
}
.wish-sidebar-time {
  font-size: 0.72rem;
  color: var(--muted);
}
.wish-sidebar-text {
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text);
  margin: 0 0 0.5rem;
  font-style: italic;
}
.wish-sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wish-sidebar-author {
  font-size: 0.78rem;
  color: var(--muted);
}
.wish-upvote-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border: 1px solid #ddd;
  border-radius: 14px;
  background: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  color: #666;
  transition: all 0.2s;
  font-family: var(--sans);
}
.wish-upvote-btn:hover {
  border-color: #c87606;
  color: #c87606;
}
.wish-upvote-btn.upvoted {
  border-color: #c87606;
  background: rgba(200,118,6,0.07);
  color: #c87606;
}
