:root {
  --color-brand--1: #4dabf7; /* soft blue accent */
  --color-brand--2: #3ad9aa; /* mint green secondary */

  --color-dark--1: #1f2933; /* deep slate */
  --color-dark--2: #323f4b; /* softer dark gray */

  --color-light--1: #9aa5b1; /* muted gray */
  --color-light--2: #e4e7eb; /* light gray */
  --color-light--3: #f5f7fa; /* near-white */

  /* type colors (badge) – tweak to palette */
  --type-library: #fee440;
  --type-coffee-shop: #9b5de5;
  --type-park: #00f5d4;
  --type-study-lounge: #00bbf9;
}

/* ------------------------ */
/* GENERAL */
/* ------------------------ */

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

html {
  font-size: 62.5%;
  box-sizing: border-box;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Manrope', sans-serif;
  color: #343a40;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.container {
  width: 60%;
  margin: 0 auto;
}

.container-header,
section {
  margin-bottom: 96px;
}

h2 {
  font-size: 36px;
  letter-spacing: -0.5px;
  margin-bottom: 48px;
  text-align: center;
}

.grid-3-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 80px;
}

.btn:link,
.btn:visited {
  background-color: var(--color-brand--2);
  color: #fff;
  text-decoration: none;
  text-transform: uppercase;
  font-weight: 500;
  display: inline-block;
  border-radius: 100px;
}

.btn:hover,
.btn:active {
  background-color: #01ca8e;
}

.btn--big {
  font-size: 18px;
  padding: 16px 32px;
}

.btn--small {
  font-size: 14px;
  padding: 8px 12px;
}

img {
  border-radius: 12px;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  z-index: 5;
}

.hidden {
  display: none;
}

/* ------------------------ */
/* NAV BAR */
/* ------------------------ */

.logo-container {
  padding: 3rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo-image {
  width: 7rem;
}

.logo-text {
  font-size: 4rem;
  font-weight: 700;
}

/* ------------------------ */
/* HERO SECTION */
/* ------------------------ */

.container-header {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 70px;
  margin-top: 64px;
}

.header-text-box {
  align-self: center;
}

h1 {
  font-size: 32x;
  margin-bottom: 24px;
  line-height: 1.1;
  letter-spacing: -1px;
}

.header-text {
  font-size: 18px;
  line-height: 2;
  margin-bottom: 25px;
}

img {
  width: 115%;
}

/* ------------------------ */
/* FEATURES SECTION */
/* ------------------------ */
.features-icon {
  stroke: var(--color-brand--2);
  width: 32px;
  height: 32px;
  margin-bottom: 24px;
}

.features-title {
  font-size: 20px;
  margin-bottom: 16px;
}

.features-text {
  font-size: 18px;
  line-height: 1.7;
}

/* ------------------------ */
/* MAP SECTION */
/* ------------------------ */
.app-section {
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.map-container {
  height: 90vh;
  width: 85%;
  display: flex;
  border-radius: 2.5rem;
  background: var(--color-dark--1);
}

.map-container #map {
  height: 100%;
  width: 100%;
  border-radius: 0 2.5rem 2.5rem 0;
  border-right: 1px solid rgba(236, 236, 236, 0.06);
  box-shadow: 6px 0 24px rgba(0, 0, 0, 0.25);
}

/* Popup width is defined in JS using options */
.leaflet-popup .leaflet-popup-content-wrapper {
  background-color: var(--color-dark--1);
  color: var(--color-light--2);
  border-radius: 5px;
  padding-right: 0.6rem;
}
.leaflet-popup .leaflet-popup-content {
  font-size: 1.35rem;
  line-height: 1.35;
}
.leaflet-popup .leaflet-popup-tip {
  display: none !important;
}

/* type-colored left bars (you already set) */
.library-popup .leaflet-popup-content-wrapper {
  border-left: 5px solid var(--type-library);
}
.coffee-shop-popup .leaflet-popup-content-wrapper {
  border-left: 5px solid var(--type-coffee-shop);
}
.park-popup .leaflet-popup-content-wrapper {
  border-left: 5px solid var(--type-park);
}
.study-lounge-popup .leaflet-popup-content-wrapper {
  border-left: 5px solid var(--type-study-lounge);
}

/* inner layout */
.leaflet-popup .popup {
  display: grid;
  gap: 0.6rem;
  padding: 0.4rem 0.4rem 0.6rem 0.2rem;
}
.leaflet-popup .popup__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}
.leaflet-popup .popup__badge {
  display: inline-block;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.2rem 0.8rem;
  border-radius: 999px;
  color: #111;
  background: var(--type-library); /* default */
}
.leaflet-popup .popup__badge--library {
  background: var(--type-library);
}
.leaflet-popup .popup__badge--coffee-shop {
  background: var(--type-coffee-shop);
}
.leaflet-popup .popup__badge--park {
  background: var(--type-park);
}
.leaflet-popup .popup__badge--study-lounge {
  background: var(--type-study-lounge);
}

