/* =====================================================
   THE POOL MAP  |  Frontend Stylesheet
   Rubik font, Pool Map brand palette, rounded UI
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;600;700;800&display=swap');

:root {
  --pm-navy:       #042C53;
  --pm-blue:       #185FA5;
  --pm-mid:        #378ADD;
  --pm-sky:        #B5D4F4;
  --pm-surface:    #E6F1FB;
  --pm-white:      #FFFFFF;
  --pm-text:       #0d1b2a;
  --pm-muted:      #5a7080;
  --pm-border:     #d4e4f0;
  --pm-radius-sm:  10px;
  --pm-radius-md:  16px;
  --pm-radius-lg:  24px;
  --pm-radius-xl:  32px;
  --pm-shadow:     0 4px 24px rgba(4,44,83,0.10);
  --pm-shadow-lg:  0 8px 40px rgba(4,44,83,0.16);
  --pm-font:       'Rubik', sans-serif;
  --pm-transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.pm-hero,
.pm-hero *,
.pm-listings-wrap,
.pm-listings-wrap *,
.pm-categories-wrap,
.pm-categories-wrap *,
.pm-cities-wrap,
.pm-cities-wrap *,
.pm-stats-bar,
.pm-stats-bar *,
.pm-add-listing-wrap,
.pm-add-listing-wrap *,
.pm-standalone-search,
.pm-standalone-search * {
  font-family: var(--pm-font);
  box-sizing: border-box;
}

/* =====================================================
   HERO
   ===================================================== */

.pm-hero {
  position: relative;
  min-height: 540px;
  background-color: var(--pm-navy);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
}

.pm-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(4,44,83,0.92) 0%, rgba(24,95,165,0.78) 100%);
}

.pm-hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
}

.pm-hero-title {
  font-size: clamp(32px, 5vw, 58px);
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}

.pm-hero-tagline {
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 400;
  color: rgba(255,255,255,0.78);
  margin: 0 0 40px;
  line-height: 1.5;
}

/* Search box */
.pm-search-box {
  display: flex;
  gap: 10px;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--pm-radius-xl);
  padding: 10px;
  flex-wrap: wrap;
}

.pm-search-box-inline {
  background: var(--pm-white);
  border: 1.5px solid var(--pm-border);
}

.pm-search-field {
  flex: 1;
  min-width: 160px;
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.15);
  border-radius: var(--pm-radius-lg);
  padding: 0 16px;
  height: 52px;
  gap: 10px;
}

.pm-search-box-inline .pm-search-field {
  background: var(--pm-surface);
}

.pm-search-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: rgba(255,255,255,0.7);
}

.pm-search-box-inline .pm-search-icon {
  color: var(--pm-muted);
}

.pm-search-field input,
.pm-search-field select {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: var(--pm-font);
  font-size: 15px;
  font-weight: 400;
  color: #fff;
  width: 100%;
}

.pm-search-box-inline .pm-search-field input,
.pm-search-box-inline .pm-search-field select {
  color: var(--pm-text);
}

.pm-search-field input::placeholder { color: rgba(255,255,255,0.6); }
.pm-search-box-inline .pm-search-field input::placeholder { color: var(--pm-muted); }
.pm-search-field select option { color: var(--pm-text); background: #fff; }

.pm-search-btn {
  height: 52px;
  padding: 0 28px;
  background: var(--pm-mid);
  color: #fff;
  border: none;
  border-radius: var(--pm-radius-lg);
  font-family: var(--pm-font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--pm-transition);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.pm-search-btn:hover { background: var(--pm-blue); transform: translateY(-1px); }

/* Hero quick city tags */
.pm-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 24px;
}

.pm-hero-tag {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50px;
  padding: 6px 18px;
  font-family: var(--pm-font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--pm-transition);
}

.pm-hero-tag:hover {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.4);
}

/* =====================================================
   STATS BAR
   ===================================================== */

.pm-stats-bar {
  display: flex;
  justify-content: center;
  gap: 0;
  background: var(--pm-navy);
  padding: 0;
  flex-wrap: wrap;
}

.pm-stat-item {
  flex: 1;
  min-width: 140px;
  text-align: center;
  padding: 28px 20px;
  border-right: 1px solid rgba(255,255,255,0.08);
}

.pm-stat-item:last-child { border-right: none; }

