/* ==========================================================
   Picadas NIDO - Clean Minimal Mobile-First Design
   ========================================================== */

:root {
  --primary: #E11D48;
  --primary-hover: #BE123C;
  --bg-app: #FFFFFF;
  --surface: #FFFFFF;
  --surface-subtle: #F8FAFC;
  --border: #E2E8F0;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --star: #F59E0B;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 16px);
  --safe-top: env(safe-area-inset-top, 12px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  background-color: var(--bg-app);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

.app {
  width: 100vw;
  height: 100dvh;
  position: relative;
  overflow: hidden;
}

/* ==========================================================
   Map Canvas
   ========================================================== */

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

/* Leaflet Zoom Clean Position */
.leaflet-control-zoom {
  border: none !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
  margin-top: 140px !important;
}

.leaflet-control-zoom a {
  border: none !important;
  color: #334155 !important;
}

/* ==========================================================
   Floating Top Header
   ========================================================== */

.map-header {
  position: absolute;
  top: calc(var(--safe-top) + 8px);
  left: 12px;
  right: 12px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.search-bar {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 6px 8px;
  border-radius: 9999px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.search-input-wrap {
  display: flex;
  align-items: center;
  flex: 1;
  position: relative;
}

.search-icon {
  font-size: 0.85rem;
  margin-left: 8px;
  margin-right: 6px;
  opacity: 0.5;
}

.search-input-wrap input {
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-main);
  padding: 6px 26px 6px 0;
}

.search-clear {
  position: absolute;
  right: 6px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 4px;
}

.tool-btn {
  background: #F1F5F9;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s, background 0.15s;
}

.tool-btn:active {
  transform: scale(0.92);
  background: #E2E8F0;
}

/* ==========================================================
   Cuisine Filter Pills
   ========================================================== */

.cuisine-scroll {
  pointer-events: auto;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.cuisine-scroll::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  flex-shrink: 0;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 9999px;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  transition: all 0.15s ease;
}

.filter-pill.active {
  background: var(--text-main);
  color: #FFFFFF;
  border-color: var(--text-main);
}

/* ==========================================================
   Search Autocomplete Dropdown
   ========================================================== */

.search-dropdown {
  pointer-events: auto;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  max-height: 320px;
  overflow-y: auto;
  margin-top: 2px;
}

.dropdown-header {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface-subtle);
  padding: 6px 12px;
}

.dropdown-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #F1F5F9;
  cursor: pointer;
}

.dropdown-row:hover,
.dropdown-row:active {
  background: var(--surface-subtle);
}

.dropdown-row-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.dropdown-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================
   Custom Marker Pins
   ========================================================== */

.custom-leaflet-marker {
  background: none;
  border: none;
}

.clean-pin {
  width: 36px;
  height: 36px;
  border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
  background: var(--pin-color, #E11D48);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.22);
  border: 2px solid #FFFFFF;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.clean-pin span {
  transform: rotate(45deg);
  font-size: 1.15rem;
  line-height: 1;
}

.clean-pin:hover,
.clean-pin.active {
  transform: rotate(-45deg) scale(1.15);
}

.nido-anchor .clean-pin {
  background: #4F46E5 !important;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.25), 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* ==========================================================
   FAB Add Button (+ Picada)
   ========================================================== */

.fab-add {
  position: absolute;
  bottom: calc(var(--safe-bottom) + 18px);
  right: 18px;
  z-index: 1000;
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  border-radius: 9999px;
  padding: 15px 26px;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 26px rgba(225, 29, 72, 0.45);
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}

.fab-add:active {
  transform: scale(0.95);
  background: var(--primary-hover);
}

.fab-plus {
  font-size: 1.45rem;
  line-height: 1;
  margin-top: -1px;
}

/* Picking mode banner */
.pick-banner {
  position: absolute;
  top: 110px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: #0F172A;
  color: #FFFFFF;
  padding: 8px 16px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.btn-sm-done {
  background: #10B981;
  color: #FFFFFF;
  border: none;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 9999px;
  cursor: pointer;
  font-size: 0.8rem;
}

/* ==========================================================
   Bottom Sheets (Details & Add Form)
   ========================================================== */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 2000;
}

.sheet-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2100;
  background: #FFFFFF;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  padding: 12px 18px calc(var(--safe-bottom) + 16px) 18px;
  max-height: 82dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}

@media (min-width: 600px) {
  .sheet-drawer {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 20px;
    bottom: 20px;
  }
}

.sheet-drawer.hidden {
  transform: translateY(105%);
}

@media (min-width: 600px) {
  .sheet-drawer.hidden {
    transform: translate(-50%, 120%);
  }
}

.sheet-handle {
  width: 36px;
  height: 4px;
  background: #CBD5E1;
  border-radius: 9999px;
  margin: 0 auto 12px auto;
}

.sheet-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: #F1F5F9;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Details Sheet Body */
.details-headline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.details-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #FFE4E6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.details-title {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.2;
}

.details-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.meta-star {
  color: var(--star);
  font-weight: 600;
}

.details-comment {
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-main);
  background: var(--surface-subtle);
  padding: 10px 12px;
  border-radius: 10px;
  margin: 12px 0 8px 0;
}

