/* ==================== SLIDER PAGE SPECIFIC STYLES ==================== */
/* This file extends the main portfolio CSS */

.sliderimageportfolio-row {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1000px;
  margin-bottom: 3vw;
  height: auto;
  padding: 10px;
  border: 1px solid var(--border-medium);
  box-sizing: border-box;
}

.sliderimageportfolio-left {
  width: 100%;
  box-sizing: border-box;
  overflow-y: visible;
  text-align: left;
  line-height: 1.6;
  height: auto;
  margin-bottom: 10px;
}

.sliderimageportfolio-right {
  position: relative;
  height: 400px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #464646;
  transition: box-shadow 0.3s ease;
}

/* Uses h2 and p from main CSS - no overrides needed */
.sliderimageportfolio-left h2 {
  display: inline-block;
  margin: 0 0 5px 0;
}

.sliderimageportfolio-left p {
  width: 90%;
}

.sliderimageportfolio-left ul {
  padding-left: 20px;
  margin: 10px 0;
}

.sliderimageportfolio-left li {
  font-size: var(--font-xs);
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 4px 0;
}

/* ==================== SLIDER INSTRUCTIONS ==================== */

.slider-instruction,
.homeslider-instruction {
  position: absolute;
  top: 35%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  color: rgb(221, 221, 221);
  font-size: clamp(1.2em, 3vw, 3em);
  font-weight: bold;
  pointer-events: none;
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
  opacity: 1;
  visibility: visible;
}

.slider-instruction.hidden,
.homeslider-instruction.hidden {
  opacity: 0;
  visibility: hidden;
}

.slider-instruction p,
.homeslider-instruction p {
  display: inline-block;
  background: var(--highlight-bg);
  padding: 3px 8px;
  border-radius: 3px;
  margin: 0;
  font-weight: bold;
  color: var(--text-dark);
  font-size: var(--font-sm);
}

/* ==================== IMAGE SLIDER CONTAINER ==================== */

.img-slider-container {
  width: 100%;
  height: 100%;
  position: relative;
}

.img-slider-container img,
.img-slider-container .overlay-image-wrapper {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.slider-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  height: 400px;
  overflow: hidden;
  border: 1px solid black;
}

/* ==================== SLIDER IMAGES ==================== */

.base-image,
.overlay-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.overlay-image-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 2;
}

.overlay-image {
  clip-path: inset(0 50% 0 0);
  z-index: 2;
}

/* ==================== SLIDER HANDLE & CONTROLS (REVISED: Arrows OUTSIDE) ==================== */

