/* CSS Reset & Variables */
:root {
  --bg-main: #0b0f19;
  --bg-sidebar: rgba(15, 23, 42, 0.75);
  --bg-card: rgba(30, 41, 59, 0.6);
  --bg-card-hover: rgba(30, 41, 59, 0.95);
  --bg-input: rgba(15, 23, 42, 0.6);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-focus: #6366f1;
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  
  --accent-primary: #6366f1; /* Indigo */
  --accent-primary-hover: #4f46e5;
  --accent-danger: #f43f5e; /* Rose */
  --accent-danger-hover: #e11d48;
  --accent-secondary: #475569; /* Slate */
  --accent-secondary-hover: #334155;
  --accent-cyan: #06b6d4;
  
  --font-family: 'Outfit', 'Noto Sans Thai', sans-serif;
  --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* App Container Layout */
.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  position: relative;
}

/* Sidebar Styling (Glassmorphism) */
.sidebar {
  width: 400px;
  height: 100%;
  background: var(--bg-sidebar);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  z-index: 1001;
  position: relative;
  box-shadow: var(--shadow-premium);
}

/* Header */
.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-glass);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.brand-icon i {
  width: 22px;
  height: 22px;
}

.brand h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(to right, #fff, #a5b4fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand p {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Sidebar Body & Scrollbar */
.sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-body::-webkit-scrollbar {
  width: 6px;
}

.sidebar-body::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.sidebar-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Search Section */
.search-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 14px;
  transition: var(--transition-smooth);
}

.search-box input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
  background-color: rgba(15, 23, 42, 0.85);
}

.clear-btn {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

.clear-btn:hover {
  color: var(--text-primary);
}

/* Map Search Field */
.map-search input {
  padding-right: 48px;
}

.action-btn-icon {
  position: absolute;
  right: 6px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: var(--accent-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.action-btn-icon:hover {
  background: var(--accent-primary-hover);
  transform: scale(1.05);
}

.action-btn-icon i {
  width: 16px;
  height: 16px;
}

/* Categories Filter */
.filter-section h3, .list-header h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 600;
}

.category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 20px;
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.tag-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}

.tag-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

/* Pins List Section */
.pins-list-section {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.list-header h3 {
  margin-bottom: 0;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.icon-btn i {
  width: 16px;
  height: 16px;
}

.pins-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  flex: 1;
  padding-right: 2px;
}

/* Empty State / Placeholder */
.list-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  gap: 12px;
  flex: 1;
}

.list-placeholder i {
  width: 48px;
  height: 48px;
  stroke-width: 1;
  opacity: 0.5;
}

.list-placeholder p {
  font-size: 13px;
  line-height: 1.5;
}

/* Pin Card */
.pin-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  gap: 12px;
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.pin-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: transparent;
  transition: var(--transition-smooth);
}

.pin-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.pin-card.active {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.4);
}

.pin-card.active::before {
  background-color: var(--accent-primary);
}

/* Card Image */
.pin-card-img {
  width: 75px;
  height: 75px;
  border-radius: 8px;
  object-fit: cover;
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.pin-card-placeholder-img {
  width: 75px;
  height: 75px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.pin-card-placeholder-img i {
  width: 24px;
  height: 24px;
}

/* Card Info */
.pin-card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.pin-card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.pin-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pin-card-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

.pin-card-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pin-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.pin-card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pin-card-meta i {
  width: 12px;
  height: 12px;
}

/* Sidebar Footer & Sync */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(10, 15, 30, 0.6);
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-icon {
  width: 20px;
  height: 20px;
}

.status-icon.success {
  color: #10b981;
  filter: drop-shadow(0 0 5px rgba(16, 185, 129, 0.3));
}

.status-icon.loading {
  color: #3b82f6;
  animation: spin 1.5s linear infinite;
}

.status-title {
  font-size: 13px;
  font-weight: 600;
  display: block;
}

.status-desc {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
}

.refresh-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.refresh-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  transform: rotate(180deg);
}

.refresh-btn i {
  width: 16px;
  height: 16px;
}

/* Map Wrapper */
.map-wrapper {
  flex: 1;
  height: 100%;
  position: relative;
}

#map {
  width: 100%;
  height: 100%;
  background: #111;
}

/* Map Instructions Overlay */
.map-overlay-tip {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-glass);
  padding: 10px 16px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  z-index: 1000;
  pointer-events: none;
  box-shadow: var(--shadow-premium);
  animation: fadeInDown 0.5s ease;
}

.map-overlay-tip i {
  color: var(--accent-primary);
  width: 16px;
  height: 16px;
}

/* Leaflet Custom Overrides */
.leaflet-bar {
  border: 1px solid var(--border-glass) !important;
  box-shadow: var(--shadow-premium) !important;
  border-radius: 10px !important;
  overflow: hidden;
}

