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

:root {
  --font-family: 'Outfit', sans-serif;
  
  /* Color Palette (HSL) */
  --bg-primary: #0f1319;
  --bg-sidebar: rgba(18, 24, 38, 0.85);
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-hover: rgba(51, 65, 85, 0.8);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: hsla(230, 85%, 60%, 0.5);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-highlight: #6366f1;
  
  /* Category Colors */
  --color-tourism: #10b981;  /* Emerald */
  --color-food: #f97316;     /* Orange */
  --color-hotel: #0ea5e9;    /* Sky Blue */
  --color-nature: #0d9488;   /* Teal */
  --color-custom: #a855f7;   /* Purple */
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.3);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

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

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

/* Sidebar Styling */
.sidebar {
  width: 380px;
  min-width: 380px;
  height: 100%;
  background: var(--bg-sidebar);
  backdrop-filter: blur(16px) saturate(180%);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: var(--transition);
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.2);
}

.sidebar.collapsed {
  margin-left: -380px;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo i {
  font-size: 1.5rem;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-logo h5 {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #fff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* Scrollbar Customization */
.sidebar-content::-webkit-scrollbar {
  width: 6px;
}

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

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

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

.sidebar-footer {
  padding: 15px 20px;
  border-top: 1px solid var(--border-color);
  background: rgba(10, 15, 26, 0.4);
}

/* Toggle Sidebar Trigger */
.sidebar-toggle-btn {
  position: absolute;
  left: 380px;
  top: 20px;
  z-index: 1010;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-left: none;
  color: var(--text-main);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 10px 12px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.sidebar-toggle-btn:hover {
  background: var(--bg-primary);
  color: var(--text-highlight);
}

.sidebar.collapsed + .sidebar-toggle-btn {
  left: 0;
}

/* Map Container */
.map-container-wrap {
  flex: 1;
  height: 100%;
  position: relative;
}

#map {
  height: 100%;
  width: 100%;
  z-index: 1;
}

/* UI Card Glassmorphism */
.glass-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 15px;
  margin-bottom: 20px;
  transition: var(--transition);
}

.glass-panel:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Typography & Inputs */
label {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 5px;
  display: block;
}

.form-control, .form-select {
  background-color: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-family);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.9rem;
  transition: var(--transition);
}

.form-control:focus, .form-select:focus {
  background-color: rgba(15, 23, 42, 0.9);
  border-color: var(--border-focus);
  color: var(--text-main);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-control::placeholder {
  color: #64748b;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  border: none;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 10px;
  transition: var(--transition);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4338ca, #4f46e5);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-main);
}

/* Category Badges */
.badge-category {
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-tourism { background: rgba(16, 185, 129, 0.15); color: var(--color-tourism); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-food { background: rgba(249, 115, 22, 0.15); color: var(--color-food); border: 1px solid rgba(249, 115, 22, 0.3); }
.badge-hotel { background: rgba(14, 165, 233, 0.15); color: var(--color-hotel); border: 1px solid rgba(14, 165, 233, 0.3); }
.badge-nature { background: rgba(13, 148, 136, 0.15); color: var(--color-nature); border: 1px solid rgba(13, 148, 136, 0.3); }
.badge-custom { background: rgba(168, 85, 247, 0.15); color: var(--color-custom); border: 1px solid rgba(168, 85, 247, 0.3); }

/* Saved Locations Items */
.location-item {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: var(--transition);
}

.location-item:hover {
  background: var(--bg-card-hover);
  transform: scale(1.02);
  border-color: rgba(255, 255, 255, 0.15);
}

.location-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.location-item-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.location-item-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

.location-item-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.action-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 0.85rem;
  border-radius: 4px;
  transition: var(--transition);
}

.action-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
}

.action-btn.delete:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* Floating Controls on Map */
.map-overlay-panel {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 1000;
  background: var(--bg-sidebar);
  backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px;
  box-shadow: var(--shadow-lg);
  display: flex;
  gap: 8px;
}

.map-coords-indicator {
  position: absolute;
  bottom: 15px;
  left: 15px;
  z-index: 1000;
  background: var(--bg-sidebar);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.8rem;
  color: var(--text-main);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  pointer-events: none;
}

/* Customized Leaflet Popups */
.leaflet-popup-content-wrapper {
  background: #111827 !important;
  color: #f3f4f6 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-lg) !important;
  padding: 5px;
}

.leaflet-popup-tip {
  background: #111827 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

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

.popup-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
  color: #fff;
}

.popup-desc {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-bottom: 8px;
  line-height: 1.3;
}

.popup-badge {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 600;
}

/* Custom Marker Styling */
.custom-div-icon {
  background: none;
  border: none;
}

.marker-pin-wrapper {
  position: relative;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.marker-pin-glow {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  opacity: 0.4;
  animation: pulse 2s infinite;
}

.marker-pin {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 6px rgba(0,0,0,0.3);
}

.marker-pin::after {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
}

.marker-pin i {
  color: #fff;
  transform: rotate(45deg);
  font-size: 10px;
  z-index: 2;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.4; }
  70% { transform: scale(2.5); opacity: 0; }
  100% { transform: scale(1); opacity: 0; }
}

/* Measurement indicator styling */
.measurement-tooltip {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-weight: 600;
  font-size: 0.75rem;
  border-radius: 4px;
  padding: 2px 6px;
}

/* Toast Notification */
.toast-container-custom {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast-custom {
  background: rgba(18, 24, 38, 0.9);
  backdrop-filter: blur(10px);
  border-left: 4px solid var(--text-highlight);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  transform: translateX(120%);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-custom.show {
  transform: translateX(0);
}

.toast-custom.success { border-left-color: var(--color-tourism); }
.toast-custom.error { border-left-color: #ef4444; }
.toast-custom.info { border-left-color: var(--color-hotel); }

/* Edit Modal Design */
.modal-content {
  background: var(--bg-sidebar);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: var(--radius-lg);
}

.modal-header {
  border-bottom: 1px solid var(--border-color);
}

.modal-footer {
  border-top: 1px solid var(--border-color);
}

.modal-title {
  font-weight: 700;
}

.btn-close-white {
  filter: invert(1) grayscale(100%) brightness(200%);
}

/* Empty state styling */
.empty-state {
  text-align: center;
  padding: 30px 10px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.3;
}

.empty-state p {
  font-size: 0.85rem;
  margin: 0;
}
