/* Time Machine Component Styles */

:root {
  --tm-accent: #0066cc;
  --tm-accent-hover: #0052a3;
  --tm-bg: #f8f8f8;
  --tm-card: white;
  --tm-border: #e2e2e2;
  --tm-text: #1f1f1f;
  --tm-muted: #5a5a5a;
  --tm-size: 200px;
}

/* ===== THE COMPONENT ===== */
.time-machine {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tm-dial-container {
  position: relative;
  width: var(--tm-size);
  height: var(--tm-size);
  touch-action: none;
  user-select: none;
}

/* Decorative rings */
.tm-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--tm-border);
  pointer-events: none;
}

.tm-ring-outer {
  inset: 0;
  border-width: 2px;
  border-color: var(--tm-accent);
  opacity: 0.2;
}

.tm-ring-middle {
  inset: 15px;
  border-style: dashed;
  opacity: 0.4;
}

/* Time track SVG */
.tm-track {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  pointer-events: none;
}

.tm-track-bg {
  fill: none;
  stroke: var(--tm-border);
  stroke-width: 8;
  opacity: 0.4;
}

.tm-track-progress {
  /* Hidden - was causing issues on mobile touch interactions */
  display: none;
}

/* Draggable handle */
.tm-handle {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--tm-accent);
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  cursor: grab;
  z-index: 10;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.tm-handle:hover {
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.tm-handle:active,
.tm-handle.dragging {
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(1.15);
}

.tm-handle-inner {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: white;
}

/* Center display */
.tm-display {
  position: absolute;
  inset: 35px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--tm-card);
  border-radius: 50%;
  border: 1px solid var(--tm-border);
  pointer-events: none;
  gap: 0.25rem;
}

.tm-station-select {
  pointer-events: auto;
  border: none;
  background: transparent;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--tm-muted);
  text-align: center;
  cursor: pointer;
  padding: 0.25rem;
  max-width: 90px;
  text-overflow: ellipsis;
}

.tm-station-select:focus {
  outline: none;
  color: var(--tm-accent);
}

.tm-time {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--tm-accent);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.tm-date {
  font-size: 0.65rem;
  color: var(--tm-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Day navigation buttons */
.tm-day-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--tm-border);
  background: var(--tm-card);
  color: var(--tm-muted);
  font-size: 1rem;
  font-weight: 300;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  z-index: 5;
}

.tm-day-prev {
  left: -14px;
}

.tm-day-next {
  right: -14px;
}

.tm-day-btn:hover {
  border-color: var(--tm-accent);
  color: var(--tm-accent);
  background: #f0f7ff;
}

/* Teleport button */
.tm-teleport {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1.25rem;
  background: var(--tm-accent);
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.tm-teleport:hover:not(:disabled) {
  background: var(--tm-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.25);
}

.tm-teleport:active:not(:disabled) {
  transform: translateY(0);
}

.tm-teleport:disabled {
  background: #b8d4f0;
  cursor: not-allowed;
}

/* No-transcript state: recording exists but wasn't transcribed */
.tm-teleport.tm-no-transcript {
  background: #e8e8e8;
  color: #888;
  border-color: #ccc;
  cursor: not-allowed;
  position: relative;
}

.tm-teleport.tm-no-transcript .tm-teleport-icon {
  font-size: 0; /* hide original icon character */
}

.tm-teleport.tm-no-transcript .tm-teleport-icon::before {
  content: '🔇';
  font-size: 0.75rem;
}

.tm-teleport-icon {
  font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 480px) {
  .time-machine {
    --tm-size: 180px;
  }
  
  .tm-time {
    font-size: 1.5rem;
  }
  
  .tm-station-select {
    font-size: 0.65rem;
    max-width: 80px;
  }
}