.pm-stat-num {
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.pm-stat-text {
  font-size: 13px;
  font-weight: 400;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* =====================================================
   CATEGORIES
   ===================================================== */

.pm-categories-wrap {
  padding: 32px 24px 0;
  max-width: 1200px;
  margin: 0 auto;
}

.pm-categories-scroll {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pm-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 50px;
  border: 2px solid var(--pm-border);
  background: var(--pm-white);
  font-family: var(--pm-font);
  font-size: 14px;
  font-weight: 500;
  color: var(--pm-muted);
  cursor: pointer;
  transition: var(--pm-transition);
  white-space: nowrap;
}

.pm-cat-pill:hover {
  border-color: var(--pm-blue);
  color: var(--pm-blue);
  background: var(--pm-surface);
}

.pm-cat-pill-active,
.pm-cat-pill.active {
  background: var(--pm-blue);
  border-color: var(--pm-blue);
  color: #fff;
}

/* =====================================================
   SECTION TITLE
   ===================================================== */

.pm-section-title {
  font-family: var(--pm-font);
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
  color: var(--pm-navy);
  margin: 0 0 28px;
  letter-spacing: -0.01em;
}

/* =====================================================
   LISTINGS GRID
   ===================================================== */

.pm-listings-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}

.pm-grid {
  display: grid;
  gap: 24px;
}

.pm-grid-3 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.pm-grid-4 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.pm-grid-2 { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }

/* =====================================================
   LISTING CARD
   ===================================================== */

.pm-listing-card {
  background: var(--pm-white);
  border-radius: var(--pm-radius-lg);
  border: 1.5px solid var(--pm-border);
  overflow: hidden;
  transition: var(--pm-transition);
  position: relative;
  display: flex;
  flex-direction: column;
}

.pm-listing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--pm-shadow-lg);
  border-color: var(--pm-sky);
}

/* Featured ribbon */
.pm-featured-ribbon {
  position: absolute;
  top: 16px;
  right: -8px;
  background: var(--pm-mid);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 16px 4px 12px;
  border-radius: 4px 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  z-index: 2;
}

.pm-featured-ribbon::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 0;
  border-style: solid;
  border-width: 12px 8px 12px 0;
  border-color: transparent transparent transparent var(--pm-mid);
  transform: scaleY(-1);
}

/* Card photo */
.pm-card-photos { height: 140px; overflow: hidden; }

.pm-card-photo-main {
  width: 100%;
  height: 100%;
  background-color: var(--pm-surface);
  background-size: cover;
  background-position: center;
  transition: transform 0.4s ease;
}

.pm-listing-card:hover .pm-card-photo-main {
  transform: scale(1.04);
}

.pm-card-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Card body */
.pm-card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.pm-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.pm-card-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--pm-surface);
  color: var(--pm-blue);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1.5px solid var(--pm-border);
  background-size: cover;
  background-position: center;
}

.pm-card-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--pm-navy);
  line-height: 1.3;
  margin-bottom: 4px;
}

.pm-card-location {
  font-size: 12px;
  color: var(--pm-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Badges */
.pm-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.pm-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--pm-font);
}

.pm-badge-warn {
  background: #fff3cd;
  color: #856404;
}

.pm-badge-ok {
  background: #d1f0e0;
  color: #155724;
}

.pm-badge-active {
  background: var(--pm-surface);
  color: var(--pm-blue);
}

/* Rating */
.pm-card-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.pm-stars { display: flex; gap: 1px; }
.pm-star { font-size: 14px; }
.pm-star-full { color: #f59e0b; }
.pm-star-empty { color: #d1d5db; }

.pm-rating-num {
  font-size: 14px;
  font-weight: 600;
  color: var(--pm-navy);
}

.pm-review-count {
  font-size: 12px;
  color: var(--pm-muted);
}

/* Description */
.pm-card-desc {
  font-size: 13px;
  color: var(--pm-muted);
  line-height: 1.5;
  margin-bottom: 14px;
}

/* Card footer */
.pm-card-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--pm-border);
  flex-wrap: wrap;
}

.pm-card-phone {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--pm-blue);
  text-decoration: none;
  font-family: var(--pm-font);
}

.pm-card-phone:hover { color: var(--pm-navy); }

.pm-card-site-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  background: var(--pm-surface);
  color: var(--pm-blue);
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--pm-transition);
  font-family: var(--pm-font);
}

.pm-card-site-btn:hover {
  background: var(--pm-blue);
  color: #fff;
}

/* Claim bar */
.pm-claim-bar {
  margin-top: 12px;
  padding: 10px 14px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--pm-radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.pm-claim-bar span {
  font-size: 12px;
  color: #92400e;
  font-weight: 500;
}

.pm-claim-btn {
  background: var(--pm-blue);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 5px 14px;
  font-family: var(--pm-font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--pm-transition);
}

.pm-claim-btn:hover { background: var(--pm-navy); }

/* No results */
.pm-no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--pm-muted);
  font-family: var(--pm-font);
}

/* Load more */
.pm-load-more-wrap {
  text-align: center;
  margin-top: 40px;
}

.pm-load-more {
  background: none;
  border: 2px solid var(--pm-blue);
  color: var(--pm-blue);
  border-radius: 50px;
  padding: 12px 36px;
  font-family: var(--pm-font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--pm-transition);
}

.pm-load-more:hover {
  background: var(--pm-blue);
  color: #fff;
}

/* =====================================================
   CITIES GRID
   ===================================================== */

.pm-cities-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}

