/* 
 * Spa Ceylon | Luxury Ayurveda Global Entry 
 * DESIGN SYSTEM V3 — Premium Editorial Dashboard
 */

:root {
  --c-official: #C6A85A;
  --c-coming: #A8B092;
  --c-text: #1a1710;
  --c-text-light: #777060;
  --c-bg: #F5F4F0;
  --c-bg-warm: #EFEDE7;
  --c-border: rgba(26, 23, 16, 0.08);
  --c-border-strong: rgba(26, 23, 16, 0.14);
  --f-serif: 'Playfair Display', serif;
  --f-sans: 'Raleway', sans-serif;
  --trans-lux: 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --shadow-card: 0 2px 16px rgba(26,23,16,0.06), 0 1px 4px rgba(26,23,16,0.04);
  --shadow-card-hover: 0 8px 32px rgba(26,23,16,0.10), 0 2px 8px rgba(26,23,16,0.06);
}

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

body {
  font-family: var(--f-sans);
  background-color: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ─── 1. HEADER ─────────────────────────────────────────── */
.site-header {
  padding: 20px 0;
  border-bottom: 1px solid var(--c-border);
  background: var(--c-bg);
}

.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 48px;
}

.header-logo { width: 120px; height: auto; }

.header-links a {
  margin-left: 32px;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-text-light);
  transition: color 0.3s;
}

.header-links a:hover { color: var(--c-official); }

/* ─── 2. HERO ─────────────────────────────────────────────── */
.hero-slim {
  padding: 64px 0 32px;
  text-align: center;
  background: var(--c-bg);
}

.hero-slim h1 {
  font-family: var(--f-serif);
  font-size: 2.75rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
  color: var(--c-text);
}

.hero-slim p {
  font-size: 0.78rem;
  color: var(--c-text-light);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ─── 3. SEARCH ──────────────────────────────────────────── */
.action-zone {
  padding: 32px 0;
  background: var(--c-bg);
}

.action-zone.is-stuck {
  position: sticky;
  top: 0;
  z-index: 500;
  background: rgba(245, 244, 240, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 16px 0;
  border-bottom: 1px solid var(--c-border);
  box-shadow: 0 4px 24px rgba(26,23,16,0.06);
}

.search-container {
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}

#store-search {
  width: 100%;
  padding: 16px 48px 16px 52px;
  font-size: 0.95rem;
  font-family: var(--f-sans);
  background: #fff;
  border: 1.5px solid var(--c-border);
  border-radius: 4px;
  outline: none;
  transition: all 0.3s;
  letter-spacing: 0.02em;
  color: var(--c-text);
  box-shadow: var(--shadow-card);
}

#store-search:focus {
  border-color: var(--c-official);
  box-shadow: 0 0 0 3px rgba(198,168,90,0.12), var(--shadow-card);
}

#store-search::placeholder { color: rgba(26,23,16,0.3); }

.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--c-text-light);
  opacity: 0.5;
  font-size: 0.9rem;
}

.search-results-count {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-official);
  opacity: 0;
  transition: opacity 0.3s;
}

.search-results-count.is-visible { opacity: 1; }

body.search-focus-mode #regions, 
body.search-focus-mode .hero-slim, 
body.search-focus-mode #visual-gateway {
  opacity: 0.25;
  pointer-events: none;
  filter: grayscale(0.4);
  transition: all 0.4s;
}

/* ─── 4. MAP SECTION ─────────────────────────────────────── */
#visual-gateway {
  position: relative;
  width: 100%;
  height: 560px;
  background: transparent;
  margin-bottom: 0;
  overflow: hidden;
  border: none;
}

#map-fallback {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0; left: 0;
  background: transparent;
  transition: opacity 0.6s ease;
}

.map-legend {
  display: flex;
  justify-content: center;
  gap: 32px;
  padding: 20px 0;
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-text-light);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-dot.official { background: var(--c-official); }
.legend-dot.coming { background: var(--c-coming); }

/* ─── 5. REGION SECTION WRAPPER ──────────────────────────── */
.selector-section {
  padding: 64px 0 80px;
  background: var(--c-bg);
}

.selector-section > .region-grid-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 48px;
}

#regions {
  display: grid;
  gap: 28px;
  align-items: start;
}

/* Bootstrap-like responsive breakpoints */
@media (min-width: 1400px) {
  #regions { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1399px) and (min-width: 992px) {
  #regions { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 991px) {
  #regions { grid-template-columns: 1fr; }
  .selector-section > .region-grid-container { padding: 0 20px; }
  .header-bar { padding: 0 20px; }
}

