/* SimpleGallery 2026 - Maps & GPS Explorer App Styles */

.webos-map-window {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--window-bg, var(--bg-main, #0f172a));
  position: relative;
  overflow: hidden;
  color: var(--text-main, #f8fafc);
}

.map-toolbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--header-bg, var(--bg-card, rgba(15, 23, 42, 0.85)));
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  z-index: 1000;
  gap: 10px;
  flex-wrap: wrap;
}

.map-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.map-title-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main, #f8fafc);
  display: flex;
  align-items: center;
  gap: 6px;
}

.map-count-badge {
  background: var(--bg-card, rgba(99, 102, 241, 0.2));
  border: 1px solid var(--border-color, rgba(99, 102, 241, 0.4));
  color: var(--accent-primary, #a5b4fc);
  font-size: 0.775rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 9999px;
}

.map-controls-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.map-layer-selector {
  display: inline-flex;
  background: var(--bg-card, rgba(255, 255, 255, 0.08));
  border-radius: 8px;
  padding: 2px;
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

.map-layer-btn {
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  padding: 4px 10px;
  font-size: 0.775rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.map-layer-btn:hover {
  color: var(--text-main, #ffffff);
}

.map-layer-btn.active {
  background: var(--accent-primary, #6366f1);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.map-action-btn {
  background: var(--bg-card, rgba(255, 255, 255, 0.08));
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.15));
  color: var(--text-main, #ffffff);
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.map-action-btn:hover {
  background: var(--accent-primary, #6366f1);
  border-color: var(--accent-primary, #6366f1);
  color: #ffffff;
}

.map-action-btn.active {
  background: var(--accent-primary, #6366f1);
  border-color: var(--accent-primary, #6366f1);
  color: #ffffff;
}

.map-content-area {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
}

.map-canvas-container {
  flex: 1;
  height: 100%;
  position: relative;
  background: var(--bg-main, #0b1120);
}

/* Custom Marker Pins with Photo Thumbnails */
.custom-map-marker {
  background: transparent;
  border: none;
}

.marker-bubble {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(99, 102, 241, 0.6);
  overflow: hidden;
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.marker-bubble img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.marker-pointer {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid #ffffff;
  margin: -2px auto 0 auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.marker-bubble.magic {
  border: 2.5px dashed #c084fc;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6), 0 0 12px rgba(192, 132, 252, 0.75);
}

.marker-magic-sparkle {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #9333ea;
  background-image: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%);
  color: #ffffff;
  font-size: 9px;
  font-weight: bold;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

.marker-pointer.magic-pointer {
  border-top-color: #c084fc;
}

.custom-map-marker:hover .marker-bubble,
.marker-bubble.highlight {
  transform: scale(1.25) translateY(-4px);
  border-color: #6366f1;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.8), 0 0 0 3px #ffffff;
  z-index: 9999 !important;
}

.custom-map-marker:hover .marker-bubble.magic,
.marker-bubble.magic.highlight {
  border-color: #d8b4fe;
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.9), 0 0 0 3px #ffffff;
}

.map-popup-magic-badge {
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.45);
  color: #d8b4fe;
  font-size: 0.725rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 8px;
  margin-bottom: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.gps-badge.magic-badge {
  background: rgba(168, 85, 247, 0.18);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #c084fc;
}

.gps-badge.magic-badge:hover {
  background: #9333ea;
  color: #ffffff;
  border-color: #9333ea;
}

/* Custom Leaflet Popups */
.sg-leaflet-popup .leaflet-popup-content-wrapper {
  background: var(--window-bg, #182030);
  color: var(--text-main, #f8fafc);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.16));
  border-radius: 16px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
  padding: 0;
  overflow: hidden;
}

.sg-leaflet-popup .leaflet-popup-content {
  margin: 0;
  line-height: 1.4;
}

.sg-leaflet-popup .leaflet-popup-tip {
  background: var(--window-bg, #111827);
}

.map-popup-card {
  width: 220px;
}

.map-popup-thumb {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  transition: transform 0.3s ease;
  cursor: pointer;
}

.map-popup-thumb:hover {
  transform: scale(1.03);
}

.map-popup-body {
  padding: 10px 12px;
}

.map-popup-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main, #f8fafc);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.map-popup-meta {
  font-size: 0.75rem;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 8px;
}

.map-popup-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--accent-primary, #6366f1);
  color: #ffffff;
  border: none;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.775rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.map-popup-btn:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}
