/**
 * DatelineMap Component Styles
 */

.dateline-container {
  margin-top: 0;
  padding: 12px;
  background: var(--surface-sunken);
  border-radius: 8px;
  width: 100%;
  /* Prevent any inherited blur or transitions */
  filter: none;
  transition: none;
}

.dateline-label {
  font-size: 0.75em;
  color: var(--accent-primary);
  margin-bottom: 8px;
  text-align: center;
}

.dateline-map {
  position: relative;
  aspect-ratio: 2 / 1;
  background: var(--surface-base);
  border-radius: 8px;
  overflow: hidden;
  cursor: crosshair;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  /* Isolate rendering from other elements */
  contain: layout paint;
  /* GPU acceleration for smooth, crisp rendering */
  transform: translateZ(0);
  /* Never blur */
  filter: none !important;
}

.dateline-map.disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.dateline-map-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Use the map as background-image for instant display (preloaded by browser) */
  background-image: url('/assets/img/earth.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  opacity: 0.85;
}

.dateline-map-bg img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  opacity: 1;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  /* Ensure crisp rendering, no blur during load */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  /* Prevent any inherited filters or transforms */
  filter: none !important;
  /* No transitions - instant display */
  transition: none !important;
}

/* Location marker container */
.dateline-location-marker {
  position: absolute;
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%);
  z-index: 5;
  pointer-events: none;
}

/* Vertical dashed line through location */
.dateline-location-marker::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  width: 0;
  height: 100vh;
  border-left: 1px dashed var(--color-error);
  transform: translateX(-50%) translateY(-50vh);
}

/* Horizontal dashed line through location */
.dateline-location-marker::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 100vw;
  height: 0;
  border-top: 1px dashed var(--color-error);
  transform: translateY(-50%) translateX(-50vw);
}

/* Central red dot at location */
.dateline-location-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: var(--color-error);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(255, 0, 0, 0.8), 0 0 12px rgba(255, 50, 50, 0.5);
}

/* Day start line marker */
.dateline-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--accent-gold-hover), var(--color-error));
  box-shadow: 0 0 15px rgba(255,107,107,0.8), 0 0 30px rgba(255,204,0,0.5);
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.dateline-marker-icon {
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--accent-gold-hover);
  font-size: 18px;
  text-shadow: 0 0 10px rgba(255,204,0,0.8);
}

.dateline-marker-label {
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--accent-gold-hover);
  font-size: 8px;
  font-weight: bold;
  text-shadow: 0 0 5px var(--surface-scrim);
  white-space: nowrap;
}

/* Longitude labels */
.dateline-cities {
  display: flex;
  justify-content: space-between;
  font-size: 0.7em;
  color: var(--accent-primary);
  margin-top: 5px;
  padding: 0 5px;
}

/* Celestial body markers on map */
.celestial-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 24px;
  text-shadow: 0 0 8px rgba(0,0,0,0.9), 0 0 16px var(--surface-scrim);
  pointer-events: none;
  z-index: 5;
  filter: drop-shadow(0 2px 4px var(--surface-scrim));
}

.celestial-marker.sun-marker {
  font-size: 28px;
  filter: drop-shadow(0 0 8px rgba(255,200,0,0.6));
}

.celestial-marker.moon-marker {
  font-size: 22px;
  filter: drop-shadow(0 0 6px rgba(200,200,255,0.5));
}

/* Day/Night visualization bar */
.day-night-bar {
  position: relative;
  height: 12px;
  margin-top: 6px;
  border-radius: 4px;
  border: 1px solid var(--border-accent);
  overflow: hidden;
}

/* Info lines below map */
.dateline-info {
  font-size: 0.7em;
  color: var(--accent-gold);
  margin-top: 5px;
}

.dateline-info.dateline-location {
  color: var(--accent-primary);
}

/* Click hint */
.dateline-click-hint {
  font-size: 0.65em;
  color: var(--accent-primary);
  text-align: center;
  margin-top: 5px;
  font-style: italic;
}

