@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;600;700&display=swap');
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #000;
  font-family: 'Inter', system-ui, sans-serif;
  color: #e2e0f0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
}

/* ─── Ambient glow ─── */
.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.bg-glow::before {
  content: '';
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  animation: glowPulse 4s ease-in-out infinite;
}
@keyframes glowPulse {
  0%,
  100% {
    opacity: 0.6;
    transform: translateX(-50%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) scale(1.15);
  }
}

.container {
  position: relative;
  z-index: 1;
  max-width: 640px;
  width: 100%;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}
body.has-sessions {
  justify-content: flex-start;
  overflow-y: auto;
}
body.has-sessions .container {
  margin-top: 80px;
}

/* ─── Logo ─── */
.logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.logo-icon {
  width: 64px;
  height: 64px;
}
.logo-icon svg {
  width: 100%;
  height: 100%;
}
.logo-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 56px;
  font-weight: 700;
  letter-spacing: 5px;
  background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 40%, #c4b5fd 60%, #7c3aed 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease infinite;
  filter: drop-shadow(0 0 20px rgba(124, 58, 237, 0.3));
}
@keyframes gradientShift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.subtitle {
  font-size: 18px;
  color: #c4b5fd;
  margin-bottom: 40px;
  letter-spacing: 0.3px;
  text-align: center;
  line-height: 1.5;
  max-width: 520px;
  font-weight: 500;
}

/* ─── Input area ─── */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  margin-bottom: 0;
}
.prompt-input {
  width: 100%;
  min-height: 120px;
  padding: 16px 18px;
  background: #0f0d1a;
  border: 1px solid #2d2a3e;
  border-radius: 12px;
  color: #e2e0f0;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  outline: none;
  resize: vertical;
  transition:
    border-color 0.25s,
    box-shadow 0.25s;
}
.prompt-input:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}
.prompt-input::placeholder {
  color: #4a4660;
}

.submit-btn {
  align-self: flex-end;
  padding: 16px 28px;
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    opacity 0.2s,
    transform 0.15s,
    box-shadow 0.25s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.submit-btn:hover {
  opacity: 0.9;
  box-shadow: 0 0 24px rgba(124, 58, 237, 0.3);
}
.submit-btn:active {
  transform: scale(0.97);
}
.submit-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}
.submit-btn .zap-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.gen-counter {
  font-size: 12px;
  color: #6b6880;
  text-align: right;
  margin-top: 8px;
  font-family: 'JetBrains Mono', monospace;
}
.gen-counter.limit-reached {
  color: #ef4444;
}

.spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
.loading .spinner {
  display: inline-block;
}
.loading .btn-label {
  display: none;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ─── Sessions grid ─── */
.sessions {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1200px;
  margin-top: 48px;
  border-top: 1px solid #2d2a3e;
  padding: 20px 2rem 60px;
}
.sessions h2 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: rgba(167, 139, 250, 0.5);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 16px;
}
.session-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.session-list.single-col {
  grid-template-columns: 1fr;
  max-width: 480px;
}
.session-list.two-col {
  grid-template-columns: repeat(2, 1fr);
}
@media (max-width: 900px) {
  .session-list {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 560px) {
  .session-list, .session-list.two-col {
    grid-template-columns: 1fr;
  }
}
.session-item {
  display: flex;
  flex-direction: column;
  background: #0f0d1a;
  border: 1px solid #2d2a3e;
  border-radius: 12px;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.25s,
    transform 0.15s;
  overflow: hidden;
}
.session-item:hover {
  background: #16132a;
  border-color: #7c3aed;
  transform: translateY(-2px);
}
.session-thumbnail {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  position: relative;
  background: #0a0818;
  border-radius: 11px 11px 0 0;
}
.session-thumbnail iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 1280px;
  height: 800px;
  border: none;
  transform-origin: top left;
  pointer-events: none;
}
.session-badges {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  z-index: 2;
}
.session-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(6px);
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.3px;
}
.badge-time {
  background: rgba(124, 58, 237, 0.85);
}
.badge-cost {
  background: rgba(16, 185, 129, 0.85);
}
.session-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2d2a3e;
}
.session-placeholder svg {
  width: 40px;
  height: 40px;
  opacity: 0.5;
}
.session-info {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid #2d2a3e;
}
.session-prompt {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  font-size: 13px;
  line-height: 1.45;
  color: #e2e0f0;
}
.session-meta {
  font-family: 'JetBrains Mono', monospace;
  color: #8b86a8;
  font-size: 11px;
  white-space: nowrap;
  align-self: flex-end;
}

.wappalyzer-banner {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #22c55e;
  color: #000;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  padding: 6px 12px;
  z-index: 100;
}

.social-links {
  position: fixed;
  bottom: 20px;
  left: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 10;
}
.social-links a {
  color: #4a4660;
  transition: color 0.2s;
  display: flex;
  align-items: center;
}
.social-links a:hover {
  color: #a78bfa;
}
.social-links a svg {
  width: 18px;
  height: 18px;
}

/* ─── Auth overlay ─── */
#auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
#auth-overlay.hidden { display: none; }
.auth-box {
  background: #0f0d1a;
  border: 1px solid #2d2a3e;
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.auth-logo {
  font-family: 'JetBrains Mono', monospace;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 4px;
  background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 50%, #c4b5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-title {
  font-size: 14px;
  color: #8b86a8;
  text-align: center;
  margin-top: -10px;
}
.auth-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid #2d2a3e;
  background: #16132a;
  color: #e2e0f0;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.auth-btn:hover { border-color: #7c3aed; background: #1e1a32; }
.auth-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.auth-divider {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #4a4660;
  font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #2d2a3e;
}
.auth-input {
  width: 100%;
  padding: 11px 14px;
  background: #0a0818;
  border: 1px solid #2d2a3e;
  border-radius: 8px;
  color: #e2e0f0;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.auth-input:focus { border-color: #7c3aed; }
.auth-input::placeholder { color: #4a4660; }
.auth-email-row {
  width: 100%;
  display: flex;
  gap: 8px;
}
.auth-email-row .auth-btn {
  flex: 1;
  padding: 11px 10px;
  font-size: 13px;
}
.auth-error {
  color: #f87171;
  font-size: 12px;
  text-align: center;
  min-height: 16px;
}

/* ─── Sign-out button ─── */
#signout-btn {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 100;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid #2d2a3e;
  border-radius: 8px;
  color: #8b86a8;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
#signout-btn:hover { border-color: #7c3aed; color: #a78bfa; }
