:root {
  --bg-1: #0a0a0f;
  --bg-2: #1a1a2e;
  --bg-3: #0a0a0f;
  --primary: #8b5cf6;
  --primary-2: #7c3aed;
  --accent: #06b6d4;
  --pink: #f472b6;
  --text: #ffffff;
  --muted: #a1a1aa;
  --card: rgba(255, 255, 255, 0.03);
  --card-border: rgba(255, 255, 255, 0.08);
}

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

body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 50%, var(--bg-3) 100%);
  min-height: 100vh;
  color: var(--text);
  overflow-x: hidden;
}

.bg-particles,
.neon-bg,
.neon-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--primary);
  border-radius: 50%;
  opacity: 0.3;
  animation: float 15s infinite;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { left: 20%; animation-delay: 2s; }
.particle:nth-child(3) { left: 30%; animation-delay: 4s; }
.particle:nth-child(4) { left: 40%; animation-delay: 1s; }
.particle:nth-child(5) { left: 50%; animation-delay: 3s; }
.particle:nth-child(6) { left: 60%; animation-delay: 5s; }
.particle:nth-child(7) { left: 70%; animation-delay: 2.5s; }
.particle:nth-child(8) { left: 80%; animation-delay: 0.5s; }
.particle:nth-child(9) { left: 90%; animation-delay: 3.5s; }

@keyframes float {
  0%, 100% {
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }
  10% { opacity: 0.3; }
  90% { opacity: 0.3; }
  100% {
    transform: translateY(-100vh) scale(1);
    opacity: 0;
  }
}

.neon-line {
  position: absolute;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--accent), transparent);
  box-shadow: 0 0 10px var(--primary), 0 0 20px var(--primary), 0 0 40px var(--accent);
  opacity: 0;
  animation: neonSlide 8s infinite;
}

.neon-line:nth-child(1) { top: 10%; width: 60%; animation-delay: 0s; }
.neon-line:nth-child(2) { top: 25%; width: 80%; animation-delay: 1.5s; }
.neon-line:nth-child(3) { top: 40%; width: 50%; animation-delay: 3s; }
.neon-line:nth-child(4) { top: 55%; width: 70%; animation-delay: 4.5s; }
.neon-line:nth-child(5) { top: 70%; width: 55%; animation-delay: 6s; }
.neon-line:nth-child(6) { top: 85%; width: 65%; animation-delay: 7.5s; }

.neon-line-vertical {
  position: absolute;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--accent), var(--primary), transparent);
  box-shadow: 0 0 10px var(--accent), 0 0 20px var(--accent), 0 0 40px var(--primary);
  opacity: 0;
  animation: neonSlideVertical 10s infinite;
}

.neon-line-vertical:nth-child(7) { left: 5%; height: 40%; animation-delay: 0s; }
.neon-line-vertical:nth-child(8) { left: 20%; height: 60%; animation-delay: 2s; }
.neon-line-vertical:nth-child(9) { left: 80%; height: 50%; animation-delay: 4s; }
.neon-line-vertical:nth-child(10) { left: 95%; height: 45%; animation-delay: 6s; }

.neon-line-diagonal {
  position: absolute;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--pink), var(--primary), transparent);
  box-shadow: 0 0 15px var(--pink), 0 0 30px var(--primary);
  opacity: 0;
  transform: rotate(-15deg);
  animation: neonSlideDiagonal 12s infinite;
}

.neon-line-diagonal:nth-child(11) { top: 15%; width: 100%; animation-delay: 0s; }
.neon-line-diagonal:nth-child(12) { top: 45%; width: 120%; animation-delay: 4s; }
.neon-line-diagonal:nth-child(13) { top: 75%; width: 90%; animation-delay: 8s; }

.neon-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.3;
  animation: orbPulse 6s ease-in-out infinite;
}

.neon-orb:nth-child(14) {
  width: 300px;
  height: 300px;
  background: var(--primary);
  top: 10%;
  left: -5%;
}

.neon-orb:nth-child(15) {
  width: 260px;
  height: 260px;
  background: var(--accent);
  bottom: 10%;
  right: -10%;
  animation-delay: 2s;
}

.neon-orb:nth-child(16) {
  width: 200px;
  height: 200px;
  background: var(--pink);
  top: 50%;
  left: 60%;
  animation-delay: 4s;
}

