/* 🔄 Refine with Locks Modal Styles
 * Updated to match build-confirm-modal design
 */

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

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

.refine-modal {
  background: #0a0a0a;
  border: none;
  border-radius: 0;
  padding: 20px;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Header */
.refine-modal-header {
  margin-bottom: 12px;
  text-align: center;
  padding: 10px 0;
  position: relative;
}

.refine-back-btn {
  position: absolute;
  left: 0;
  top: 10px;
  background: transparent;
  border: none;
  color: #888;
  font-size: 14px;
  cursor: pointer;
  padding: 8px 12px;
  transition: color 0.2s;
}

.refine-back-btn:hover {
  color: #fff;
}

.refine-modal-header h2 {
  font-size: 1.2rem;
  font-weight: bold;
  color: #fff;
  margin: 0 0 4px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.refine-subtitle {
  font-size: 12px;
  color: #666;
  line-height: 1.3;
  margin-bottom: 8px;
}

.refine-modal-header .refine-locked-info {
  border-top: none;
  padding-top: 0;
  justify-content: center;
  gap: 20px;
}

/* Parts List */
.refine-parts-list {
  flex: 1;
  margin-bottom: 16px;
  overflow-y: auto;
  padding-bottom: 20px;
}

.refine-part-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid #333;
  border-radius: 8px;
  margin-bottom: 6px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.refine-part-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.refine-part-item.locked {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.refine-part-icon {
  display: none;
}

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

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

.refine-part-name {
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.refine-part-price {
  font-size: 11px;
  color: #FFD700;
  font-weight: 600;
}

/* Lock Switch */
.refine-lock-switch {
  position: relative;
  width: 44px;
  height: 24px;
  cursor: pointer;
  flex-shrink: 0;
}

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

.refine-lock-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #333;
  border-radius: 24px;
  transition: 0.2s;
}

.refine-lock-slider:before {
  content: "🔓";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 2px;
  bottom: 2px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  line-height: 20px;
  text-align: center;
}

.refine-lock-input:checked + .refine-lock-slider {
  background: #FFD700;
}

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

/* Cost Info */
.refine-cost-info {
  margin: 16px 0;
}

.refine-cost-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.refine-cost-line span:first-child {
  color: #999;
  font-size: 0.9rem;
}

.refine-cost-value {
  color: #FFD700;
  font-weight: 600;
  font-size: 0.9rem;
}

.refine-locked-info {
  display: flex;
  justify-content: space-between;
  color: #666;
  font-size: 11px;
  padding-top: 8px;
  border-top: 1px solid #333;
}

/* Action Buttons */
.refine-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 0;
}

.refine-btn-cancel,
.refine-btn-execute {
  flex: 1;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

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

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

.refine-btn-execute {
  background: transparent;
  border: 2px solid #FFD700;
  color: #FFD700;
}

.refine-btn-execute:hover {
  background: rgba(255, 215, 0, 0.1);
}

.refine-btn-execute:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

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

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

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

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

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

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

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