/* 🔄 Rerun with Locks Modal Styles */

.rerun-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.rerun-modal-overlay.show {
  display: flex;
}

.rerun-modal {
  background: #1a1a1a;
  border-radius: 20px;
  padding: 24px;
  max-width: 480px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.3s ease;
}

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

/* Header */
.rerun-modal-header {
  margin-bottom: 24px;
  text-align: center;
}

.rerun-modal-header h2 {
  font-size: 24px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
}

.rerun-subtitle {
  font-size: 14px;
  color: #888;
  line-height: 1.5;
}

/* Parts List */
.rerun-parts-list {
  margin-bottom: 20px;
}

.rerun-part-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: #252525;
  border-radius: 12px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.rerun-part-item:hover {
  background: #2a2a2a;
  transform: translateX(2px);
}

.rerun-part-item.locked {
  background: linear-gradient(135deg, #1a2332 0%, #252525 100%);
  border: 1px solid rgba(0, 122, 255, 0.3);
}

.rerun-part-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.rerun-part-info {
  flex: 1;
  min-width: 0;
}

.rerun-category-label {
  font-size: 10px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.rerun-part-name {
  font-size: 15px;
  font-weight: 500;
  color: #fff;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rerun-part-price {
  font-size: 14px;
  color: #4CAF50;
  font-weight: 600;
}

/* Lock Switch */
.rerun-lock-switch {
  position: relative;
  width: 48px;
  height: 28px;
  cursor: pointer;
  flex-shrink: 0;
}

.rerun-lock-input {
  display: none;
}

.rerun-lock-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #333;
  border-radius: 28px;
  transition: 0.3s;
}

.rerun-lock-slider:before {
  content: "🔓";
  position: absolute;
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 22px;
  text-align: center;
}

.rerun-lock-input:checked + .rerun-lock-slider {
  background: linear-gradient(135deg, #007AFF 0%, #0051D5 100%);
}

.rerun-lock-input:checked + .rerun-lock-slider:before {
  content: "🔒";
  transform: translateX(20px);
}

/* Cost Info */
.rerun-cost-info {
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  border: 1px solid #333;
  border-radius: 12px;
  padding: 16px;
  margin: 20px 0;
}

.rerun-cost-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.rerun-cost-line span:first-child {
  color: #aaa;
  font-size: 14px;
}

.rerun-cost-value {
  color: #FFD700;
  font-weight: 600;
  font-size: 16px;
}

.rerun-locked-info {
  display: flex;
  justify-content: space-between;
  color: #666;
  font-size: 12px;
}

/* Action Buttons */
.rerun-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.rerun-btn-cancel,
.rerun-btn-execute {
  flex: 1;
  padding: 14px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.rerun-btn-cancel {
  background: #333;
  color: #fff;
}

.rerun-btn-cancel:hover {
  background: #444;
}

.rerun-btn-execute {
  background: linear-gradient(135deg, #007AFF 0%, #0051D5 100%);
  color: #fff;
}

.rerun-btn-execute:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 122, 255, 0.3);
}

.rerun-btn-execute:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Loading State */
.rerun-modal.loading .rerun-parts-list,
.rerun-modal.loading .rerun-modal-actions {
  opacity: 0.5;
  pointer-events: none;
}

.rerun-loading-indicator {
  text-align: center;
  padding: 20px;
  color: #007AFF;
  display: none;
}

.rerun-modal.loading .rerun-loading-indicator {
  display: block;
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .rerun-modal {
    padding: 20px;
    border-radius: 16px;
  }
  
  .rerun-modal-header h2 {
    font-size: 20px;
  }
  
  .rerun-part-item {
    padding: 12px;
    gap: 12px;
  }
  
  .rerun-part-icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
  
  .rerun-part-name {
    font-size: 14px;
  }
  
  .rerun-modal-actions {
    flex-direction: column;
  }
  
  .rerun-btn-cancel,
  .rerun-btn-execute {
    width: 100%;
  }
}

/* Smooth scrollbar for parts list */
.rerun-modal::-webkit-scrollbar {
  width: 8px;
}

.rerun-modal::-webkit-scrollbar-track {
  background: #1a1a1a;
}

.rerun-modal::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
}

.rerun-modal::-webkit-scrollbar-thumb:hover {
  background: #444;
}
