/**
 * RO SACHY LTD - Markets Page Styles
 */

/* ── Map container overrides (markets page) ── */
.markets-map-container {
  padding: 0;
  margin-top: 0;
  /* Override home.css teal gradient with pure deep navy */
  background: linear-gradient(160deg, #040B14 0%, #081525 45%, #0C1C32 100%);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(201, 168, 76, 0.08);
}

/* Replace home.css ::before radial with gold warmth at Bangladesh position (~75% left, ~37% top) */
.markets-map-container::before {
  background:
    radial-gradient(ellipse 38% 55% at 75% 37%, rgba(201, 168, 76, 0.14) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 50% 50%, rgba(12, 28, 50, 0.35) 0%, transparent 100%);
}

.world-map {
  width: 100%;
  display: block;
  height: auto;
  /* Subtle tint so the map image blends with the container */
  mix-blend-mode: luminosity;
  opacity: 0.82;
}

.map-svg-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
}

/* Arc draw-in using pathLength="1" normalisation */
.map-arc {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: drawMapArc 1.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.arc-usa    { animation-delay: 0.4s; }
.arc-europe { animation-delay: 0.7s; }
.arc-uk     { animation-delay: 1.0s; }
.arc-me     { animation-delay: 1.3s; }
.arc-aus    { animation-delay: 1.6s; }
.arc-apac   { animation-delay: 1.9s; }

@keyframes drawMapArc {
  to { stroke-dashoffset: 0; }
}

/* Destination marker groups */
.dest-marker {
  opacity: 0;
  animation: fadeInMarker 0.5s ease forwards;
}
.dest-usa    { animation-delay: 2.1s; }
.dest-europe { animation-delay: 2.4s; }
.dest-uk     { animation-delay: 2.7s; }
.dest-me     { animation-delay: 3.0s; }
.dest-aus    { animation-delay: 3.3s; }
.dest-apac   { animation-delay: 3.6s; }

@keyframes fadeInMarker {
  to { opacity: 1; }
}

/* Bangladesh origin pulse rings */
.origin-ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: originPulse 2.6s ease-out infinite;
}
.ring-b { animation-delay: 1.3s; }

@keyframes originPulse {
  0%   { transform: scale(1); stroke-opacity: 0.9; }
  100% { transform: scale(6); stroke-opacity: 0; }
}

/* SVG labels */
.map-label {
  font-family: 'Inter', sans-serif;
  font-size: 2.4px;
  font-weight: 700;
  fill: #EDE8DF;
  stroke: #040B14;
  stroke-width: 1.2px;
  paint-order: stroke;
  letter-spacing: 0.25px;
}
.map-label-origin {
  font-size: 2px;
  font-weight: 700;
  fill: #F0CF6A;
  stroke: #040B14;
  stroke-width: 0.9px;
  paint-order: stroke;
  letter-spacing: 0.2px;
}
/* ── End map overrides ── */

.markets-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-bottom: var(--space-md);
}

.market-detail {
  position: relative;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  cursor: default;
}

.market-detail:nth-child(even) {
  background-color: transparent;
}

/* Full-bleed image */
.market-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 45%;
  display: block;
  transition: transform 0.5s ease;
}

.market-detail:hover .market-image {
  transform: scale(1.04);
}

/* Per-image focal point overrides */
.market-image.market-img-usa      { object-position: center 42%; }
.market-image.market-img-europe   { object-position: center 30%; }
.market-image.market-img-uk       { object-position: center 40%; }
.market-image.market-img-australia{ object-position: center 35%; }
.market-image.market-img-middle-east { object-position: center 25%; }
.market-image.market-img-apac     { object-position: center 50%; }

/* Gradient overlay */
.market-detail::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10, 20, 35, 0.08) 0%,
    rgba(10, 20, 35, 0.15) 40%,
    rgba(10, 20, 35, 0.72) 75%,
    rgba(10, 20, 35, 0.88) 100%
  );
  border-radius: var(--border-radius-lg);
}

/* Text overlay */
.market-header {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  padding: 1.5rem 1.5rem 1.25rem;
  border-bottom: none;
  margin-bottom: 0;
}

.market-flag {
  font-size: var(--text-2xl);
  line-height: 1;
  color: var(--color-secondary);
  font-weight: var(--weight-bold);
  font-family: var(--font-heading);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.market-header h3 {
  font-size: var(--text-xl);
  color: var(--color-white);
  margin: 0;
  line-height: 1.2;
}

.market-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin: var(--space-sm) 0;
}

.market-stat {
  text-align: center;
  padding: var(--space-sm);
  background-color: rgba(201, 168, 76, 0.1);
  border-radius: var(--border-radius-sm);
}

.market-stat-value {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--color-secondary);
  display: block;
  font-family: var(--font-heading);
}

.market-stat-label {
  font-size: var(--text-sm);
  color: var(--color-text-light);
}

.market-segments {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
  margin-top: var(--space-xs);
}

.segment-badge {
  padding: var(--space-xs) var(--space-sm);
  background-color: var(--color-primary);
  color: var(--color-white);
  border-radius: var(--border-radius-sm);
  font-size: var(--text-sm);
}

.market-countries {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
  margin-top: var(--space-xs);
}

.country-tag {
  padding: 0.5rem 1rem;
  background-color: var(--color-bg);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--border-radius-sm);
  font-size: var(--text-sm);
  color: var(--color-text);
}

.global-trajectory {
  background: linear-gradient(135deg, var(--color-bg-dark) 0%, var(--color-primary) 100%);
  color: var(--color-white);
  padding: var(--space-md);
  border-radius: var(--border-radius-lg);
  text-align: center;
}

.global-trajectory h3 {
  color: var(--color-white);
  margin-bottom: var(--space-sm);
  font-weight: var(--weight-bold);
}

.global-trajectory p {
  color: rgba(255, 255, 255, 0.95);
}

.trajectory-stats {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  margin-top: var(--space-md);
  flex-wrap: wrap;
}

.trajectory-stat {
  text-align: center;
}

.trajectory-year {
  font-size: var(--text-4xl);
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  color: var(--color-secondary);
  display: block;
}

.trajectory-value {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--color-white);
  display: block;
  margin-top: var(--space-xs);
}

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

  .market-detail {
    aspect-ratio: 16 / 7;
  }
}

@media (max-width: 767px) {
  .market-detail {
    aspect-ratio: 4 / 3;
  }

  .market-header {
    padding: 1rem 1rem 0.875rem;
  }

  .market-flag {
    font-size: var(--text-xl);
  }

  .market-header h3 {
    font-size: var(--text-lg);
  }
}
