/* =========================
   Global Reset
========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* =========================
   Base Layout
========================= */
html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

#cesiumContainer {
  position: fixed;   /* guarantees full-screen canvas */
  inset: 0;          /* top/right/bottom/left = 0 */
}

/* Utility */
.hidden {
  display: none !important;
}

.btn-stack {
  display: flex;
  flex-direction: column;
  gap: 10px; /* spacing between stacked buttons */
}

/* =========================
   Shared Panel Style
========================= */
.viewer-controls,
.route-controls,
.route-stats,
.test-panel,
.status-alert{
  position: absolute;
  z-index: 1000;

  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 600;

  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);

  padding: 15px;
  max-width: 280px;
  transform: scale(0.8);
}

/* =========================
   Viewer Controls (top-left)
========================= */
.viewer-controls {
  top: 20px;
  left: 20px;
  transform-origin: top left;
}

.viewer-controls h3 {
  color: #fff;
  font-size: 14px;
  margin-bottom: 15px;
}

/* =========================
   Route Controls (bottom-left)
========================= */
.route-controls {
  bottom: 20px;
  left: 20px;
  width: clamp(220px, 15vw, 400px);
  padding: clamp(12px, 1.5vw, 24px);
}

.route-controls h3 {
  color: white;
  font-size: clamp(14px, 1.2vw, 20px);
  margin-bottom: clamp(8px, 1vw, 16px);
}

.route-controls button {
  font-size: clamp(13px, 1vw, 18px);
  padding: clamp(8px, 1vw, 16px);
  margin-bottom: clamp(6px, 0.8vw, 12px);
}

.route-controls .divider {
  margin: clamp(8px, 1vw, 16px) 0;
}

/* =========================
   Route Stats (top-right)
========================= */
.route-stats {
  top: 20px;
  right: 20px;
  min-width: 180px;
  color: #fff;
}

.route-stats h3 {
  font-size: 14px;
  margin-bottom: 10px;
}

.route-stats div {
  display: flex;
  justify-content: space-between;
  margin: 6px 0;
}

/* =========================
   Test Panel (top left)
========================= */
.test-panel {
  top: 1.5vw;
  left: 1.5vw;
  width: clamp(220px, 15vw, 400px);
  padding: clamp(12px, 1.5vw, 24px);
}

.test-panel h3 {
  color: white;
  font-size: clamp(14px, 1.2vw, 20px);
  margin-bottom: clamp(8px, 1vw, 16px);
}

.test-panel button {
  font-size: clamp(13px, 1vw, 18px);
  padding: clamp(8px, 1vw, 16px);
  margin-bottom: clamp(6px, 0.8vw, 12px);
}

/* =========================
   Buttons
========================= */
.view-btn,
.route-btn,
.control-btn {
  width: 100%;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  color: #fff;
  text-align: left;
  margin-bottom: 10px;
  transition: all 0.25s ease;
}

/* View buttons */
.view-btn {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.15);
}

.view-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.view-btn.active {
  background: rgba(39, 174, 96, 0.35);
  border: 1px solid rgba(39, 174, 96, 0.7);
}

/* Route buttons */
.route-btn {
  padding: 14px 18px;
  background: rgba(155, 89, 182, 0.35);
}

.route-btn:hover {
  background: rgba(155, 89, 182, 0.55);
  transform: translateY(-2px);
}

.route-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Control buttons */
.control-btn {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.15);
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.control-btn.active {
  background: rgba(39, 174, 96, 0.35);
}

/* Delete */
.delete-btn {
  background: rgba(231, 76, 60, 0.35);
}

.delete-btn:hover {
  background: rgba(231, 76, 60, 0.55);
}

/* =========================
   Divider
========================= */
.divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
  margin: 15px 0;
}

/* =========================
   Status Alert
========================= */
.status-alert {
    position: fixed;
    top: 15px;  /* Move higher - increase this value for higher placement */
    left: 50%;
    transform: translateX(-50%);
    width: clamp(400px, 50vw, 800px);  /* Make wider - was probably narrower before */
    max-width: 90%;
    padding: clamp(12px, 1.5vw, 20px);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    text-align: center;
}