.neon-grid {
  background-image:
    linear-gradient(rgba(139, 92, 246, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
}

@keyframes neonSlide {
  0% { left: -100%; opacity: 0; }
  5% { opacity: 0.8; }
  50% { opacity: 0.6; }
  95% { opacity: 0.8; }
  100% { left: 100%; opacity: 0; }
}

@keyframes neonSlideVertical {
  0% { top: -100%; opacity: 0; }
  5% { opacity: 0.7; }
  50% { opacity: 0.5; }
  95% { opacity: 0.7; }
  100% { top: 100%; opacity: 0; }
}

@keyframes neonSlideDiagonal {
  0% { left: -150%; opacity: 0; }
  5% { opacity: 0.5; }
  50% { opacity: 0.3; }
  95% { opacity: 0.5; }
  100% { left: 150%; opacity: 0; }
}

@keyframes orbPulse {
  0%, 100% { transform: scale(1); opacity: 0.25; }
  50% { transform: scale(1.08); opacity: 0.4; }
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 1rem 2rem;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.logo-icon {
  width: 45px;
  height: 45px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  gap: 1rem;
  list-style: none;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(139, 92, 246, 0.18);
}

.nav-links a:hover {
  color: #fff;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(6, 182, 212, 0.25));
  border-color: rgba(139, 92, 246, 0.45);
}

.status-link {
  position: relative;
  color: #ffffff;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(139, 92, 246, 0.3));
  border: 1px solid rgba(6, 182, 212, 0.5);
  box-shadow: 0 8px 18px rgba(6, 182, 212, 0.2);
}

.app {
  position: relative;
  z-index: 2;
  padding: 7rem 2rem 4rem;
  max-width: 1400px;
  margin: 0 auto;
}

.hero {
  text-align: center;
  max-width: 900px;
  margin: 0 auto 3rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  font-size: 0.875rem;
  color: #a78bfa;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.hero h1 span {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.1rem;
  color: var(--muted);
  line-height: 1.7;
}

.panel {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2rem;
}

.panel-left,
.panel-right {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 25px 60px rgba(5, 8, 22, 0.6);
}

.card h2 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}

.muted {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

textarea {
  width: 100%;
  min-height: 160px;
  resize: vertical;
  background: rgba(8, 11, 22, 0.8);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 12px;
  color: #fff;
  padding: 1rem;
  font-size: 0.95rem;
}

input,
select {
  width: 100%;
  background: rgba(8, 11, 22, 0.8);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 12px;
  color: #fff;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
}

label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: end;
  margin-top: 1rem;
}

.row.two-col {
  grid-template-columns: 1fr 1fr;
}

.auth-actions {
  grid-template-columns: 1fr 1fr;
}

.auth-user {
  display: none;
}

.auth-user span {
  color: #cbd5f5;
}

.notice {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: #c3f4ff;
  font-size: 0.85rem;
  display: none;
}

#puter-model-row {
  display: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  padding: 0.9rem 2rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(139, 92, 246, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  padding: 0.9rem 2rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.status-pill {
  display: inline-flex;
  margin-top: 1rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: rgba(6, 182, 212, 0.18);
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: #c3f4ff;
  font-size: 0.85rem;
}

.preview-card {
  min-height: 620px;
  position: relative;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.preview-actions {
  display: flex;
  gap: 0.75rem;
}

.ghost-btn {
  background: transparent;
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: #cbd5f5;
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
  cursor: pointer;
}

.preview-frame {
  background: rgba(6, 10, 26, 0.8);
  border-radius: 12px;
  border: 1px solid rgba(139, 92, 246, 0.3);
  overflow: hidden;
  height: 520px;
}

.preview-loading {
  position: absolute;
  inset: 84px 24px 24px 24px;
  border-radius: 12px;
  background: rgba(5, 8, 22, 0.85);
  border: 1px solid rgba(139, 92, 246, 0.25);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  z-index: 2;
  text-align: center;
}

.preview-loading.active {
  display: flex;
}

.swirl {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(139, 92, 246, 0.1), rgba(139, 92, 246, 0.9), rgba(6, 182, 212, 0.9), rgba(139, 92, 246, 0.1));
  mask: radial-gradient(circle at center, transparent 45%, #000 46%);
  animation: spin 1.6s linear infinite;
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.4);
}

.loading-text {
  color: #cbd5f5;
  font-size: 0.95rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.preview-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #0b0f1d;
}

.site-list {
  display: grid;
  gap: 0.75rem;
}

.site-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(9, 12, 24, 0.7);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 12px;
  padding: 0.75rem 1rem;
}

.site-item span {
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 1100px) {
  .panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  nav {
    padding: 1rem;
  }

  .nav-links {
    display: none;
  }

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

  .preview-card {
    min-height: auto;
  }
}
