:root {
  --bg-dark: #0f172a;
  --card-bg: rgba(30, 41, 59, 0.7);
  --card-border: rgba(255, 255, 255, 0.08);
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --accent: #ec4899;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --error: #ef4444;
  --success: #10b981;
  --radius: 16px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 20px;
  position: relative;
  overflow-x: hidden;
}

.background-glow {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(236, 72, 153, 0.08) 50%, transparent 70%);
  filter: blur(80px);
  z-index: 0;
  pointer-events: none;
}

.container {
  width: 100%;
  max-width: 800px;
  z-index: 1;
}

/* Header */
.app-header {
  text-align: center;
  margin-bottom: 32px;
}

.badge {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.app-header h1 {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.app-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Glass Card */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

/* Tab Controls */
.tab-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.tab-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
}

.tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* Domain Selector Pills */
.domain-selector-group {
  margin-bottom: 16px;
}

.input-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.domain-pills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.pill-option {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: var(--transition);
}

.pill-option input[type="radio"] {
  accent-color: var(--primary);
}

.pill-option:hover {
  border-color: rgba(99, 102, 241, 0.5);
  color: var(--text-main);
}

.pill-option.active {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.12);
  color: #ffffff;
}

.hint-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 8px;
  font-style: italic;
}

/* Input Forms */
.input-group {
  display: flex;
  gap: 12px;
}

.input-group-vertical {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

input[type="text"], textarea {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 14px 18px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

input[type="text"]:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px 24px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.primary-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition);
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Error Banner */
.error-banner {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-top: 14px;
}

/* Loading Skeleton */
.loading-card {
  display: flex;
  gap: 20px;
  align-items: center;
}

.skeleton {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 8px;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skeleton-lines {
  flex: 1;
}

.skeleton-title {
  height: 20px;
  width: 60%;
  margin-bottom: 12px;
}

.skeleton-text {
  height: 14px;
  width: 90%;
  margin-bottom: 8px;
}

.skeleton-text.short {
  width: 40%;
}

/* Profile Results */
.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 16px;
}

.card-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.profile-preview {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.avatar-container {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(99, 102, 241, 0.4);
  background: rgba(15, 23, 42, 0.8);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.profile-details {
  flex: 1;
}

.profile-username {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.profile-badge {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.profile-bio {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 10px;
}

.profile-url {
  color: var(--primary);
  font-size: 0.85rem;
  text-decoration: none;
  word-break: break-all;
}

.profile-url:hover {
  text-decoration: underline;
}

/* JSON Code Block */
pre {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  overflow-x: auto;
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
  color: #a5b4fc;
}

.hidden {
  display: none !important;
}

@media (max-width: 600px) {
  .input-group {
    flex-direction: column;
  }
  .profile-preview {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}