.status-alert p {
  color: #fff;
  font-size: 14px;
}

/* =========================
   OS View (darker panels)
========================= */
body.os-view .viewer-controls,
body.os-view .route-controls,
body.os-view .route-stats,
body.os-view .status-alert,
body.os-view .test-panel {
  background: rgba(20, 20, 20, 0.65);
  border-color: rgba(255, 255, 255, 0.25);
}

/* =========================
   Welcome Panel
========================= */
.welcome-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.welcome-card {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.18);
  max-width: 400px;
  width: 90%;
}

.welcome-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px; 
}

.welcome-logo {
  max-width: 400px; 
  height: auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}


.welcome-card h1 {
  color: white;
  margin-bottom: 10px;
  font-size: 32px;
  font-weight: 400; /* Normal weight like the inputs */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.welcome-card h2 {
  color: white;
  margin-bottom: 30px;
  font-size: 18px;
  font-weight: 400;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* (merged) */
.welcome-card p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 30px;
  font-family: inherit; 
}

#login-form input {
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 16px;
}

#login-form input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

#login-form button {
  width: 100%;
  padding: 12px;
  background: white;
  color: #667eea;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s;
}

#login-form button:hover {
  transform: translateY(-2px);
}

.error-hidden {
  display: none;
}

.error-visible {
  display: block;
  color: #ff6b6b;
  background: rgba(255, 255, 255, 0.9);
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 15px;
  font-size: 14px;
}

.instructions-content {
  color: white;
  margin: 30px 0;
  line-height: 1.6;
  font-size: 16px;
}

.start-btn {
  width: 100%;
  max-width: 400px;
  display: block;
  margin: 0 auto;
  padding: clamp(14px, 2vw, 20px);
  background: white;
  color: #667eea;
  border: none;
  border-radius: 12px;
  font-size: clamp(18px, 2vw, 24px);
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.start-btn:hover {
  transform: translateY(-2px);
}

/* =========================
   Evaluation Mode Styles
========================= */

/* Evaluation mode - hide view controls, show test panel */
.evaluation-mode .viewer-controls {
  display: none !important;
}

.evaluation-mode .test-panel {
  display: block !important;
}

/* Development mode - show view controls, hide test panel */
.development-mode .viewer-controls {
  display: block !important;
}

.development-mode .test-panel {
  display: none !important;
}

.test-panel button.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Evaluation mode - hide route stats */
.evaluation-mode .route-stats {
  display: none !important;
}

.instructions-card {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: clamp(30px, 4vw, 60px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.18);
  width: 95%; /* Fill most of the width */
  max-width: 100%; /* Allow full width */
  max-height: 85vh;
  overflow-y: auto;
}

.instructions-card h1 {
  color: white;
  margin-bottom: clamp(20px, 3vw, 40px);
  font-size: clamp(24px, 3.5vw, 42px);
  font-weight: bold;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.instructions-text {
  color: white;
  line-height: 1.8;
  margin-bottom: clamp(20px, 3vw, 40px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.instructions-text p {
  font-size: clamp(16px, 1.8vw, 22px);
  margin-bottom: clamp(16px, 2vw, 24px);
  font-weight: 400; /* Match login page weight */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.instructions-text p strong {
  font-weight: 600; /* Slightly bolder for emphasis */
}

.instructions-text .ready-text {
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 600;
  text-align: center;
  margin-top: clamp(24px, 3vw, 40px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Path key*/


.path-legend {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: flex;
    gap: 20px;
    align-items: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.path-legend.hidden {
    display: none;
}

.legend-title {
    font-weight: bold;
    font-size: 14px;
    margin-right: 10px;
}

.legend-items {
    display: flex;
    gap: 20px;
}

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

.legend-color {
    width: 20px;
    height: 4px;
    border-radius: 2px;
}

.legend-label {
    font-size: 13px;
}