@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Manrope:wght@400;500;600;700&display=swap");

:root {
  --bg: #e7f5f3;
  --panel: rgba(242, 251, 249, 0.76);
  --panel-strong: rgba(248, 255, 254, 0.92);
  --ink: #123b39;
  --muted: #4d7572;
  --line: rgba(33, 137, 133, 0.18);
  --accent: #218985;
  --accent-soft: rgba(33, 137, 133, 0.14);
  --shadow: 0 24px 60px rgba(24, 91, 88, 0.14);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(33, 137, 133, 0.22), transparent 24%),
    radial-gradient(circle at bottom right, rgba(110, 193, 187, 0.24), transparent 22%),
    linear-gradient(135deg, #effaf8 0%, #dcefed 100%);
}

body.modal-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

.page-shell,
.page-shell button,
.page-shell input,
.page-shell p,
.page-shell div,
.page-shell span {
  font-family: "Manrope", sans-serif !important;
}

.page-shell {
  position: relative;
  width: min(1440px, calc(100% - 48px));
  margin: 24px auto;
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 36px;
  background: rgba(246, 254, 253, 0.8);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.ambient {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  filter: blur(24px);
  opacity: 0.4;
  pointer-events: none;
}

.ambient-left {
  top: -100px;
  left: -80px;
  background: rgba(33, 137, 133, 0.34);
}

.ambient-right {
  right: -100px;
  bottom: -120px;
  background: rgba(86, 183, 176, 0.34);
}

.topbar,
.controls-panel,
.pagination-bar {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
}

.page-shell h1 {
  margin: 0;
  font-family: "Cormorant Garamond", serif !important;
  font-size: clamp(48px, 6vw, 86px);
  line-height: 0.92;
  font-weight: 600;
}

.controls-panel {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-top: 28px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
}

.tabs {
  display: flex;
  gap: 12px;
}

.tab-button,
.page-button {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 18px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  transition: all 180ms ease;
}

.tab-button.active {
  background: var(--accent);
  color: #f4fffe;
  box-shadow: 0 14px 28px rgba(33, 137, 133, 0.22);
}

.search-wrap {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.search-wrap input {
  width: min(420px, 100%);
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  outline: none;
}

.search-wrap input:focus {
  border-color: rgba(157, 61, 44, 0.4);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.cards-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.cards-grid.page-enter-forward {
  animation: pageSlideForward 260ms ease;
}

.cards-grid.page-enter-backward {
  animation: pageSlideBackward 260ms ease;
}

.person-card {
  display: flex;
  flex-direction: column;
  min-height: 260px;
  padding: 18px;
  border: 1px solid rgba(56, 40, 27, 0.1);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(232, 247, 245, 0.96));
  box-shadow: 0 12px 30px rgba(24, 91, 88, 0.1);
  overflow: hidden;
}

.person-card.clickable {
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.person-card.clickable:hover {
  transform: translateY(-4px);
  border-color: rgba(33, 137, 133, 0.28);
  box-shadow: 0 18px 36px rgba(24, 91, 88, 0.16);
}

.person-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  object-fit: cover;
  background: linear-gradient(135deg, #b9e5e1, #edf9f7);
}

.page-shell .person-name {
  margin: 14px 0 8px;
  font-family: "Cormorant Garamond", serif !important;
  font-size: 20px !important;
  line-height: 1.2;
  font-weight: 700 !important;
}

.name-line {
  display: block;
}

.person-description {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.person-footer {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  align-items: center;
  margin-top: auto;
  padding-top: 14px;
}

.ambassador-progress-wrap {
  width: 100%;
  margin-top: auto;
}

.ambassador-progress {
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: rgba(33, 137, 133, 0.12);
  overflow: hidden;
}

.ambassador-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.ambassador-progress-label {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-align: right;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(18, 59, 57, 0.08);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.status-pill[data-status="done"] {
  background: rgba(63, 167, 111, 0.18);
  color: #1d6a45;
}

.status-pill[data-status="ongoing"] {
  background: rgba(33, 137, 133, 0.18);
  color: #145d5a;
}

.status-pill[data-status="candidate"] {
  background: rgba(211, 84, 84, 0.18);
  color: #9a2f2f;
}

.donation-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(33, 137, 133, 0.14);
  color: #145d5a;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  overflow-wrap: anywhere;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 320px;
  margin-top: 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-xl);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.56);
}

.hidden {
  display: none;
}

.pagination-bar {
  display: flex;
  justify-content: center;
  gap: 18px;
  align-items: center;
  margin-top: 24px;
  flex-wrap: wrap;
}

.page-button {
  min-width: 120px;
  max-width: 100%;
  background: rgba(255, 255, 255, 0.88);
  border-color: var(--line);
}

.page-button:disabled {
  opacity: 0.38;
  cursor: default;
}

.page-indicator {
  margin: 0;
  min-width: 120px;
  text-align: center;
  font-weight: 700;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(14, 49, 47, 0.42);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 220ms ease;
}

.modal-overlay.hidden {
  display: none;
}

.modal-overlay.is-visible {
  opacity: 1;
}

.modal-panel {
  width: min(860px, 100%);
  max-height: min(82vh, 900px);
  overflow: auto;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 30px 0 0 30px;
  background: rgba(245, 253, 252, 0.96);
  box-shadow: 0 28px 60px rgba(14, 49, 47, 0.24);
  scrollbar-width: thin;
  scrollbar-color: rgba(157, 61, 44, 0.72) rgba(157, 61, 44, 0.1);
  background-clip: padding-box;
  transform: translateY(20px) scale(0.98);
  opacity: 0;
  transition: transform 220ms ease, opacity 220ms ease;
}

.modal-overlay.is-visible .modal-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.modal-panel::-webkit-scrollbar {
  width: 12px;
}

.modal-panel::-webkit-scrollbar-track {
  margin: 18px 10px 18px 0;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(33, 137, 133, 0.08), rgba(18, 59, 57, 0.08));
}

.modal-panel::-webkit-scrollbar-thumb {
  border: 2px solid rgba(245, 253, 252, 0.96);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(33, 137, 133, 0.96), rgba(24, 104, 100, 0.96)) padding-box,
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.1)) border-box;
}