.leaflet-popup .popup__date {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--color-light--1);
  font-size: 0.95rem;
}

.leaflet-popup .popup__loc {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--color-light--2);
}

.leaflet-popup .popup__loc span {
  display: inline-block;
  max-width: 22ch;
  white-space: normal;
}

/* ------------------------ */
/* SIDEBAR / FORM  SECTION */
/* ------------------------ */
.map-container .sidebar {
  flex-basis: 50rem;
  max-width: 520px;
  padding: 6rem 3.2rem;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;

  background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.02),
      rgba(255, 255, 255, 0)
    ),
    var(--color-dark--2);
  border-right: 1px solid rgba(236, 236, 236, 0.06);
  box-shadow: 6px 0 24px rgba(0, 0, 0, 0.25);
}

.sidebar-title {
  margin-bottom: 2rem;
  font-size: 2.5rem;
  letter-spacing: 0.2px;
  color: var(--color-light--2);
  font-weight: 700;
}

.form {
  display: grid;
  gap: 2.5rem;
}

.form label {
  display: block;
  margin-bottom: 1rem;
  font-size: 1.25rem;
  color: var(--color-light--2);
}

/* Inputs  */
.form select,
.form input[type='text'],
.form input[type='number'],
.form textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  border: 0px solid rgba(236, 236, 236, 0.08);
  background: #20262b; /* slightly lighter than dark--2 for contrast */
  color: var(--color-light--3);
  outline: none;
}

.form select:focus,
.form input:focus,
.form textarea:focus {
  border-color: var(--color-brand--1);
  box-shadow: 0 0 0 1px rgba(255, 181, 69, 0.25);
  background: #232a30;
}

.form textarea {
  resize: vertical;
  min-height: 9rem;
}

.row {
  display: flex;
  gap: 4rem;
}
.row > div {
  flex: 1;
}

.form input[type='checkbox'] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  width: 18px;
  height: 18px;
  border-radius: 4px;
  margin-top: 0.7rem;
  margin-right: 6px;
  cursor: pointer;

  border: 2px solid var(--color-light--1);
  background: transparent;
  position: relative;
  vertical-align: middle;
}

/* When checked */
.form input[type='checkbox']:checked {
  background: var(--color-brand--2);
  border-color: var(--color-brand--2);
}

/* White checkmark when checked */
.form input[type='checkbox']:checked::after {
  content: '✓';
  color: white;
  font-size: 12px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -58%);
}

/* When Unchecked*/
.form input[type='checkbox']:focus {
  box-shadow: none;
}

/* ---- STARS ---- */
.stars-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.stars-row > label {
  margin: 0;
}

.stars {
  display: flex;
  gap: 6px;
  direction: rtl;
}

.stars input {
  display: none;
}

.stars label {
  margin-bottom: 3px;
  font-size: 2.5rem;
  cursor: pointer;
  color: var(--color-light--1); /* unselected */
  transition: transform 0.08s ease, color 0.12s ease;
}

.stars input:checked ~ label,
.stars label:hover,
.stars label:hover ~ label {
  color: var(--color-brand--1); /* gold */
}
.stars label:hover {
  transform: scale(1.08);
}