/* Timezone Guide - shows biblical date by region */
.dateline-tz-guide {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--accent-primary-muted);
  /* Isolate from map - loading doesn't affect map rendering */
  contain: layout style;
}

.tz-guide-label {
  font-size: 0.7em;
  color: var(--text-secondary);
  margin-bottom: 4px;
  text-align: center;
}

.tz-bands-container {
  position: relative;
  height: 14px;
  background: var(--surface-sunken);
  border-radius: 4px;
  overflow: visible;  /* Allow labels to extend outside */
  margin-top: 18px;   /* Space for labels above */
  margin-bottom: 18px; /* Space for labels below */
}

.tz-band {
  position: absolute;
  top: 0;
  height: 100%;
  border-right: 1px solid var(--border-subtle);
  transition: background-color 0.2s;
}

.tz-band:last-child {
  border-right: none;
}

/* Labels positioned outside the band */
.tz-band-label {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6em;
  color: var(--text-primary);
  font-weight: 500;
  white-space: nowrap;
  text-shadow: 0 1px 2px var(--surface-scrim);
  pointer-events: none;
  background: var(--shadow-lg);
  padding: 1px 4px;
  border-radius: 3px;
}

/* Connecting line from label to band */
.tz-band-label::after {
  content: '';
  position: absolute;
  left: 50%;
  width: 1px;
  background: var(--border-strong);
}

/* Odd bands: label above */
.tz-band:nth-child(odd) .tz-band-label {
  bottom: 100%;
  margin-bottom: 3px;
}

.tz-band:nth-child(odd) .tz-band-label::after {
  top: 100%;
  height: 3px;
}

/* Even bands: label below */
.tz-band:nth-child(even) .tz-band-label {
  top: 100%;
  margin-top: 3px;
}

.tz-band:nth-child(even) .tz-band-label::after {
  bottom: 100%;
  height: 3px;
}

/* Color scheme: Year (blue/green), Month (cyan/purple shift), Day (dark/light) */

/* Even years (2024, 2026...) - Blue/Cyan family */
.tz-year-0.tz-month-0.tz-day-0 { background: #1e40af; }  /* Blue, even month, even day */
.tz-year-0.tz-month-0.tz-day-1 { background: #3b82f6; }  /* Blue, even month, odd day */
.tz-year-0.tz-month-1.tz-day-0 { background: #0e7490; }  /* Cyan, odd month, even day */
.tz-year-0.tz-month-1.tz-day-1 { background: #22d3ee; }  /* Cyan, odd month, odd day */

/* Odd years (2025, 2027...) - Green/Teal family */
.tz-year-1.tz-month-0.tz-day-0 { background: #166534; }  /* Green, even month, even day */
.tz-year-1.tz-month-0.tz-day-1 { background: var(--color-success); }  /* Green, even month, odd day */
.tz-year-1.tz-month-1.tz-day-0 { background: #0f766e; }  /* Teal, odd month, even day */
.tz-year-1.tz-month-1.tz-day-1 { background: #2dd4bf; }  /* Teal, odd month, odd day */

.tz-band-loading {
  background: var(--surface-hover);
  animation: tz-pulse 1.5s ease-in-out infinite;
}

@keyframes tz-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.8; }
}

.tz-band-user {
  /* Don't override background - keep year/day colors */
  box-shadow: inset 0 0 0 2px var(--color-warning), 0 0 8px rgba(251, 191, 36, 0.5);
}

/* Old label styles removed - labels now positioned outside bands */

/* Year boundary: strong gold visual separation */
.tz-year-0 + .tz-year-1,
.tz-year-1 + .tz-year-0 {
  border-left: 3px solid var(--color-warning);
  box-shadow: inset 3px 0 8px rgba(251, 191, 36, 0.5);
}

/* Month boundary: white line separation */
.tz-month-0 + .tz-month-1,
.tz-month-1 + .tz-month-0 {
  border-left: 2px solid var(--text-secondary);
}

/* Year boundary note */
.tz-guide-note {
  font-size: 0.65em;
  color: #f59e0b;
  text-align: center;
  margin-top: 6px;
  font-style: italic;
}