.pm-cities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.pm-city-card {
  border-radius: var(--pm-radius-md);
  overflow: hidden;
  border: 1.5px solid var(--pm-border);
  cursor: pointer;
  transition: var(--pm-transition);
  background: var(--pm-white);
}

.pm-city-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--pm-shadow);
  border-color: var(--pm-sky);
}

.pm-city-img {
  height: 110px;
  background-color: var(--pm-surface);
  background-size: cover;
  background-position: center;
}

.pm-city-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pm-surface);
  color: var(--pm-sky);
}

.pm-city-info {
  padding: 12px 14px;
}

.pm-city-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--pm-navy);
  margin-bottom: 3px;
}

.pm-city-count {
  font-size: 12px;
  color: var(--pm-muted);
}

/* =====================================================
   ADD LISTING FORM
   ===================================================== */

.pm-add-listing-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px;
}

.pm-pub-form {
  background: var(--pm-white);
  border: 1.5px solid var(--pm-border);
  border-radius: var(--pm-radius-lg);
  padding: 36px;
}

.pm-form-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.pm-pub-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pm-pub-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--pm-navy);
  font-family: var(--pm-font);
}

.pm-pub-field input,
.pm-pub-field select,
.pm-pub-field textarea {
  width: 100%;
  border: 1.5px solid var(--pm-border);
  border-radius: var(--pm-radius-sm);
  padding: 12px 16px;
  font-family: var(--pm-font);
  font-size: 14px;
  color: var(--pm-text);
  background: var(--pm-white);
  transition: var(--pm-transition);
  outline: none;
}

.pm-pub-field input:focus,
.pm-pub-field select:focus,
.pm-pub-field textarea:focus {
  border-color: var(--pm-blue);
  box-shadow: 0 0 0 3px rgba(24,95,165,0.12);
}

.pm-pub-field input::placeholder { color: #b0bec5; }

.pm-btn-submit {
  width: 100%;
  height: 54px;
  background: var(--pm-blue);
  color: #fff;
  border: none;
  border-radius: var(--pm-radius-md);
  font-family: var(--pm-font);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--pm-transition);
  margin-top: 10px;
  letter-spacing: 0.01em;
}

.pm-btn-submit:hover {
  background: var(--pm-navy);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(4,44,83,0.2);
}

/* Success state */
.pm-form-success {
  text-align: center;
  padding: 48px 24px;
  background: var(--pm-white);
  border: 1.5px solid #d1f0e0;
  border-radius: var(--pm-radius-lg);
}

.pm-success-icon {
  width: 72px;
  height: 72px;
  background: #d1f0e0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: #155724;
}

.pm-form-success h3 {
  font-size: 24px;
  font-weight: 700;
  color: var(--pm-navy);
  margin-bottom: 10px;
  font-family: var(--pm-font);
}

.pm-form-success p {
  color: var(--pm-muted);
  font-family: var(--pm-font);
  font-size: 15px;
}

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

.pm-standalone-search {
  padding: 24px;
  max-width: 900px;
  margin: 0 auto;
}

/* =====================================================
   FEATURED WRAP
   ===================================================== */

.pm-featured-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}

/* =====================================================
   CLAIM MODAL / TOAST
   ===================================================== */

.pm-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--pm-navy);
  color: #fff;
  padding: 14px 20px;
  border-radius: var(--pm-radius-md);
  font-family: var(--pm-font);
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  box-shadow: var(--pm-shadow-lg);
  animation: pm-slide-up 0.3s ease;
}

.pm-toast-success { background: #155724; }
.pm-toast-error   { background: #721c24; }

@keyframes pm-slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 768px) {
  .pm-hero { padding: 60px 16px; min-height: auto; }
  .pm-search-box { flex-direction: column; border-radius: var(--pm-radius-lg); }
  .pm-search-field { width: 100%; }
  .pm-search-btn { width: 100%; justify-content: center; }
  .pm-grid-3, .pm-grid-4 { grid-template-columns: 1fr 1fr; }
  .pm-stat-item { min-width: 50%; border-bottom: 1px solid rgba(255,255,255,0.08); }
  .pm-pub-form { padding: 24px 16px; }
  .pm-form-grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .pm-grid-3, .pm-grid-4, .pm-grid-2 { grid-template-columns: 1fr; }
  .pm-cities-grid { grid-template-columns: 1fr 1fr; }
  .pm-search-box { padding: 8px; }
}

/* ── Single listing page links on cards ── */
.pm-card-photo-link {
  display: block;
  text-decoration: none;
  overflow: hidden;
}
.pm-card-photo-link:hover .pm-card-photo-main {
  transform: scale(1.04);
}
.pm-card-name-link {
  text-decoration: none;
}
.pm-card-name-link .pm-card-name:hover {
  color: var(--pm-blue);
}
.pm-view-profile {
  background: var(--pm-surface) !important;
  color: var(--pm-blue) !important;
  font-weight: 600;
}
.pm-view-profile:hover {
  background: var(--pm-blue) !important;
  color: #fff !important;
}
