:root {
  --primary-color: #0f172a;
  --accent-color: #3b82f6;
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
}

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

body {
  margin: 0;
  background: #0f172a; /* Sleek dark background for the simulator */
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

/* Smartphone Device Frame Simulator */
.mobile-frame {
  background: #000000;
  width: 100%;
  max-width: 410px;
  height: 840px;
  border-radius: 40px;
  padding: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 
              0 0 0 4px #1e293b;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Speaker Notch */
.notch {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 130px;
  height: 24px;
  background: #000000;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
  z-index: 100;
}

/* Web App Container inside Phone */
.app-container {
  background: var(--bg-app);
  width: 100%;
  height: 100%;
  border-radius: 30px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: var(--text-dark);
}

.app-nav {
  background: var(--primary-color);
  color: white;
  text-align: center;
  padding: 30px 20px 16px 20px; /* Leave space for notch */
  flex-shrink: 0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.app-nav .brand {
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: 0.1em;
}

.app-nav .subtitle {
  font-size: 0.75rem;
  color: #94a3b8;
  text-transform: uppercase;
  margin-top: 2px;
  letter-spacing: 0.05em;
}

/* Scrollable Container Inside Phone */
.content-body {
  flex-grow: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  -webkit-overflow-scrolling: touch;
}

/* Custom Scrollbar for Phone Simulator */
.content-body::-webkit-scrollbar {
  width: 4px;
}
.content-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* Form Styles */
.section {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border-color);
}

.section h3 {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.section-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.4;
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 14px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-group {
  flex: 1;
  min-width: 0;
}

label {
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 0.8rem;
  color: #475569;
}

input, select, textarea {
  padding: 10px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-dark);
  background: #f8fafc;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  background: #ffffff;
}

/* Custom Drag-and-Drop Image Uploader Zone */
.file-upload-zone {
  border: 2px dashed #cbd5e1;
  background: #f8fafc;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.file-upload-zone:hover {
  background: #f1f5f9;
  border-color: var(--accent-color);
}

.upload-icon {
  font-size: 1.75rem;
  margin-bottom: 6px;
}

.upload-text {
  font-weight: 700;
  font-size: 0.85rem;
  color: #334155;
}

.upload-subtext {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Image Preview Container */
.file-preview-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  background: #f8fafc;
}

.file-preview-container img {
  max-width: 100%;
  max-height: 160px;
  border-radius: 8px;
  object-fit: contain;
}

.btn-remove-file {
  padding: 6px 14px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.75rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-remove-file:hover {
  opacity: 0.9;
}

/* Buttons */
.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.2s ease;
  margin-top: 10px;
}

.btn-primary:hover {
  background: #1e293b;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

/* List Feed style */
.posts-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.post-item {
  display: flex;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  gap: 12px;
}

.post-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border-color: #cbd5e1;
}

.post-item-img {
  width: 70px;
  height: 70px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: #f1f5f9;
}

.post-item-info {
  flex-grow: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.post-item-cat {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--accent-color);
  margin-bottom: 2px;
}

.post-item-info h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-item-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-item-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.empty-feed {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  padding: 20px 0;
}

.loading-spinner-small {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(0, 0, 0, 0.05);
  border-top-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 20px auto;
}

/* Coordinates Picker Map */
#picker-map {
  height: 160px;
  border-radius: 10px;
  border: 1.5px solid var(--border-color);
  margin-top: 6px;
  overflow: hidden;
  z-index: 1;
}

/* Tab View Toggle */
.view-toggle {
  display: flex;
  background: #cbd5e1;
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 16px;
  gap: 4px;
}

.toggle-btn {
  flex: 1;
  padding: 8px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.8rem;
  color: #475569;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  font-family: inherit;
}

.toggle-btn.active {
  background: #ffffff;
  color: var(--text-dark);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Active Chats Map View */
#chats-map {
  height: 320px;
  border-radius: 12px;
  border: 1.5px solid var(--border-color);
  overflow: hidden;
  z-index: 1;
}

/* Leaflet Map Popup Styling */
.leaflet-popup-content-wrapper {
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
}

.leaflet-popup-content {
  margin: 0 !important;
  line-height: inherit;
}

.map-popup-card {
  display: flex;
  flex-direction: column;
}

.map-popup-card img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-bottom: 1px solid var(--border-color);
}