/* ─── 6. REGION CARDS ────────────────────────────────────── */
.region-section {
  background: #ffffff;
  border: 1px solid var(--c-border);
  height: 500px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: border-color 0.3s, box-shadow 0.3s;
  margin: 0 !important;
  padding: 0 !important;
  max-width: none !important;
  box-shadow: var(--shadow-card);
}

.region-section:hover {
  border-color: rgba(198,168,90,0.4);
  box-shadow: var(--shadow-card-hover);
}

/* Region Title Bar */
.region-title {
  font-family: var(--f-sans);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 20px 24px 16px;
  margin: 0;
  color: var(--c-text-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--c-bg-warm);
  border-bottom: 1px solid var(--c-border);
}

.region-title span:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.region-title span:first-child::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 1px;
  background: var(--c-official);
}

.region-count {
  font-size: 0.58rem;
  background: rgba(198, 168, 90, 0.1);
  color: var(--c-official);
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.1em;
  border: 1px solid rgba(198, 168, 90, 0.25);
  animation: badge-pulse 2s infinite ease-in-out;
}

@keyframes badge-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.7; }
}

.region-feature-pulse {
  background: linear-gradient(90deg, var(--c-bg-warm), #fff6e5, var(--c-bg-warm));
  background-size: 200% 100%;
  animation: featured-header-shimmer 3s infinite linear;
  border-bottom: 2px solid var(--c-official) !important;
  box-shadow: inset 0 0 12px rgba(198, 168, 90, 0.08);
}

.region-section:has(.region-feature-pulse) {
  border-color: var(--c-official);
  outline: 2px solid rgba(198, 168, 90, 0.15);
  animation: card-glow-pulse 4s infinite ease-in-out;
}

@keyframes card-glow-pulse {
  0%, 100% { outline-color: rgba(198, 168, 90, 0.1); box-shadow: 0 4px 24px rgba(198, 168, 90, 0.05); }
  50% { outline-color: rgba(198, 168, 90, 0.4); box-shadow: 0 8px 32px rgba(198, 168, 90, 0.15); }
}

.region-divider { display: none; }

/* Country List Container */
.countries-list {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
}

/* ─── 7. COUNTRY ROWS ────────────────────────────────────── */
.country-item {
  width: 100%;
  padding: 0 24px;
  height: calc((500px - 56px - 57px) / 6); /* fill */
  min-height: 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(26,23,16,0.04);
  transition: background 0.2s;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  cursor: pointer;
  text-align: left;
  flex-shrink: 0;
}

.country-item:last-child { border-bottom: none; }

.country-item:hover {
  background: rgba(198,168,90,0.04);
}

.country-item-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.flag {
  width: 22px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.country-name {
  font-family: var(--f-sans);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.01em;
}

.country-status-label {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border-radius: 2px;
  flex-shrink: 0;
  margin-left: 8px;
}

.status-label-official {
  background: rgba(198,168,90,0.12);
  color: var(--c-official);
  border: 1px solid rgba(198,168,90,0.25);
}

.status-label-coming {
  background: rgba(168,176,146,0.12);
  color: var(--c-coming);
  border: 1px solid rgba(168,176,146,0.25);
}

.country-arrow {
  opacity: 0;
  font-size: 0.65rem;
  color: var(--c-official);
  flex-shrink: 0;
  transition: opacity 0.2s, transform 0.2s;
}

.country-item:hover .country-arrow {
  opacity: 1;
  transform: translateX(2px);
}

/* ─── 8. PAGINATION FOOTER ───────────────────────────────── */
.card-pagination-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--c-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--c-bg-warm);
  flex-shrink: 0;
}

.pagination-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}

.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(26,23,16,0.15);
  transition: all 0.3s;
}

.dot.active {
  background: var(--c-official);
  width: 14px;
  border-radius: 3px;
}

.pulse-arrow-btn {
  background: none;
  border: 1px solid var(--c-border);
  color: var(--c-official);
  font-size: 0.75rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse-arrow 2.5s infinite ease-in-out;
  transition: all 0.3s;
}

.pulse-arrow-btn:hover {
  background: var(--c-official);
  color: #fff;
  border-color: var(--c-official);
  animation: none;
}

@keyframes pulse-arrow {
  0%, 100% { transform: translateX(0); box-shadow: 0 0 0 0 rgba(198,168,90,0.2); }
  50% { transform: translateX(3px); box-shadow: 0 0 0 6px rgba(198,168,90,0); }
}

