/* ================================================
   Immersive 3D Seismic Timeline - Styles
   ================================================ */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  background: #000;
  color: #fff;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
}

/* ================================================
   Canvas Container
   ================================================ */

#canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

canvas {
  display: block;
}

/* ================================================
   HUD: Heads-Up Display
   ================================================ */

.hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
}

.hud-corner {
  position: absolute;
  pointer-events: auto;
  font-size: 13px;
  line-height: 1.5;
}

/* Top Left */
.hud-corner.top-left {
  top: 20px;
  left: 20px;
  background: rgba(0, 0, 0, 0.6);
  padding: 16px;
  border: 1px solid rgba(0, 255, 0, 0.3);
  border-radius: 8px;
  backdrop-filter: blur(4px);
}

.hud-title {
  font-size: 16px;
  font-weight: 600;
  color: #00ff00;
  letter-spacing: 1px;
}

.hud-subtitle {
  font-size: 11px;
  color: #00aa00;
  margin-top: 4px;
  text-transform: uppercase;
  opacity: 0.8;
}

/* Top Right */
.hud-corner.top-right {
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.6);
  padding: 12px 16px;
  border: 1px solid rgba(0, 255, 0, 0.3);
  border-radius: 8px;
  backdrop-filter: blur(4px);
  text-align: right;
}

.hud-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

#event-count {
  font-size: 18px;
  font-weight: 600;
  color: #00ff00;
}

#time-range {
  color: #00aa00;
  font-size: 10px;
  margin-top: 4px;
}

/* Bottom Left - Controls */
.hud-corner.bottom-left {
  bottom: 20px;
  left: 20px;
  background: rgba(0, 0, 0, 0.7);
  padding: 16px;
  border: 1px solid rgba(0, 255, 0, 0.3);
  border-radius: 8px;
  backdrop-filter: blur(4px);
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-btn {
  padding: 8px 12px;
  background: rgba(0, 255, 0, 0.1);
  border: 1px solid rgba(0, 255, 0, 0.5);
  border-radius: 4px;
  color: #00ff00;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.control-btn:hover {
  background: rgba(0, 255, 0, 0.2);
  border-color: #00ff00;
  box-shadow: 0 0 8px rgba(0, 255, 0, 0.3);
}

.control-btn:active {
  transform: scale(0.98);
}

.control-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.control-group label {
  color: #00aa00;
  text-transform: uppercase;
}

.control-select {
  padding: 4px 8px;
  background: rgba(0, 255, 0, 0.05);
  border: 1px solid rgba(0, 255, 0, 0.3);
  border-radius: 3px;
  color: #00ff00;
  font-size: 12px;
  cursor: pointer;
}

.control-select:hover {
  background: rgba(0, 255, 0, 0.1);
  border-color: rgba(0, 255, 0, 0.6);
}

/* Bottom Right - Event Panel */
.hud-corner.bottom-right {
  bottom: 20px;
  right: 20px;
  max-width: 320px;
}

.event-panel {
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(0, 255, 0, 0.4);
  border-radius: 8px;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.1);
  animation: slideIn 0.3s ease-out;
}

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

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0, 255, 0, 0.2);
  background: rgba(0, 255, 0, 0.05);
}

.panel-title {
  font-size: 13px;
  font-weight: 600;
  color: #00ff00;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.close-btn {
  background: none;
  border: none;
  color: #00aa00;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.close-btn:hover {
  color: #00ff00;
}

.panel-content {
  padding: 12px 16px;
  max-height: 400px;
  overflow-y: auto;
}

.detail-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 8px;
  padding: 6px 0;
  font-size: 12px;
  border-bottom: 1px solid rgba(0, 255, 0, 0.1);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  color: #00aa00;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 500;
}

.detail-value {
  color: #fff;
  word-break: break-word;
}

/* Center - Timeline Scrubber */
.timeline-scrubber {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(0, 255, 0, 0.3);
  border-radius: 8px;
  padding: 12px 16px;
  backdrop-filter: blur(4px);
  min-width: 300px;
}

.scrubber-bar {
  position: relative;
  height: 6px;
  background: rgba(0, 255, 0, 0.1);
  border-radius: 3px;
  margin-bottom: 8px;
  overflow: hidden;
  cursor: pointer;
}

.scrubber-progress {
  height: 100%;
  background: linear-gradient(90deg, #00ff00, #00dd00);
  border-radius: 3px;
  width: 0%;
  transition: width 0.1s linear;
}

.scrubber-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  appearance: none;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  opacity: 0;
}

.scrubber-input::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #00ff00;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(0, 255, 0, 0.6);
}

.scrubber-input::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #00ff00;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 8px rgba(0, 255, 0, 0.6);
}

.scrubber-time {
  font-size: 11px;
  color: #00aa00;
  text-align: center;
  text-transform: uppercase;
}

/* Help Text */
.hud-help {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: #00aa00;
  text-align: center;
  opacity: 0.6;
  pointer-events: none;
}

/* ================================================
   Loading Overlay
   ================================================ */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.3s ease;
  pointer-events: auto;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  text-align: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 2px solid rgba(0, 255, 0, 0.2);
  border-top-color: #00ff00;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-spinner p {
  font-size: 12px;
  color: #00aa00;
  letter-spacing: 1px;
}

/* ================================================
   Back Button
   ================================================ */

.back-button {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 8px 12px;
  background: rgba(0, 255, 0, 0.1);
  border: 1px solid rgba(0, 255, 0, 0.5);
  border-radius: 4px;
  color: #00ff00;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 101;
}

.back-button:hover {
  background: rgba(0, 255, 0, 0.2);
  border-color: #00ff00;
  box-shadow: 0 0 8px rgba(0, 255, 0, 0.3);
}

/* ================================================
   Responsive
   ================================================ */

@media (max-width: 768px) {
  .hud-corner {
    font-size: 12px;
  }

  .hud-corner.top-left,
  .hud-corner.top-right {
    padding: 12px;
  }

  .hud-corner.bottom-left {
    bottom: 120px;
    left: 12px;
    padding: 12px;
  }

  .hud-corner.bottom-right {
    bottom: 120px;
    right: 12px;
  }

  .event-panel {
    max-width: 280px;
  }

  .hud-help {
    display: none;
  }

  .timeline-scrubber {
    min-width: 250px;
    padding: 10px 12px;
  }

  .back-button {
    top: 12px;
    right: 12px;
    padding: 6px 10px;
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .hud-corner {
    font-size: 11px;
  }

  .hud-corner.top-left,
  .hud-corner.top-right,
  .hud-corner.bottom-left {
    padding: 10px;
  }

  .event-panel {
    max-width: 260px;
  }

  .detail-row {
    grid-template-columns: 70px 1fr;
    font-size: 11px;
  }

  .timeline-scrubber {
    min-width: 220px;
  }
}