.slider-handle {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 3px; 
  height: 100%;
  background-color: white; 
  cursor: ew-resize; 
  z-index: 10; 
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

/* Knob (draggable circle) - Central element */
.slider-handle .knob {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px; /* Fixed size for simplicity */
  height: 32px;
  background-color: #333; 
  border: 3px solid white; 
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
  cursor: grab;
  z-index: 11;
  /* Remove internal arrow styling */
  display: block; 
}

/* Common arrow styles (Pseudo-elements) */
.slider-handle::before,
.slider-handle::after {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 30px; /* Fixed size */
  color: white;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  z-index: 9; /* Below the knob, but above the maps */
}

/* Left arrow: positioned 40px to the left of the center line (50%) */
.slider-handle::before {
  content: "◄";
  left: calc(50% - 50px); /* 40px is a fixed, clean distance */
}

/* Right arrow: positioned 40px to the right of the center line (50%) */
.slider-handle::after {
  content: "►";
  right: calc(50% - 50px); /* 40px is a fixed, clean distance */
}


/* ==================== MACHINE LEARNING IMAGE ==================== */

.ml-container {
  position: relative;
  width: 100%;
  height: 70vh;
  min-height: 500px;
  margin: 0 auto 0 auto;
  overflow: hidden;
  border: 1px solid var(--border-medium);
}


/* 1. Map-Page-Wrapper: The main flex container that defines the overall size and splits the view. */
.map-page-wrapper {
    display: flex;       /* Enable side-by-side layout */
    flex-direction: row;
    width: 100%;
    /* Define the permanent height for the map area */
    height: 70vh;        
    min-height: 500px;
    overflow: hidden;
    position: relative;
}

/* 2. Info Panel Wrapper (Left Side) */
.info-panel-wrapper {
    flex-shrink: 0;       /* Prevent panel from shrinking */
    width: 300px;         /* Fixed width for the panel */
    height: 100%;
    overflow-y: auto;     /* Allows scrolling inside the info panel */
    z-index: 10;          /* Ensures it sits above the map */
}

/* Ensure the existing ml-info and info-panel inside the wrapper are correctly positioned */
.info-panel-wrapper .ml-info {
    position: static !important; /* Override any absolute positioning from old ML CSS */
    width: 100% !important;
    height: 100%;
}
.info-panel-wrapper .ml-info .info-panel {
    height: 100%;
    padding: 20px; /* Adjust as needed */
}


/* 3. Map Content Wrapper (Right Side) */
.map-content-wrapper {
    flex-grow: 1;         /* Takes up all remaining horizontal width */
    width: auto;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* 1. map-overlay-page-container: Sets the size and the positioning context for absolute children. */
.map-overlay-page-container {
    position: relative; /* CRITICAL: Establishes the coordinate system for absolute children */
    width: 95%; 
    max-width: 1400px;
    margin: 20px auto;
    
    /* Define the overall height for the component */
    height: 70vh;
    min-height: 500px;
    border: 1px solid var(--border-medium, #ccc);
    overflow: hidden;
}

/* 2. ml-content: Makes the map content take up the full container space. */
.map-overlay-page-container .ml-content {
    position: absolute !important; /* Forces it to fill the container */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Ensure the existing ml-content class is not causing visual issues */
    overflow: hidden; 
}

/* 3. overlay-pin: NEW CLASS added to .ml-info to enforce absolute positioning */
.ml-info.overlay-pin {
    /* CRITICAL: Absolute position over the map */
    position: absolute !important; 
    top: 20px !important;    /* Small margin from the top */
    left: 20px !important;   /* Small margin from the left */
    
    /* Ensure it floats above the map and takes priority */
    z-index: 5001; 
    
    /* Sizing constraints for the pinned panel */
    width: 300px !important;
    max-width: 90%;
    height: auto;
    max-height: calc(100% - 40px); /* Leave 20px margin top/bottom */
    overflow-y: auto; /* Allows scrolling inside the pinned panel */

    /* Style enhancements for visibility over the map */
    background: rgba(255, 255, 255, 0.95); /* Semi-transparent white background */
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Ensure the inner info-panel keeps its structure */
.ml-info.overlay-pin .info-panel {
    padding: 15px;
}

/* ==================== ML SLIDESHOW CONTAINER ==================== */

.ml-slideshow-container {
  position: relative;
  width: 100%;
  height: 70vh;
  min-height: 500px;
  margin: 0 auto 0 auto;
  overflow: hidden;
  border: 1px solid var(--border-medium);
}

.ml-slide {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
  pointer-events: none;
}

.ml-slide.active {
  opacity: 1;
  pointer-events: auto;
}

/* ==================== ML INFO PANEL (Top Left) ==================== */

.ml-info {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 5000;
  max-width: 280px;
}

/* ==================== ML CONTENT (Full Width/Height) ==================== */

.ml-content {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.ml-content .sliderimageportfolio-right {
  width: 100%;
  height: 100%;
  border: none;
  margin: 0;
  padding: 0;
}

.ml-content .img-slider-container {
  width: 100%;
  height: 100%;
}

/* ==================== ML NAVIGATION WRAPPER ==================== */

.ml-navigation-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 15px auto 2vw auto;
  width: 100%;
  z-index: 100;
}

.ml-arrow {
  position: static;
  transform: none;
  background: rgba(200, 200, 200, 0.8);
  color: var(--text-primary);
  font-size: 2em;
  padding: 10px 15px;
  cursor: pointer;
  border: none;
  user-select: none;
  transition: background 0.3s;
}

.ml-arrow:hover {
  background: rgba(160, 160, 160, 0.9);
}

.ml-indicators {
  position: static;
  transform: none;
  display: flex;
  gap: 12px;
  background: rgba(255, 255, 255, 0.9);
  padding: 8px 10px;
  border-radius: 20px;
}

.ml-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ccc;
  cursor: pointer;
  transition: background 0.3s;
}

.ml-dot:hover {
  background: #999;
}

.ml-dot.active {
  background: #333;
}


/* New CSS Class for Info Panel Sections */
.ml-panel-section {
    margin: 10px 0;
    padding: 10px;
    background: #ffffff;
}

/* Specific styling for the Status box (replaces inline styles) */
#aq-status {
    padding: 10px; 
    margin: 10px 0; 
    font-size: 13px; 
    background: #ffffff; 
}

/* Specific styling for the Data Range box (replaces inline styles) */
#aq-data-details {
    font-size: 12px;  
    padding: 10px;
    background: #ffffff; 
}


/* Temperature Display Styles */
.temp-display {
    font-size: 13px;
}

.temp-meta {
    margin: 8px 0;
    padding: 8px;
    background: #f0f7ff;
    border-radius: 4px;
    font-size: 12px;
}

.temp-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 10px 0;
}

.temp-cell {
    padding: 10px;
    border-radius: 6px;
    text-align: center;
    font-size: 12px;
}

.temp-cell.avg {
    background: #e3f2fd;
    border-left: 3px solid #2196F3;
}

.temp-cell.range {
    background: #fff3e0;
    border-left: 3px solid #ff9800;
}

.temp-cell.hot {
    background: #ffebee;
    border-left: 3px solid #f44336;
}

.temp-cell.cool {
    background: #e8f5e9;
    border-left: 3px solid #4caf50;
}

.temp-gradient {
    margin: 15px 0;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 6px;
}

.temp-gradient h5 {
    margin: 0 0 8px 0;
    font-size: 12px;
    color: #666;
}

.gradient-bar {
    height: 20px;
    background: linear-gradient(to right, #0d47a1, #1976d2, #42a5f5, #4caf50, #ffeb3b, #ff9800, #f44336, #b71c1c);
    border-radius: 10px;
    border: 1px solid #999;
}

.gradient-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #666;
    margin-top: 5px;
}

.temp-timer {

    font-size: 12px;
}

.live-clock {
    font-size: 16px;
    font-weight: bold;
    color: #1976d2;
    margin-top: 5px;
}

/* Tooltip Styles */
.tract-tooltip {
    font-size: 12px;
    padding: 8px;
    line-height: 1.6;
}

.tract-tooltip-inner {
    margin: 5px 0;
    padding: 5px 0;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
}

.tract-temp {
    font-size: 14px;
    font-weight: bold;
    color: #1976d2;
}

.tract-diff {
    font-size: 11px;
    color: #666;
    margin-top: 3px;
}

.tract-points {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
}

.tract-elderly {
    font-size: 11px;
    margin-top: 5px;
    padding-top: 5px;
}

.temp-tooltip {
    font-size: 12px;
    padding: 5px;
}

/* Map Switch Styles */
.map-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.map-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.map-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 20px;
}

.map-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.map-switch input:checked + .map-slider {
    background-color: #2196F3;
}

.map-switch input:checked + .map-slider:before {
    transform: translateX(20px);
}