/* #region Variables & Reset */

:root {
  --color-blue:       #1B4353;
  --color-darkblue:       #143542;
  --color-pink:      #F15C61;
  --color-yellow: #E2C042;
  --color-lightblue: #C7E8F3;
  --color-highlightblue: #1ab6ea;
  --color-chart-bg:#143542;

  --color-news: #e6dcc9;
  --panel-right:    32px;
  --panel-width:    40%;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--color-darkblue);
  height: 100vh;
  overflow: hidden;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(90deg, var(--color-highlightblue) 0px, var(--color-highlightblue) 1px, transparent 1px, transparent 47px),
    repeating-linear-gradient(180deg, var(--color-highlightblue) 0px, var(--color-highlightblue) 1px, transparent 1px, transparent 31px);
  opacity: 0.1;
}

/* #endregion */


/* #region Visual Container */

#visual {
  position: absolute;
  inset: 0;
  padding: 16px;
  display: flex;
  align-items: center;
  z-index: 0;
}

#map {
  width: 70%;
  height: 85%;
  border: 1px dashed var(--color-yellow);
  overflow: hidden;
  background-color: #00000041;
}

/* #endregion */


/* #region Text Panel */

#right-panel {
  position: absolute;
  top: var(--panel-right);
  right: var(--panel-right);
  bottom: var(--panel-right);
  width: var(--panel-width);
  z-index: 11;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

#content-section {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#right-panel.has-carousel #bottom-section { display: none; }

#text-panel {
  flex: 0 0 auto;
  max-height: 45vh;
  overflow-y: auto;
  background: var(--color-news);
  border: 2px solid var(--color-highlightblue);
  font-family: Georgia, 'Times New Roman', Times, serif;
  padding: 28px 32px;
  color: #0f2530;
}

.step-content {
  display: none;
  animation: fadeIn 0.2s ease;
}

.step-content.is-active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.step-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 10px;
}

.step-content h1 {
  font-family: 'Georgia', 'Times New Roman', Times, serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  color: #0f2530;
  margin-bottom: 12px;
}

.step-content h2 {
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  color: #0f2530;
  margin-bottom: 12px;
}

.step-content p {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.75;
  color: #364559;
  margin-bottom: 8px;
}

.step-content strong{
  color: var(--color-pink);
  font-size:16px;
}

/* #endregion */


/* #region Nav */

#nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-btn {
  width: 46px;
  height: 46px;
  background: var(--color-darkblue);
  border: 1.5px solid var(--color-pink);
  cursor: pointer;
  color: var(--color-pink);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s, transform 0.1s;
}

.nav-btn:not(:disabled):hover  { 
  opacity: 0.85; 
  border: 1.5px dotted var(--color-yellow);
  color: var(--color-yellow);
  transform: scale(1.05);
 }
.nav-btn:not(:disabled):active 
{ transform: scale(0.96); }
.nav-btn:disabled 
{ opacity: 0.25; cursor: default; }

#step-indicator {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #e2e8f0;
}

/* #endregion */


/* #region Carousel Panel */

#carousel-panel,
#carousel-panel-p03 {
  flex: 1;
  min-height: 0;
  display: none;
  flex-direction: column;
  border-radius: 14px;
  overflow: hidden;
  background: transparent;
}

.ch-carousel {
  display: flex;
  flex-direction: column;
}

.ch-carousel-track-wrap {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.ch-carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.3s ease;
}

.ch-carousel-slide {
  flex: 0 0 100%;
  height: 100%;
}

.ch-carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Arrows overlaid on image */
.ch-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: rgba(20,53,66,0.7);
  border: 1px solid var(--color-highlightblue);
  color: var(--color-highlightblue);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  z-index: 2;
}

.ch-prev { left: 8px; }
.ch-next { right: 8px; }

.ch-carousel-btn:hover { background: var(--color-highlightblue); color: var(--color-darkblue); }

/* Caption + dots row */
.ch-carousel-bottom {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
}

.ch-carousel-caption {
  font-size: 14px;
  color: var(--color-lightblue);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ch-carousel-dots {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.ch-carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  cursor: pointer;
  border: none;
  padding: 0;
}

.ch-carousel-dot.active { background: var(--color-highlightblue); }

/* #endregion */


/* #region Chart Panel */

#bottom-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#chart-panel {
  flex: 1;
  min-height: 0;
  background: var(--color-chart-bg);
  border-radius: 14px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  visibility: hidden;
}

#chart-panel .chart-title {
  font-size: 16px;
  font-family: Roboto, sans-serif;
  text-transform: uppercase;
  font-weight: 700;
  color: #ffffff8d;
  margin-bottom: 10px;
  flex-shrink: 0;
}

#chart-panel .chart-subtitle {
  font-size: 12px;
  font-family: Roboto, sans-serif;
  color: #aaaaaa;
  margin-bottom: 10px;
  flex-shrink: 0;
}

#chart-panel canvas {
  flex: 1;
  min-height: 0;
}

/* #endregion */

/* #region Quote Panel */

#quote-panel {
  display: none;
  background: var(--color-darkblue);
  border-top: 2px solid var(--color-yellow);
  padding: 16px 24px;
  align-items: top;
  gap: 16px;
}

.quote-text {
  flex: 1;
  font-family: 'Share Tech Mono', monospace;
  font-size: 18px;
  line-height: 1.7;
  color: var(--color-yellow);
}

.quote-icon {
  font-size: 40px;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--color-yellow);
  flex-shrink: 0;
  opacity: 0.6;
}

/* #endregion */


/* #region Legend */

#legend {
  position: absolute;
  bottom: 60px;
  left: 30px;
  background: rgba(15, 37, 48, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 10px 14px;
  border-radius: 6px;
  display: none;
  z-index: 5;
  min-width: 140px;
  backdrop-filter: blur(4px);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border-radius: 2px;
}

.legend-swatch.circle  { border-radius: 50%; }
.legend-swatch.line    { height: 3px; width: 18px; border-radius: 2px; }

.legend-label {
  font-family: Roboto, sans-serif;
  font-size: 12px;
  color: #e2e8f0;
  white-space: nowrap;
}

/* #endregion */

@media (max-width: 640px) {
  #right-panel { width: 90%; }
  #map { width: 100%; height: 50%; }

  #carousel-panel,
  #carousel-panel-p03 { max-height: 25vh; margin-top: auto; }

  #text-panel { padding: 16px 18px; max-height: 25vh; }

  .step-label { font-size: 10px; margin-bottom: 6px; }

  .step-content h1 { font-size: 17px; margin-bottom: 8px; }
  .step-content h2 { font-size: 15px; margin-bottom: 8px; }
  .step-content p  { font-size: 13px; line-height: 1.6; margin-bottom: 6px; }
  .step-content strong { font-size: 13px; }

  .nav-btn { width: 36px; height: 36px; font-size: 18px; }
  #step-indicator { font-size: 11px; }

  .ch-carousel-caption { font-size: 12px; }
  .ch-carousel-bottom { padding: 4px 8px; }

  #chart-panel { padding: 12px 14px; max-height: 25vh; }
  #bottom-section { max-height: 25vh; margin-top: auto; }
  #chart-panel .chart-title { font-size: 13px; margin-bottom: 6px; }
  #chart-panel .chart-subtitle { font-size: 11px; margin-bottom: 6px; }

  .legend-label { font-size: 11px; }
  #legend { padding: 7px 10px; }
}