/* ---- Submit button  ---- */
.form__btn {
  width: 100%;
  appearance: none;
  border: 0;
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  font-weight: 700;
  color: #1a1f23;
  cursor: pointer;

  /* brand gradient */
  background: linear-gradient(
    90deg,
    var(--color-brand--1),
    var(--color-brand--2)
  );
  box-shadow: 0 6px 18px rgba(0, 196, 106, 0.25);
  transition: transform 0.05s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

.form__btn:hover {
  filter: brightness(1.05);
}
.form__btn:active {
  transform: translateY(1px);
}

/* ---- Small screens ---- */
@media (max-width: 880px) {
  .container {
    flex-direction: column;
  }

  .map-container .sidebar {
    padding: 2rem 3.2rem;
    flex-basis: 100%;
    max-width: 100%;
    flex-direction: column;
  }
}

/* ------------------------ */
/* FAVORITE SPOTS  SECTION */
/* ------------------------ */
.spots-title {
  margin-top: 12rem;
  margin-bottom: 9rem;
}

.no-cards {
  color: var(--color-light--1);
  font-size: 1.5rem;
}

.spots {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10rem;
}

.spot-card {
  max-width: 400px;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 20px 30px 0 rgba(0, 0, 0, 0.2);
  border-radius: 12px;
}

/* Hover effect */
.spot-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
}

/* Optional: make the image react too */
.spot-card__media img {
  transition: transform 0.4s ease;
}

.spot-card:hover .spot-card__media img {
  transform: scale(1.05);
}

.spot-card__media img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.spot-card__body {
  padding: 15px 20px;
}

/* top row: badge + date */
.spot-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.spot-card__badge {
  display: inline-block;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  color: #111;
  background: var(--type-library); /* default */
}
.spot-card.is-library .spot-card__badge {
  background: var(--type-library);
}
.spot-card.is-coffee-shop .spot-card__badge {
  background: var(--type-coffee-shop);
}
.spot-card.is-park .spot-card__badge {
  background: var(--type-park);
}
.spot-card.is-study-lounge .spot-card__badge {
  background: var(--type-study-lounge);
}

.spot-card__meta {
  font-size: 1rem;
  color: var(--color-dark--2);
}

/* title (location) */
.spot-card__title {
  margin: 6px 0 8px;
  font-size: 1.75rem;
  line-height: 1.75;
  font-weight: 800;
  color: #0b0f14;
}

/* note paragraph */
.spot-card__note {
  margin: 0 0 12px 0;
  color: #374151;
  line-height: 1.6;
  font-size: 1.15rem;
}

/* specs grid */
.spot-card__specs {
  list-style: none;
  margin: 0 0 12px 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 50px;
}

.spot-card .spec {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  column-gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafafa;
}

.spot-card .spec__icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--color-dark--2);
}
.spot-card .spec__icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.spot-card .spec__label {
  color: var(--muted);
  font-size: 0.9rem;
}
.spot-card .spec__value {
  font-weight: 700;
  color: #111827;
  font-size: 0.95rem;
}

/* footer rating */
.spot-card__footer {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
}

.spot-card .rating {
  display: flex;
  align-items: center;
  gap: 10px;
}

.spot-card .rating__stars {
  /* star string "★★★★★"; color partial via gradient mask */
  font-size: 18px;
  line-height: 1;
  letter-spacing: 2px;
  background: linear-gradient(
    90deg,
    var(--color-brand--1) calc(var(--pct, 80%)),
    #e5e7eb 0
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.spot-card .rating__value {
  font-weight: 700;
  color: #111827;
  font-size: 0.95rem;
}

/* map to percentage by data-value attribute (1..5) */
.spot-card .rating__stars[data-value='1'] {
  --pct: 20%;
}
.spot-card .rating__stars[data-value='2'] {
  --pct: 40%;
}
.spot-card .rating__stars[data-value='3'] {
  --pct: 60%;
}
.spot-card .rating__stars[data-value='4'] {
  --pct: 80%;
}
.spot-card .rating__stars[data-value='5'] {
  --pct: 100%;
}

.copyright {
  text-align: center;
  font-size: 1rem;
  line-height: 2rem;
  color: var(--color-light--1);
  padding: 1rem 0;
  margin-top: 10rem;
  margin-bottom: 2rem;
}

/* ------------------------ */
/* SCROLL / REVEAL EFFECT */
/* ------------------------ */
.section {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* remove this class to reveal */
.section--hidden {
  opacity: 0;
  transform: translateY(24px);
}

/* revealed state */
.section:not(.section--hidden) {
  opacity: 1;
  transform: none;
}