.leaflet-bar a {
  background-color: rgba(30, 41, 59, 0.9) !important;
  color: var(--text-primary) !important;
  border-bottom: 1px solid var(--border-glass) !important;
  transition: var(--transition-smooth);
}

.leaflet-bar a:hover {
  background-color: #334155 !important;
  color: #fff !important;
}

.leaflet-popup-content-wrapper {
  background: rgba(15, 23, 42, 0.95) !important;
  backdrop-filter: blur(10px);
  color: var(--text-primary) !important;
  border: 1px solid var(--border-glass);
  border-radius: 14px !important;
  box-shadow: var(--shadow-premium) !important;
}

.leaflet-popup-tip {
  background: rgba(15, 23, 42, 0.95) !important;
  border-left: 1px solid var(--border-glass);
  border-bottom: 1px solid var(--border-glass);
}

.leaflet-popup-content {
  font-family: var(--font-family);
  margin: 14px 16px !important;
}

/* Custom Marker Styling */
.custom-map-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.marker-pin-wrapper {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 3px 5px rgba(0,0,0,0.5));
  transition: var(--transition-smooth);
}

.marker-pin-wrapper:hover {
  transform: translateY(-4px) scale(1.1);
}

.custom-map-marker.active .marker-pin-wrapper {
  transform: translateY(-4px) scale(1.15);
}

/* Pulsing effect */
.marker-pulse {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  z-index: 1;
  opacity: 0;
  transform: scale(0.6);
  animation: pulse 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

@keyframes pulse {
  0% {
    opacity: 0.5;
    transform: scale(0.6);
  }
  100% {
    opacity: 0;
    transform: scale(1.6);
  }
}

/* Modals Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(3, 7, 18, 0.7);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 16px;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.92);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.modal-overlay.open .modal-container {
  transform: scale(1);
}

/* Modal Header */
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 700;
}

.close-modal-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: var(--transition-smooth);
}

.close-modal-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.close-modal-btn i {
  width: 20px;
  height: 20px;
}

/* Modal Body & Form */
.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(85vh - 120px);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-group label .required {
  color: var(--accent-danger);
}

.form-group input[type="text"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 14px;
  transition: var(--transition-smooth);
}

.form-group textarea {
  resize: vertical;
}

.form-group input[type="text"]:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.2);
}

/* Property type select with inline button */
.property-type-input-group {
  display: flex;
  gap: 8px;
}

.property-type-input-group select {
  flex: 1;
}

.custom-type-input-container {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-glass);
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 20px;
  animation: fadeIn 0.3s ease;
}

.inline-group {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 0;
}

.inline-group input {
  flex: 1;
}

/* Coordinates preview block with Update GPS button */
.coordinates-preview {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(15, 23, 42, 0.5);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  border: 1px solid var(--border-glass);
  margin-bottom: 20px;
}

.coordinates-preview div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.coordinates-preview i {
  width: 14px;
  height: 14px;
  color: var(--accent-primary);
}

/* Update GPS Button inside coordinate row */
.btn-gps-update {
  background: rgba(99, 102, 241, 0.20);
  border: 1px solid rgba(99, 102, 241, 0.45);
  color: #a5b4fc;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto; /* Push to the right */
  font-family: var(--font-family);
  transition: var(--transition-smooth);
}

.btn-gps-update:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
  transform: translateY(-1px);
}

.btn-gps-update i {
  width: 12px;
  height: 12px;
}

/* Upload Options Container */
.upload-options-container {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.upload-options-container .btn {
  flex: 1;
  justify-content: center;
  padding: 12px 16px;
}

/* Upload Dropzone */
.upload-dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  background: rgba(15, 23, 42, 0.2);
}

.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: var(--border-focus);
  background: rgba(99, 102, 241, 0.05);
}

.upload-icon {
  width: 32px;
  height: 32px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.upload-text {
  font-size: 13px;
  color: var(--text-secondary);
}

.upload-text span {
  color: var(--accent-primary);
  font-weight: 600;
}

.image-preview-container {
  position: relative;
  margin-top: 12px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-glass);
  max-height: 220px;
  display: flex;
  justify-content: center;
  background: #000;
}

.image-preview-container img {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
}

.remove-image-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(244, 63, 94, 0.9);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.remove-image-btn:hover {
  background: var(--accent-danger-hover);
  transform: scale(1.05);
}

/* Modal Footer & Buttons */
.modal-footer {
  padding-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn {
  padding: 10px 20px;
  border-radius: 10px;
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
}

.btn i {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--accent-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--accent-secondary);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--accent-secondary-hover);
}

.btn-danger {
  background: var(--accent-danger);
  color: #fff;
}

.btn-danger:hover {
  background: var(--accent-danger-hover);
}

.btn-accent {
  background: #8b5cf6;
  color: #fff;
}

.btn-accent:hover {
  background: #7c3aed;
}

