@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

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

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  color: #f8fafc;
  position: relative;
  overflow-x: hidden;
}

/* Background effects */
body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 40% 80%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.container {
  background: rgba(30, 41, 59, 0.8);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  width: 100%;
  max-width: 28rem;
  padding: 2.5rem;
  position: relative;
  z-index: 10;
}

.container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6, #10b981);
  background-size: 200% 100%;
  animation: shimmer 3s ease-in-out infinite;
  border-radius: 1.5rem 1.5rem 0 0;
}

@keyframes shimmer {
  0%,
  100% {
    background-position: -200% 0;
  }
  50% {
    background-position: 200% 0;
  }
}

.header {
  text-align: center;
  margin-bottom: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: #3b82f6;
  margin-bottom: 0.5rem;
}

.logo ion-icon {
  font-size: 2rem;
  color: #8b5cf6;
}

.intro-content {
  text-align: center;
}

.welcome-section {
  margin-bottom: 2.5rem;
}

.welcome-section h1 {
  color: #f8fafc;
  font-size: 1.875rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #f8fafc 0%, #cbd5e1 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.welcome-section p {
  color: #94a3b8;
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 400;
}

.profile-form {
  text-align: left;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: #e2e8f0;
  font-weight: 500;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 0.75rem;
  color: #f8fafc;
  font-size: 1rem;
  transition: all 0.3s ease;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background: rgba(15, 23, 42, 0.8);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #64748b;
}

/* Name status styles */
.name-status {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  min-height: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.name-status.checking {
  color: #fbbf24;
}

.name-status.available {
  color: #10b981;
}

.name-status.taken,
.name-status.error {
  color: #ef4444;
}

/* Inline spinner for username checking */
.checking-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(251, 191, 36, 0.3);
  border-top: 2px solid #fbbf24;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 0.5rem;
  vertical-align: middle;
}

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

/* Suggestions */
.name-suggestions {
  margin-top: 0.75rem;
}

.suggestion-item {
  display: inline-block;
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
  padding: 0.375rem 0.75rem;
  margin: 0.25rem 0.25rem 0.25rem 0;
  border-radius: 1rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid rgba(59, 130, 246, 0.2);
  transition: all 0.2s ease;
}

.suggestion-item:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
  transform: translateY(-1px);
}

/* Character count */
.char-count {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: #64748b;
  text-align: right;
}

/* Profile picture container */
.profile-pic-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.profile-pic-preview {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.6);
  border: 2px dashed rgba(148, 163, 184, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #64748b;
  font-size: 0.75rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.profile-pic-preview:hover {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.05);
}

.profile-pic-preview ion-icon {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.profile-pic-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.profile-pic-preview.pulse {
  animation: pulse 0.3s ease;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.upload-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  border: none;
  border-radius: 0.75rem;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  font-family: inherit;
}

.upload-btn:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  transform: translateY(-1px);
  box-shadow: 0 10px 25px -3px rgba(59, 130, 246, 0.3);
}

.upload-btn ion-icon {
  font-size: 1rem;
}

/* Form actions */
.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.skip-btn {
  background: transparent;
  color: #64748b;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 0.75rem;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.3s ease;
  font-family: inherit;
}

.skip-btn:hover {
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(148, 163, 184, 0.05);
}

.complete-btn {
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  color: white;
  border: none;
  border-radius: 0.75rem;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  font-family: inherit;
  min-width: fit-content;
}

.complete-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
  transform: translateY(-1px);
  box-shadow: 0 10px 25px -3px rgba(16, 185, 129, 0.3);
}

.complete-btn:disabled {
  background: rgba(100, 116, 139, 0.3);
  color: rgba(148, 163, 184, 0.5);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.complete-btn ion-icon {
  font-size: 1rem;
}

/* Success message */
.success-message {
  text-align: center;
  padding: 2.5rem;
  color: #f8fafc;
}

.success-message ion-icon {
  font-size: 3rem;
  color: #10b981;
  margin-bottom: 1.25rem;
}

.success-message h2 {
  color: #f8fafc;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  font-weight: 700;
}

.success-message p {
  color: #94a3b8;
  margin-bottom: 2rem;
  font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 640px) {
  body {
    padding: 1rem;
  }

  .container {
    padding: 2rem 1.5rem;
    max-width: 100%;
  }

  .welcome-section h1 {
    font-size: 1.5rem;
  }

  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .profile-pic-container {
    flex-direction: column;
    text-align: center;
  }

  .complete-btn {
    justify-content: center;
  }
}

/* Animation for form elements */
.form-group {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease forwards;
}

.form-group:nth-child(1) {
  animation-delay: 0.1s;
}
.form-group:nth-child(2) {
  animation-delay: 0.2s;
}
.form-group:nth-child(3) {
  animation-delay: 0.3s;
}

.form-actions {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease forwards;
  animation-delay: 0.4s;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
