/* History Manager Styles */

.history-item.future {
  opacity: 0.5;
  position: relative;
}

.history-item.future::after {
  content: '(Future)';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: #666666;
  font-style: italic;
}

.history-current {
  font-size: 10px;
  color: #4a9eff;
  margin-top: 4px;
  font-weight: 600;
}

.history-item {
  cursor: pointer;
  transition: all 0.3s ease;
}

.history-item:hover {
  transform: translateX(5px);
}

.history-item.future:hover {
  opacity: 0.8;
}

/* History stats in panel */
.history-stats {
  padding: 15px 20px;
  background: #1e1e1e;
  border-bottom: 1px solid #3c3c3c;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #888888;
}

.history-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.history-stat-value {
  font-size: 18px;
  color: #4a9eff;
  font-weight: 600;
}

.history-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* History actions */
.history-actions {
  padding: 10px 20px;
  background: #2d2d2d;
  border-bottom: 1px solid #1e1e1e;
  display: flex;
  gap: 8px;
}

.history-action-btn {
  flex: 1;
  background: #3c3c3c;
  border: 1px solid #4a4a4a;
  color: #cccccc;
  padding: 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.history-action-btn:hover:not(:disabled) {
  background: #4a4a4a;
  border-color: #4a9eff;
}

.history-action-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.history-action-btn svg {
  width: 14px;
  height: 14px;
}

/* Enhanced undo/redo buttons */
#undoBtn:not(:disabled):hover,
#redoBtn:not(:disabled):hover {
  background: #4a9eff !important;
  border-color: #4a9eff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(74, 158, 255, 0.3);
}

#undoBtn:not(:disabled):active,
#redoBtn:not(:disabled):active {
  transform: translateY(0);
}

/* History timeline visualization */
.history-timeline {
  padding: 20px;
  background: #1e1e1e;
  border-bottom: 1px solid #3c3c3c;
}

.timeline-bar {
  width: 100%;
  height: 4px;
  background: #3c3c3c;
  border-radius: 2px;
  position: relative;
  margin-bottom: 10px;
}

.timeline-progress {
  height: 100%;
  background: linear-gradient(90deg, #4a9eff, #5ab0ff);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.timeline-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: #4a9eff;
  border: 2px solid #1e1e1e;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
}

.timeline-marker:hover {
  transform: translate(-50%, -50%) scale(1.3);
  box-shadow: 0 0 8px rgba(74, 158, 255, 0.6);
}

.timeline-marker.current {
  background: #ffffff;
  box-shadow: 0 0 12px rgba(74, 158, 255, 0.8);
}

.timeline-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #666666;
}

/* Memory usage indicator */
.history-memory {
  padding: 10px 20px;
  background: #1e1e1e;
  border-top: 1px solid #3c3c3c;
  font-size: 11px;
  color: #888888;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.memory-bar {
  flex: 1;
  height: 6px;
  background: #3c3c3c;
  border-radius: 3px;
  overflow: hidden;
  margin: 0 10px;
}

.memory-fill {
  height: 100%;
  background: linear-gradient(90deg, #4caf50, #ff9800, #f44336);
  transition: width 0.3s ease;
}

/* Keyboard shortcut hints */
.history-shortcuts {
  padding: 10px 20px;
  background: #1e1e1e;
  border-top: 1px solid #3c3c3c;
  font-size: 10px;
  color: #666666;
  text-align: center;
}

.shortcut-key {
  display: inline-block;
  background: #2d2d2d;
  border: 1px solid #3c3c3c;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  margin: 0 2px;
}

/* Animation for history changes */
@keyframes historyPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(74, 158, 255, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(74, 158, 255, 0);
  }
}

.history-item.active {
  animation: historyPulse 1s ease-out;
}

/* Compact mode for history items */
.history-item.compact {
  padding: 8px 12px;
}

.history-item.compact .history-action {
  font-size: 12px;
}

.history-item.compact .history-time {
  font-size: 9px;
}

/* Export/Import buttons */
.history-export-import {
  padding: 10px 20px;
  background: #2d2d2d;
  border-top: 1px solid #1e1e1e;
  display: flex;
  gap: 8px;
}

.export-btn, .import-btn {
  flex: 1;
  background: #3c3c3c;
  border: 1px solid #4a4a4a;
  color: #cccccc;
  padding: 8px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.export-btn:hover, .import-btn:hover {
  background: #4a4a4a;
  border-color: #4a9eff;
}