.pulse-arrow-btn:disabled {
  opacity: 0;
  pointer-events: none;
}

/* ─── 9. MODAL ───────────────────────────────────────────── */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10,8,5,0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--trans-lux);
}

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

.modal-window {
  background: #fff;
  width: 90%;
  max-width: 480px;
  position: relative;
  transform: translateY(32px) scale(0.97);
  transition: var(--trans-lux);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,0.2);
}

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

.modal-header {
  padding: 40px 40px 24px;
  background: var(--c-bg-warm);
  border-bottom: 1px solid var(--c-border);
}

.modal-badge-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.modal-main-badge {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 5px 12px;
  border-radius: 2px;
}

.modal-main-badge.official {
  background: var(--c-official);
  color: #fff;
}

.modal-main-badge.coming {
  background: var(--c-coming);
  color: #fff;
}

#modal-flag-placeholder { display: flex; align-items: center; }
#modal-flag-placeholder img { width: 28px; height: 19px; border-radius: 3px; box-shadow: 0 1px 4px rgba(0,0,0,0.2); }

#modal-title {
  font-family: var(--f-serif);
  font-size: 2.4rem;
  font-weight: 400;
  margin-bottom: 6px;
  line-height: 1.1;
}

#modal-desc {
  font-size: 0.85rem;
  color: var(--c-text-light);
  letter-spacing: 0.02em;
}

.modal-content {
  padding: 32px 40px;
  overflow-y: auto;
  flex: 1;
}

.modal-divider {
  height: 1px;
  background: var(--c-border);
  margin: 24px 0;
}

.modal-section-title {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--c-official);
  margin-bottom: 16px;
  display: block;
}

.channel-list { display: grid; gap: 12px; }

.channel-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.channel-icon {
  color: var(--c-official);
  font-size: 0.9rem;
  width: 20px;
  text-align: center;
  margin-top: 2px;
  flex-shrink: 0;
}

.channel-info strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--c-text);
}

.channel-info span {
  font-size: 0.8rem;
  color: var(--c-text-light);
}

.modal-footer {
  padding: 20px 40px;
  display: flex;
  gap: 12px;
  border-top: 1px solid var(--c-border);
  background: var(--c-bg-warm);
}

.modal-btn-primary {
  flex: 1;
  background: var(--c-text);
  color: #fff;
  text-align: center;
  padding: 15px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-decoration: none;
  transition: all 0.3s;
  border: none;
  cursor: pointer;
  font-family: var(--f-sans);
}

.modal-btn-primary:hover {
  background: var(--c-official);
}

.modal-btn-secondary {
  padding: 15px 20px;
  background: transparent;
  color: var(--c-text);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-decoration: none;
  transition: all 0.3s;
  border: 1px solid var(--c-border);
  font-family: var(--f-sans);
  cursor: pointer;
}

.modal-btn-secondary:hover {
  border-color: var(--c-official);
  color: var(--c-official);
}

.modal-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: rgba(26,23,16,0.06);
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--c-text-light);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--c-official);
  color: #fff;
}

/* ─── 10. MAP MARKERS ────────────────────────────────────── */
.jvm-marker {
  transform-box: fill-box;
  transform-origin: center;
  transition: all 0.3s;
}

.jvm-marker[data-status="official"] {
  fill: var(--c-official) !important;
  stroke: var(--c-official);
  stroke-width: 0px;
  animation: pulse-presence 3s infinite ease-in-out;
}

@keyframes pulse-presence {
  0% { stroke-width: 0px; stroke-opacity: 0.8; }
  50% { stroke-width: 14px; stroke-opacity: 0; }
  100% { stroke-width: 0px; stroke-opacity: 0; }
}

/* ─── 11. DEPTH / STORY SECTION ──────────────────────────── */
.depth-section {
  background: var(--c-bg-warm);
  border-top: 1px solid var(--c-border);
}

/* ─── 12. MOBILE ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero-slim { padding: 48px 20px 24px; }
  .hero-slim h1 { font-size: 2rem; }
  #visual-gateway { height: 380px; }
  .selector-section { padding: 40px 0 60px; }

  .modal-window {
    width: 100%;
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    transform: translateY(40px);
  }

  .modal-overlay.is-visible .modal-window {
    transform: translateY(0);
  }

  .modal-header, .modal-content, .modal-footer { padding: 28px 24px; }
}
