/* =========================================
   RESET
========================================= */

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

/* =========================================
   APP SHELL
========================================= */

html, body {
  height: 100%;
  width: 100%;

  margin: 0;
  padding: 0;

  overflow: hidden;

  position: fixed;   /* IMPORTANT */
  inset: 0;
}

body {
    display: flex;
    flex-direction: column;
    font-family: Arial, Helvetica, sans-serif;

    background: white;
    color: #222;
}

/* =========================================
   APP
========================================= */

.app {
  height: 100vh;

  display: flex;
  flex-direction: column;

  overflow: hidden;
}

/* =========================================
   TOPBAR
========================================= */

.topbar {
  height: 64px;

  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0 24px;

  border-bottom: 1px solid #e5e7eb;

  background: white;
}

.logo {
  font-size: 24px;
  font-weight: 700;

  color: #f97316;
}

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-links a {
  text-decoration: none;

  color: #555;

  font-size: 15px;
}

/* =========================================
   SEARCH
========================================= */

.search-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 18px 24px;
  border-bottom: 1px solid #e5e7eb;
  background: white;
}

.search-bar {
  display: flex;

  max-width: 920px;

  border: 1px solid #d1d5db;
  border-radius: 12px;

  overflow: hidden;
}

.search-bar input {
  flex: 1;

  border: none;
  outline: none;

  padding: 18px;

  font-size: 16px;
}

.search-bar button {
  border: none;

  background: #f97316;
  color: white;

  padding: 0 28px;

  font-weight: 600;

  cursor: pointer;
}

/* =========================================
   FILTERS
========================================= */

.filters {
  display: flex;
  gap: 12px;

  margin-top: 16px;

  flex-wrap: wrap;
}

.filters select {
  min-width: 160px;

  padding: 12px 14px;

  border: 1px solid #d1d5db;
  border-radius: 10px;

  background: white;

  font-size: 14px;
}

/* =========================================
   MAIN LAYOUT
========================================= */

/* MAIN APP WRAPPER */
.layout {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.dashboard {
    display: flex;
    width: 100%;
    flex: 1;
}

/* =========================================
   SIDEBAR
========================================= */

/* SIDEBAR MUST BE A FLEX COLUMN */
.sidebar {
  width: 420px;
  min-width: 420px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  height: 100%;
}

/* =========================================
   TABS
========================================= */

.tabs {
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  border-bottom: 1px solid #e5e7eb;
  background: #fafafa;
}

.tab {
  flex: 1;

  border: none;
  background: transparent;

  padding: 16px 12px;

  font-size: 14px;
  font-weight: 600;

  cursor: pointer;
}

.tab.active {
  border-bottom: 2px solid #f97316;

  background: white;
}

/* =========================================
   RESULTS
========================================= */

.results {
  flex: 1;
  min-height: 0;        /* CRITICAL */
  overflow-y: scroll;     /* ENABLE SCROLL */
  overflow-x: hidden;
}

/* =========================================
   CARDS
========================================= */

.result-card {
  display: flex;
  gap: 16px;

  padding: 18px;

  border-bottom: 1px solid #f3f4f6;

  cursor: pointer;
}

.result-card:hover {
  background: #fafafa;
}

.result-image {
  width: 120px;
  height: 92px;

  border-radius: 10px;

  flex-shrink: 0;
}

.orange {
  background: #fed7aa;
}

.orange2 {
  background: #fdba74;
}

.orange3 {
  background: #fb923c;
}

.result-content h3 {
  font-size: 18px;

  margin-bottom: 8px;
}

.result-content p {
  font-size: 14px;

  line-height: 1.5;

  color: #666;

  margin-bottom: 10px;
}

.result-content span {
  font-size: 13px;

  color: #888;
}

.content-area {
    flex:1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

/* =========================================
   MAP
========================================= */

.map-container {
  flex: 1;

  position: relative;

  overflow: hidden;
}

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

/* =========================================
   FEED VIEW
========================================= */

.back-button {
  border: none;

  background: white;

  padding: 18px;

  text-align: left;

  font-weight: 600;

  border-bottom: 1px solid #e5e7eb;

  cursor: pointer;
}

.feed-header {
  padding: 20px 18px;

  border-bottom: 1px solid #f3f4f6;
}

.feed-header h2 {
  margin-bottom: 10px;
}

.entry-card {
  padding: 18px;

  border-bottom: 1px solid #f3f4f6;

  cursor: pointer;
}

.entry-card:hover {
  background: #fafafa;
}

/* =========================================
   MOBILE
========================================= */

@media (max-width: 900px) {


  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    min-width: 100%;

    height: 420px;
  }

  .map-container {
    height: 60vh;
  }

  .topbar {
    flex-direction: column;

    align-items: flex-start;

    height: auto;

    padding: 18px;

    gap: 14px;
  }
}