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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
  color: #333;
}

.container {
  max-width: 900px;
  margin: 0 auto;
}

header {
  text-align: center;
  color: white;
  margin-bottom: 30px;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 20px;
}

.connection-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.2);
  padding: 8px 16px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
  font-size: 0.9rem;
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffa500;
  animation: pulse 2s infinite;
}

.status-indicator.connected {
  background: #4caf50;
  animation: none;
}

.status-indicator.error {
  background: #f44336;
  animation: none;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.card {
  background: white;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  margin-bottom: 20px;
}

.card h2 {
  color: #667eea;
  margin-bottom: 15px;
  font-size: 1.5rem;
}

.help-text {
  color: #666;
  margin-bottom: 25px;
  line-height: 1.6;
}

.form-group {
  margin-bottom: 25px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  background: #ff9800;
  color: white;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-new {
  background: #4caf50;
}

.badge-secret {
  background: #9c27b0;
}

input[type="password"] {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  font-family: 'Monaco', 'Courier New', monospace;
  transition: border-color 0.3s;
}

input[type="password"]:focus {
  outline: none;
  border-color: #667eea;
}

textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  font-family: 'Monaco', 'Courier New', monospace;
  resize: vertical;
  transition: border-color 0.3s;
}

textarea:focus {
  outline: none;
  border-color: #667eea;
}

.field-hint {
  display: block;
  color: #888;
  font-size: 0.85rem;
  margin-top: 5px;
}

.arrow-down {
  text-align: center;
  font-size: 2rem;
  color: #667eea;
  margin: 15px 0;
  font-weight: bold;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  margin-top: 3px;
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.checkbox-text {
  flex: 1;
}

.checkbox-text strong {
  display: block;
  margin-bottom: 3px;
}

.checkbox-text small {
  display: block;
  color: #666;
  font-size: 0.85rem;
}

.id-preview {
  margin: 20px 0;
  padding: 15px;
  background: #f5f5f5;
  border-radius: 8px;
  border-left: 4px solid #667eea;
  display: none;
}

.id-preview.show {
  display: block;
}

.id-preview h3 {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 10px;
}

.id-pairs {
  display: grid;
  gap: 8px;
}

.id-pair {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: white;
  border-radius: 4px;
}

.id-pair .old-id {
  color: #ff9800;
  font-weight: 600;
}

.id-pair .arrow {
  color: #999;
}

.id-pair .new-id {
  color: #4caf50;
  font-weight: 600;
}

.id-preview.error {
  border-left-color: #f44336;
  background: #ffebee;
}

.id-preview.error-message {
  color: #f44336;
  font-weight: 600;
}

.button-group {
  display: flex;
  gap: 15px;
  margin-top: 30px;
}

.btn {
  flex: 1;
  padding: 14px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: #f5f5f5;
  color: #666;
}

.btn-secondary:hover {
  background: #e0e0e0;
}

.btn-icon {
  font-size: 1.2rem;
}

.results-card {
  animation: slideIn 0.3s ease-out;
}

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

.results-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.results-header.success {
  color: #4caf50;
}

.results-header.error {
  color: #f44336;
}

.results-header .icon {
  font-size: 1.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.stat-item {
  padding: 15px;
  background: #f5f5f5;
  border-radius: 8px;
  border-left: 4px solid #667eea;
}

.stat-item .label {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 5px;
}

.stat-item .value {
  font-size: 1.5rem;
  font-weight: 600;
  color: #333;
}

.stat-item .detail {
  font-size: 0.75rem;
  color: #999;
  margin-top: 5px;
  word-break: break-all;
}

.loading {
  text-align: center;
  padding: 40px;
  color: #666;
}

.loading-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

footer {
  text-align: center;
  color: white;
  margin-top: 30px;
  opacity: 0.8;
}

@media (max-width: 768px) {
  header h1 {
    font-size: 2rem;
  }

  .card {
    padding: 20px;
  }

  .button-group {
    flex-direction: column;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}