.map-popup-info {
  padding: 8px 12px 12px 12px;
}

.map-popup-cat {
  font-size: 0.55rem;
  font-weight: 800;
  color: var(--accent-color);
  display: block;
  margin-bottom: 1px;
}

.map-popup-info h5 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-popup-info p {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-popup-chat {
  width: 100%;
  padding: 6px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.75rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-popup-chat:hover {
  opacity: 0.9;
}

/* Category Filter Chips */
.category-filters-container {
  overflow-x: auto;
  margin-bottom: 12px;
  width: 100%;
}

.category-filters-container::-webkit-scrollbar {
  display: none; /* Hide scroll bar on PWA slider */
}

.category-filters {
  display: flex;
  gap: 8px;
  padding: 2px 0 6px 0;
  width: max-content;
}

.filter-chip {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border-color);
  background: #ffffff;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.filter-chip:hover {
  border-color: #cbd5e1;
  color: var(--text-dark);
}

.filter-chip.active {
  background: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}

/* Location Search Bar styling */
.search-location-form {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: 24px; /* Rounded pill design */
  padding: 6px 14px;
  margin-bottom: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-location-form:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
}

#location-search-input {
  flex-grow: 1;
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text-dark);
  font-weight: 500;
}

#location-search-input::placeholder {
  color: var(--text-muted);
}

.btn-search-submit {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s;
}

.btn-search-submit:active {
  transform: scale(0.9);
}

/* Neighborhood Selector styling */
.neighborhood-selector-container {
  margin-bottom: 12px;
  width: 100%;
}

.neighborhood-dropdown-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  padding: 8px 12px;
  transition: border-color 0.2s, background-color 0.2s;
}

.neighborhood-dropdown-row:focus-within {
  border-color: var(--primary-color);
  background: #ffffff;
}

.dropdown-icon {
  font-size: 0.95rem;
}

.dropdown-filter {
  flex-grow: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dark);
  outline: none;
  cursor: pointer;
}

/* Dashboard Feed Styles */
.dashboard-feed {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.dash-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.dash-card-header {
  display: flex;
  gap: 12px;
  align-items: center;
}

.dash-card-img {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
}

.dash-card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
}

.dash-card-info h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
}

.dash-card-info p {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin: 0;
}

/* Status Badges / Chips */
.status-chip {
  align-self: flex-start;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.status-chip.active {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.status-chip.reserved {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.status-chip.sold {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.status-chip.found {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.status-chip.expired {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

/* Dashboard Controls Row */
.dash-status-controls {
  display: flex;
  gap: 6px;
  border-top: 1px dashed var(--border-color);
  padding-top: 10px;
}

.btn-status {
  flex-grow: 1;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 4px;
  border: 1.5px solid var(--border-color);
  background: #ffffff;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.btn-status:hover {
  background: #f8fafc;
  color: var(--text-dark);
}

.btn-status.active-btn.selected {
  background: #15803d;
  color: white;
  border-color: #15803d;
  box-shadow: 0 2px 4px rgba(21, 128, 61, 0.2);
}

.btn-status.reserved-btn.selected {
  background: #1d4ed8;
  color: white;
  border-color: #1d4ed8;
  box-shadow: 0 2px 4px rgba(29, 78, 216, 0.2);
}

.btn-status.sold-btn.selected {
  background: #b45309;
  color: white;
  border-color: #b45309;
  box-shadow: 0 2px 4px rgba(180, 83, 9, 0.2);
}

.btn-status.expired-btn.selected {
  background: #475569;
  color: white;
  border-color: #475569;
  box-shadow: 0 2px 4px rgba(71, 85, 105, 0.2);
}


