/* Time Machine Styles */

.time-machine-panel {
  position: fixed;
  right: 0;
  top: 60px;
  bottom: 0;
  width: 400px;
  background: #1e1e1e;
  border-left: 1px solid #3c3c3c;
  display: none;
  flex-direction: column;
  z-index: 900;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.time-machine-panel.active {
  display: flex;
  transform: translateX(0);
}

.time-machine-header {
  padding: 20px;
  border-bottom: 1px solid #3c3c3c;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.time-machine-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
}

.time-machine-close {
  background: none;
  border: none;
  color: #888;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.time-machine-close:hover {
  background: #2a2a2a;
  color: #ffffff;
}

.time-machine-controls {
  padding: 15px 20px;
  border-bottom: 1px solid #3c3c3c;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.time-machine-nav {
  display: flex;
  gap: 10px;
}

.time-machine-btn {
  flex: 1;
  padding: 8px 12px;
  background: #2a2a2a;
  border: 1px solid #3c3c3c;
  border-radius: 4px;
  color: #ffffff;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.time-machine-btn:hover:not(:disabled) {
  background: #3a3a3a;
  border-color: #4a9eff;
}

.time-machine-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.time-machine-btn.primary {
  background: #4a9eff;
  border-color: #4a9eff;
}

.time-machine-btn.primary:hover:not(:disabled) {
  background: #3a8eef;
}

.branch-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.branch-selector {
  flex: 1;
  padding: 8px 12px;
  background: #2a2a2a;
  border: 1px solid #3c3c3c;
  border-radius: 4px;
  color: #ffffff;
  font-size: 13px;
  cursor: pointer;
}

.branch-selector:focus {
  outline: none;
  border-color: #4a9eff;
}

.time-machine-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* Timeline */
.timeline-empty {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.timeline-date {
  font-size: 12px;
  font-weight: 600;
  color: #888;
  margin: 20px 0 10px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.timeline-date:first-child {
  margin-top: 0;
}

.timeline-commit {
  position: relative;
  background: #2a2a2a;
  border: 1px solid #3c3c3c;
  border-left: 3px solid #4a9eff;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.timeline-commit:hover {
  background: #2f2f2f;
  border-color: #4a9eff;
  transform: translateX(2px);
}

.timeline-commit.active {
  background: #2a3a4a;
  border-color: #4a9eff;
  box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.2);
}

.timeline-commit.merge {
  border-left-width: 5px;
  border-left-style: dashed;
}

.timeline-commit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.timeline-branch {
  display: inline-block;
  padding: 2px 8px;
  background: #4a9eff;
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.timeline-time {
  font-size: 11px;
  color: #888;
}

.timeline-commit-action {
  font-size: 13px;
  color: #ffffff;
  margin-bottom: 8px;
  line-height: 1.4;
}

.timeline-commit-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.timeline-btn {
  padding: 4px 10px;
  background: #1a1a1a;
  border: 1px solid #3c3c3c;
  border-radius: 3px;
  color: #ffffff;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.timeline-btn:hover {
  background: #2a2a2a;
  border-color: #4a9eff;
}

.timeline-current {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: #4a9eff;
  font-weight: 600;
}

/* Compare Overlay */
.compare-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  display: flex;
  flex-direction: column;
}

.compare-header {
  padding: 20px;
  border-bottom: 1px solid #3c3c3c;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.compare-header h3 {
  margin: 0;
  font-size: 18px;
  color: #ffffff;
}

.compare-close {
  background: none;
  border: none;
  color: #888;
  font-size: 32px;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.compare-close:hover {
  background: #2a2a2a;
  color: #ffffff;
}

.compare-content {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 20px;
  gap: 20px;
  overflow: hidden;
}

.compare-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  height: 100%;
}

.compare-label {
  text-align: center;
  font-size: 14px;
  color: #ffffff;
  padding: 10px 20px;
  background: #2a2a2a;
  border-radius: 6px;
}

.compare-label small {
  font-size: 12px;
  color: #888;
}

.compare-side img {
  max-width: 100%;
  max-height: calc(100% - 60px);
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.compare-divider {
  width: 2px;
  height: 100%;
  background: linear-gradient(to bottom, transparent, #4a9eff, transparent);
}

/* Branch Graph (future feature) */
.branch-graph {
  padding: 20px;
  background: #1a1a1a;
  border-radius: 8px;
  margin-bottom: 20px;
}

.branch-graph-canvas {
  width: 100%;
  height: 200px;
}

/* Responsive */
@media (max-width: 768px) {
  .time-machine-panel {
    width: 100%;
  }

  .compare-content {
    flex-direction: column;
  }

  .compare-divider {
    width: 100%;
    height: 2px;
  }
}

/* Animations */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.timeline-commit {
  animation: fadeIn 0.3s ease;
}

/* Scrollbar */
.time-machine-content::-webkit-scrollbar {
  width: 8px;
}

.time-machine-content::-webkit-scrollbar-track {
  background: #1a1a1a;
}

.time-machine-content::-webkit-scrollbar-thumb {
  background: #3c3c3c;
  border-radius: 4px;
}

.time-machine-content::-webkit-scrollbar-thumb:hover {
  background: #4a9eff;
}
