/* General resets */
body {
  margin: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f8f9fa;
  color: #222;
}

.toolbox-title {
  margin: 32px auto 0 auto;
  text-align: center;
  font-size: 3.15em;
  font-weight: 700;
  color: #0077b6;
  letter-spacing: 0.01em;
}

/* Intro text under main heading */
.toolbox-intro {
  max-width: 1000px;
  margin: 16px auto 28px auto;
  padding: 0 24px;
  text-align: center;
  color: #444;
  font-size: 1.06em;
  line-height: 1.65;
}
@media (max-width: 600px) {
  .toolbox-intro {
    padding: 0 16px;
    font-size: 1em;
  }
}

/* Dashboard Layout */
.toolbox-dashboard {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 0 0 0;
}
.toolbox-toc {
  min-width: 220px;
  max-width: 260px;
  padding: 24px 16px;
  background: #f8f8f8;
  border-radius: 8px;
  height: fit-content;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.toolbox-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.toolbox-toc li {
  margin-bottom: 18px;
}
.toolbox-toc a {
  color: #0077b6;
  text-decoration: none;
  font-weight: 500;
  font-size: 1.08em;
  transition: color 0.2s;
}
.toolbox-toc a:hover {
  color: #023e8a;
}
.toolbox-main {
  flex: 1;
  min-width: 0;
}

/* Sidebar Tile Menu (visual only; behavior unchanged) */
.toolbox-toc .tile-menu {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.toolbox-toc .menu-item {
  position: relative;
  display: block;
  width: 100%;
  height: 120px;
  text-decoration: none;
  border-radius: 6px;
  overflow: hidden;
}
.toolbox-toc .menu-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
  display: block;
}
.toolbox-toc .menu-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #000;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
  font-size: 16px;
}
.toolbox-toc .menu-item:hover .menu-text,
.toolbox-toc .menu-item:focus .menu-text {
  text-decoration: underline;
}

/* Map Section */
#map-section {
  margin-bottom: 24px;
}
.country-select-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
}
.country-select-row #map-label {
  font-weight: bold;
  margin-bottom: 8px;
  display: block;
  flex: 1;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}


.country-select-row #country-dropdown {
  margin-bottom: 12px;
  width: 220px;
  padding: 8px 12px;
  border: 1px solid #bbb;
  border-radius: 4px;
  background: #f4f4f4;
  font-size: 1em;
  transition: border 0.2s;
}
#country-dropdown:focus {
  border-color: #0077b6;
  outline: none;
}

/* Filter Bar */
#filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 8px 8px 8px;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  justify-content: center;
}
#filter-bar select {
  padding: 8px 12px;
  border: 1px solid #bbb;
  border-radius: 4px;
  background: #f4f4f4;
  font-size: 1em;
  min-width: 140px;
  transition: border 0.2s;
}
#filter-bar select:focus {
  border-color: #0077b6;
  outline: none;
}

/* Map */
#map {
  width: 100%;
  height: 500px;
  margin: 0 auto 24px auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  max-width: 1200px;
}

/* Project List Grid */
#project-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding: 16px;
  max-width: 1200px;
  margin: 0 auto 32px auto;
}
@media (min-width: 600px) {
  #project-list {
    grid-template-columns: 1fr 1fr;
  }
}
@media (min-width: 900px) {
  #project-list {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

/* Project Card */
.project-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  padding: 20px 18px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-left: 4px solid #0077b6;
  transition: box-shadow 0.2s;
}
.project-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.project-card h3 {
  margin: 0 0 6px 0;
  font-size: 1.18em;
  color: #0077b6;
}
.project-card p {
  margin: 0 0 6px 0;
  font-size: 0.98em;
  color: #444;
}
.project-card .view-details {
  margin-top: 8px;
  align-self: flex-start;
  background: #0077b6;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 7px 16px;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.2s;
}
.project-card .view-details:hover {
  background: #023e8a;
}

/* Simple pill chips for table badges */
.project-table .pill {
  display: inline;
  margin-right: 6px;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  background: transparent;
  color: inherit;
  vertical-align: baseline;
}
.project-table .pill-neutral {
  color: inherit;
}

/* Keep tables contained in modals and allow wrapping */
.project-table {
  overflow-x: auto;
}
.project-table table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}
.project-table th,
.project-table td {
  word-break: break-word;
  white-space: normal;
}

/* Modal Overlay */
#project-modal {
  display: none;
  position: fixed;
  z-index: 1001;
  left: 0; top: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.45);
  align-items: center;
  justify-content: center;
}
#project-modal .modal-content {
  background: #fff;
  border-radius: 10px;
  max-width: 95vw;
  width: 480px;
  max-height: 90vh;
  margin: 40px auto;
  padding: 28px 22px 22px 22px;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  animation: modalIn 0.18s;
}
@keyframes modalIn {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
#project-modal .close-modal {
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 1.7em;
  color: #0077b6;
  cursor: pointer;
  font-weight: bold;
}
#project-modal h2 {
  margin-top: 0;
  color: #0077b6;
}
#project-modal p {
  margin: 8px 0;
}
#project-modal .modal-content > div {
  margin-top: 16px;
  font-size: 1em;
  color: #222;
  line-height: 1.6;
  word-break: break-word;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .toolbox-dashboard {
    flex-direction: column;
    gap: 0;
    padding: 0;
  }
  .toolbox-toc {
    margin-bottom: 24px;
    width: 100%;
    max-width: none;
  }
  .toolbox-main {
    width: 100%;
  }
}
@media (max-width: 600px) {
  #filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  #map {
    height: 320px;
  }
  #project-list {
    padding: 8px;
    gap: 12px;
  }
  #project-modal .modal-content {
    width: 98vw;
    padding: 16px 6vw 16px 6vw;
  }
}