* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  background: white;
  border-radius: 16px;
  padding: 40px;
  max-width: 600px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

h1 {
  color: #2563eb;
  text-align: center;
  margin-bottom: 10px;
  font-size: 32px;
}

.instruction {
  text-align: center;
  color: #6b7280;
  margin-bottom: 30px;
  font-size: 14px;
}

.priorities-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 30px;
}

.priority-item {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px 20px;
  cursor: move;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 12px;
  -webkit-user-select: none;
  user-select: none;
  position: relative;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.priority-item:hover {
  border-color: #2563eb;
  background: #eff6ff;
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.priority-item.dragging {
  opacity: 0.5;
  border-color: #2563eb;
  background: #dbeafe;
  transform: rotate(2deg);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
}

.priority-item.drag-over {
  border-top: 4px solid #2563eb;
  border-bottom: 4px solid #2563eb;
  background: #dbeafe;
}

.priority-number {
  background: #2563eb;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.priority-text {
  flex: 1;
  font-size: 16px;
  color: #1f2937;
  font-weight: 500;
}

.priority-input-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.priority-input {
  width: 70px;
  padding: 6px 8px;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  font-size: 14px;
  text-align: center;
  font-weight: 600;
  color: #1f2937;
  transition: all 0.2s;
}

.priority-input:focus {
  outline: none;
  border-color: #2563eb;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.priority-input:hover {
  border-color: #cbd5e1;
}

.percent-sign {
  font-size: 14px;
  color: #6b7280;
  font-weight: 600;
}

.drag-handle {
  color: #94a3b8;
  font-size: 20px;
  cursor: grab;
  flex-shrink: 0;
}

.drag-handle:active {
  cursor: grabbing;
}

.priority-item:hover .drag-handle {
  color: #2563eb;
}

.save-button {
  width: 100%;
  background: #2563eb;
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.save-button:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.save-button:active {
  transform: translateY(0);
}

.save-button:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  transform: none;
}

.error-message {
  display: none;
  background: #fef2f2;
  border: 2px solid #ef4444;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  color: #dc2626;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  animation: shake 0.3s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.nav-section {
  display: flex;
  justify-content: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 2px solid #e2e8f0;
}

.link-btn {
  background: #6b7280;
  color: white;
  border: none;
  padding: 15px 40px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-block;
  text-decoration: none;
  text-align: center;
}

.link-btn:hover {
  background: #4b5563;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

@media (max-width: 640px) {
  .container {
    padding: 24px;
  }
  
  h1 {
    font-size: 24px;
  }
  
  .priority-item {
    padding: 12px 16px;
  }
  
  .priority-text {
    font-size: 14px;
  }
  
  .link-btn {
    width: 100%;
  }
}
