/**
 * Graph Visualization Styles
 * 3D Anki Knowledge Graph
 */

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

@font-face {
  font-family: "JetBrainsMono";
  src: url("/assets/fonts/ttf/JetBrainsMono-Medium.ttf");
}

body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #000;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

svg.fa {
  display: inline-block;
  width: 1em;
  height: 1em;
  fill: currentColor;
}

#canvas {
  width: 100vw;
  height: 100vh;
  display: block;
}

#info {
  position: absolute;
  bottom: 30px;
  left: 30px;
  background: rgba(0, 0, 0, 0.9);
  padding: 25px;
  border-radius: 16px;
  max-width: 450px;
  border: 1px solid rgba(0, 255, 136, 0.3);
  display: none;
  z-index: 100;
  backdrop-filter: blur(10px);
}

#close {
  position: absolute;
  top: 15px;
  right: 20px;
  cursor: pointer;
  font-size: 28px;
  color: #666;
  transition: color 0.3s ease;
}

#close:hover {
  color: #0f8;
}

#info h3 {
  color: #0f8;
  margin-bottom: 15px;
  font-size: 18px;
  font-weight: 600;
}

.stat {
  margin: 8px 0;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
}

.label {
  color: #888;
  font-weight: 400;
}

.value {
  color: #fff;
  font-weight: 600;
  text-align: right;
}

/* Loading state */
#loading {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  text-align: center;
  z-index: 2000;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #8e8e93;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

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

canvas {
  display: block;
}

/* Responsive */
@media (max-width: 768px) {
  #info {
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: none;
    padding: 20px;
  }

  #info h3 {
    font-size: 16px;
  }

  .stat {
    font-size: 13px;
  }
}

/* Timeline Slider - Premium History Mode */
#timeline {
  position: fixed;
  top: 40px;
  left: 50%;
  transform: translate(-50%, -20px);
  width: 85%;
  max-width: 800px;
  background: rgba(17, 17, 17, 0.5);
  backdrop-filter: blur(18px);
  padding: 16px 24px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 24px 34px rgba(0, 0, 0, 0.35);
  z-index: 1000;
  opacity: 0;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
  transition:
    background 0.3s ease,
    border-color 0.3s ease;
}

#timeline:hover {
  background: rgba(20, 20, 25, 0.85);
  border-color: rgba(255, 255, 255, 0.2);
}

#timeline-controls {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: center;
}

#date-top,
#count-bottom {
  color: #8e8e93;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-align: center;
  font-family: "JetBrainsMono", monospace;
  line-height: 1;
}

#date-top {
  margin-bottom: 10px;
}

#count-bottom {
  margin-top: 10px;
}

#timeline-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  margin: 10px 0;
}

#timeline-slider:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 4px;
  border-radius: 4px;
}

#timeline-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 30px;
  height: 30px;
  background: transparent;
  /* Hide native thumb but keep it interactive */
  cursor: pointer;
  border: none;
}

#magnetic-thumb {
  position: absolute;
  width: 20px;
  height: 20px;
  background: #8e8e93;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
  pointer-events: none;
  left: 0;
  top: 50%;
  /* Center vertically within slider-group */
  transform: translate(-50%, -50%);
  transition: background 0.2s ease;
  z-index: 5;
}

#timeline-controls {
  position: relative;
  width: 100%;
}

#timeline-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  cursor: pointer;
}

footer {
  position: fixed;
  z-index: 1001;
  bottom: 10px;
  width: 85%;
  max-width: 900px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  line-height: 1;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-family:
    "Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif;
  font-weight: 100;
  letter-spacing: 1px;
  padding: 0;
  border: 0;
  vertical-align: baseline;
  display: flex;
  justify-content: center;
  align-items: center;
}

footer a {
  color: rgba(255, 255, 255, 0.5);
  opacity: 1;
  transition: opacity 0.2s ease;
  text-decoration: none;
}

footer a:hover {
  opacity: 0.8;
}