.modal-panel::-webkit-scrollbar-thumb:hover {
  background:
    linear-gradient(180deg, rgba(43, 156, 151, 0.98), rgba(26, 116, 111, 0.98)) padding-box,
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.18)) border-box;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.modal-title {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 0.95;
}

.modal-close {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  background: white;
  color: var(--ink);
  cursor: pointer;
}

.modal-content {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.related-card {
  padding: 16px;
  border: 1px solid rgba(33, 137, 133, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
}

.related-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  margin-bottom: 14px;
  border-radius: 16px;
  object-fit: cover;
  background: linear-gradient(135deg, #b9e5e1, #edf9f7);
}

.page-shell .related-name,
.modal-panel .related-name {
  margin: 0 0 8px;
  font-family: "Cormorant Garamond", serif !important;
  font-size: 18px !important;
  line-height: 0.98;
  font-weight: 700 !important;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.related-description {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.modal-empty {
  margin: 20px 0 0;
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 20px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.6);
}

@media (max-width: 1320px) {
  .cards-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  .page-shell {
    width: min(100% - 24px, 1440px);
    padding: 22px;
  }

  .topbar,
  .controls-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .search-wrap {
    justify-content: stretch;
  }

  .cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tabs {
    flex-direction: column;
  }

  .modal-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 44px;
  }

  .pagination-bar {
    gap: 10px;
  }

  .page-button {
    min-width: 0;
    flex: 1 1 140px;
  }

  .page-indicator {
    min-width: 0;
    width: 100%;
    order: -1;
  }
}

@keyframes pageSlideForward {
  from {
    opacity: 0;
    transform: translateX(18px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pageSlideBackward {
  from {
    opacity: 0;
    transform: translateX(-18px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}