.primary-btn-sm {
  padding: 6px 12px;
  background: var(--accent-primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.danger-btn-sm {
  padding: 6px 12px;
  background: var(--accent-danger);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.secondary-btn {
  padding: 10px 14px;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Details Modal Layout */
.details-container {
  max-width: 800px;
}

.details-body {
  max-height: calc(90vh - 100px);
}

.details-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
}

.details-image-wrapper {
  background: #000;
  border-radius: 12px;
  height: 350px;
  border: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.detail-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.detail-image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-muted);
  gap: 8px;
}

.detail-image-placeholder i {
  width: 48px;
  height: 48px;
  opacity: 0.4;
}

.detail-image-spinner {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.details-info-wrapper {
  display: flex;
  flex-direction: column;
}

.detail-category-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 20px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.details-info-wrapper h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.3;
}

.detail-coords-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.detail-coords-badge i {
  width: 14px;
  height: 14px;
  color: var(--accent-primary);
}

.detail-description-box {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 14px;
  flex: 1;
  overflow-y: auto;
  margin-bottom: 18px;
  max-height: 180px;
}

.detail-description-box h4 {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.detail-description-box p {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
}

.detail-dates-info {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 20px;
}

.detail-dates-info div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-dates-info i {
  width: 12px;
  height: 12px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-actions button {
  flex: 1;
  min-width: 110px;
  justify-content: center;
}

/* Loading Overlay for server calls */
.app-loader {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(12px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease;
}

.app-loader.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loader-content {
  text-align: center;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 1s linear infinite;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

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

/* Keyframes */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .app-container {
    flex-direction: column-reverse;
  }
  
  .sidebar {
    width: 100%;
    height: 50vh;
    border-right: none;
    border-top: 1px solid var(--border-glass);
  }
  
  .sidebar-body {
    padding: 16px;
  }
  
  .map-wrapper {
    height: 50vh;
  }
  
  .details-layout {
    grid-template-columns: 1fr;
  }
  
  .details-image-wrapper {
    height: 200px;
  }
  
  .btn-locate-me {
    bottom: 20px;
    right: 16px;
  }
}

/* Floating GPS Locate Button */
.btn-locate-me {
  position: absolute;
  bottom: 80px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(30, 41, 59, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  box-shadow: var(--shadow-premium);
  transition: var(--transition-smooth);
}

.btn-locate-me:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.55);
}

.btn-locate-me i {
  width: 22px;
  height: 22px;
}

/* Floating Map Layer Switcher */
.map-layer-switcher {
  position: absolute;
  top: 20px;
  left: 70px; /* Offset to float nicely next to the Leaflet zoom control */
  display: flex;
  gap: 8px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  padding: 6px;
  border-radius: 12px;
  z-index: 1000;
  box-shadow: var(--shadow-premium);
  animation: fadeInDown 0.5s ease;
}

.layer-switch-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: 8px;
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-smooth);
}

.layer-switch-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.layer-switch-btn.active {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.layer-switch-btn i {
  width: 14px;
  height: 14px;
  stroke-width: 2.5;
}

/* Responsive adjustments for Layer Switcher */
@media (max-width: 768px) {
  .map-layer-switcher {
    left: 12px;
    top: 12px;
    padding: 4px;
    gap: 4px;
  }
  
  .layer-switch-btn {
    padding: 6px 10px;
    font-size: 11px;
    gap: 4px;
  }
}

/* Sidebar Toggle Button for mobile/iPad */
.sidebar-toggle-btn {
  display: none; /* Hidden on desktop */
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.sidebar-toggle-btn i {
  width: 16px;
  height: 16px;
  transition: var(--transition-smooth);
}

/* Target Crosshair in the center of the map */
.map-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  pointer-events: none; /* Let clicks pass through */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
}

.map-crosshair i {
  width: 36px;
  height: 36px;
  color: var(--accent-primary);
  filter: drop-shadow(0 0 4px rgba(99, 102, 241, 0.6));
}

/* Floating Pin Center Button */
.btn-pin-center {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-primary);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 30px;
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
  transition: var(--transition-smooth);
}

.btn-pin-center:hover {
  background: var(--accent-primary-hover);
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.55);
}

.btn-pin-center i {
  width: 16px;
  height: 16px;
}

/* Responsive adjustments for mobile/iPad */
@media (max-width: 768px) {
  .sidebar-toggle-btn {
    display: flex; /* Show on mobile/iPad */
  }
  
  /* Sidebar collapsing state on mobile */
  .sidebar.collapsed {
    height: 70px; /* Only show header */
  }
  
  .sidebar.collapsed .sidebar-body,
  .sidebar.collapsed .sidebar-footer {
    display: none !important; /* Hide everything else */
  }
  
  .sidebar.collapsed + .map-wrapper {
    height: calc(100vh - 70px);
  }
  
  /* Rotate toggle arrow when collapsed */
  .sidebar.collapsed .sidebar-toggle-btn i {
    transform: rotate(180deg);
  }
  
  /* Reposition GPS button on mobile */
  .btn-locate-me {
    bottom: 20px;
    right: 16px;
  }
}