.details-author {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.btn-gmaps {
  width: 100%;
  background: #0F172A;
  color: #FFFFFF;
  text-decoration: none;
  border-radius: 12px;
  padding: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.15s;
}

.btn-gmaps:active {
  opacity: 0.85;
}

/* Report link in details */
.report-link {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-top: 10px;
  text-align: center;
  width: 100%;
}

.report-link:hover {
  text-decoration: underline;
  color: var(--primary);
}

/* Info & Feedback Sheet */
.info-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.info-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.feedback-card {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.feedback-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
}

.feedback-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.btn-feedback {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0F172A;
  color: #FFFFFF;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: opacity 0.15s;
}

.btn-feedback:active {
  opacity: 0.85;
}

.copyright-box {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

/* ==========================================================
   Add Form Styling (Clean, Mobile First)
   ========================================================== */

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

.add-sheet-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
}

.add-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.form-row input[type="text"],
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-main);
  outline: none;
  background: #FFFFFF;
}

.form-row input[type="text"]:focus,
.form-row select:focus,
.form-row textarea:focus {
  border-color: var(--text-main);
}

.location-tag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #F1F5F9;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  color: var(--text-main);
  margin-top: 4px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
}

.place-search-box {
  position: relative;
}

.suggestions-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  max-height: 180px;
  overflow-y: auto;
  z-index: 50;
}

.sugg-item {
  padding: 8px 10px;
  font-size: 0.8rem;
  border-bottom: 1px solid #F1F5F9;
  cursor: pointer;
}

.sugg-item:hover,
.sugg-item:active {
  background: var(--surface-subtle);
}

/* Icon selector */
.icon-selector {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.icon-selector::-webkit-scrollbar {
  display: none;
}

.icon-chip {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: #FFFFFF;
  border-radius: 10px;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-chip.active {
  background: #FFE4E6;
  border-color: var(--primary);
}

/* Stars */
.stars-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.star-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #CBD5E1;
  cursor: pointer;
  padding: 0 2px;
}

.star-btn.active {
  color: var(--star);
}

.star-label {
  font-size: 0.82rem;
  font-weight: 600;
  margin-left: 6px;
  color: var(--text-muted);
}

.btn-submit {
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  border-radius: 12px;
  padding: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin-top: 6px;
}

.btn-submit:active {
  background: var(--primary-hover);
}

.form-error {
  background: #FEE2E2;
  color: #DC2626;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
}

/* ==========================================================
   Toast Notification
   ========================================================== */

.toast {
  position: fixed;
  bottom: calc(var(--safe-bottom) + 72px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  background: #0F172A;
  color: #FFFFFF;
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  pointer-events: none;
}

.hidden {
  display: none !important;
}