/* GLOBAL RESET */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f5f7;
  color: #222;
  padding: 20px;
}

/* APP WRAPPER */
#app {
  max-width: 1100px;
  margin: 0 auto;
}

/* HEADER */
.page-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
}

.header-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
}

/* FILTER TOGGLE BUTTON */
#filterToggle {
  display: block;
  width: 100%;
  background: #7b3fe4;
  color: white;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  font-size: 16px;
}

#filterToggle:hover {
  background: #6933c9;
}

/* FILTER PANEL */
#filters {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

#filters.collapsed {
  display: none;
}

#filters label {
  display: flex;
  flex-direction: column;
  font-size: 14px;
}

#filters select {
  padding: 8px;
  font-size: 14px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

/* MAP */
#map-container {
  width: 100%;
  height: 600px; /* larger map */
  margin-bottom: 20px;
}

#map {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* SEARCH BAR */
#tableSearch {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  margin-bottom: 10px;
  font-size: 14px;
}

/* TABLE HEADERS */
#table-headers {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 0.5fr 0.5fr;
  font-weight: bold;
  padding: 10px 0;
  border-bottom: 2px solid #ddd;
  font-size: 14px;
}

/* TABLE BODY */
#table-body {
  display: flex;
  flex-direction: column;
}

/* TABLE ROWS */
.table-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 0.5fr 0.5fr;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
  align-items: center;
  cursor: pointer;
  transition: background 0.2s;
}

.table-row:hover {
  background: #f0f0f0;
}

.table-row.active {
  background: #e0f3f7;
  border-left: 4px solid #0078d4;
}

/* CELL STYLING */
.cell {
  font-size: 14px;
}

.company {
  font-weight: bold;
  font-size: 16px;
}

.fb-icon {
  font-size: 18px;
  text-decoration: none;
  color: #1877f2;
  font-weight: bold;
}

/* CERT BADGES */
.cert-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  color: white;
}

.cert-yes {
  background: #1a7f37;
}

.cert-no {
  background: #777;
}

/* MOBILE OPTIMISATIONS */
@media (max-width: 700px) {
  .page-header {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }

  .header-logo {
    height: 32px;
  }

  .page-header h1 {
    font-size: 20px;
    line-height: 1.2;
  }

  #filterToggle {
    font-size: 15px;
    padding: 10px;
  }

  #filters {
    flex-direction: column;
    gap: 10px;
  }

  #filters select {
    padding: 10px;
    font-size: 15px;
  }

  #map-container {
    height: 650px; /* taller map for mobile */
  }

  #tableSearch {
    padding: 14px;
    font-size: 16px;
  }

  #table-headers {
    display: none;
  }

  .table-row {
    grid-template-columns: 1fr 1fr;
    grid-row-gap: 6px;
    padding: 14px;
    border-radius: 8px;
    background: white;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  }

  .table-row.active {
    background: #e8f6ff;
    border-left: none;
    box-shadow: 0 0 0 2px #0078d4 inset;
  }

  .company {
    grid-column: 1 / 3;
    font-size: 18px;
    font-weight: 600;
  }

  .fb-icon {
    font-size: 22px;
  }

  .cert-badge {
    font-size: 13px;
    padding: 5px 10px;
  }
}
