/* server/public/style.css */

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0A0A0A;
  --surface: #111111;
  --border: #222222;
  --border-light: #333333;
  --text: #e0e0e0;
  --text-muted: #999999;
  --text-dim: #666666;
  --text-faint: #444444;
  --text-ghost: #333333;
  --accent: #4a3aff;
  --accent-light: #6b5cff;
  --green: #2a2;
  --red: #e44;
  --mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --max-width: 1280px;
  --content-width: 720px;
  --shadow: 4px 4px 0 var(--accent);
  --shadow-sm: 3px 3px 0 var(--accent);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

/* Header */
header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid var(--border);
  margin-bottom: 32px;
}

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

.logo-img {
  height: 120px;
  width: auto;
}

nav { display: flex; gap: 4px; }

.nav-link {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: none;
  padding: 5px 12px;
  border: 2px solid transparent;
  border-radius: 6px;
  transition: all 0.1s;
  letter-spacing: 0.02em;
}
.nav-link:hover { color: var(--text); border-color: var(--border); }
.nav-link.active {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(74, 58, 255, 0.08);
}

#user-info {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
}

/* Main content */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px 64px;
}

/* Feed grid */
.feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* App cards (feed) */
.card {
  background: var(--surface);
  border: 2px solid var(--border-light);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s, box-shadow 0.1s;
}
.card:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--accent);
}

.card-preview {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 2px solid var(--border-light);
}

.card-body { padding: 14px 16px; }

.card-slug {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-light);
}

.card-version {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--border);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-light);
}

.card-description {
  font-size: 13px;
  color: var(--text-muted);
  margin: 8px 0;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
}

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

/* Content-width wrapper for narrower views */
.content-narrow {
  max-width: var(--content-width);
  margin: 0 auto;
}

/* Upload form */
.tab-toggle {
  display: flex;
  background: var(--surface);
  border: 2px solid var(--border-light);
  border-radius: 8px;
  padding: 3px;
  width: fit-content;
  margin-bottom: 24px;
}

.tab-btn {
  padding: 6px 16px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  background: none;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  letter-spacing: 0.02em;
}
.tab-btn.active {
  color: var(--text);
  background: var(--accent);
  color: #fff;
}

.drop-zone {
  border: 3px dashed var(--border-light);
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  margin-bottom: 24px;
  transition: border-color 0.1s, background 0.1s, box-shadow 0.1s;
}
.drop-zone.dragover {
  border-color: var(--accent);
  background: rgba(74, 58, 255, 0.05);
  box-shadow: var(--shadow);
}

.drop-zone-icon { font-size: 24px; margin-bottom: 8px; opacity: 0.4; }
.drop-zone-text { font-family: var(--mono); font-size: 14px; color: var(--text-dim); }
.drop-zone-hint { font-family: var(--mono); font-size: 12px; color: var(--text-ghost); margin-top: 4px; }

.paste-area {
  width: 100%;
  min-height: 200px;
  background: var(--surface);
  border: 2px solid var(--border-light);
  border-radius: 10px;
  padding: 12px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  resize: vertical;
  margin-bottom: 24px;
}
.paste-area:focus { outline: none; border-color: var(--accent); box-shadow: var(--shadow-sm); }

.file-list {
  margin-bottom: 24px;
}

.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 13px;
}

.file-name {
  font-family: var(--mono);
  color: var(--text-muted);
}

.file-size { font-family: var(--mono); font-size: 11px; color: var(--text-dim); }

.file-remove {
  color: var(--text-dim);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
}
.file-remove:hover { color: var(--red); }

/* Slug input */
.slug-input-wrapper {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 2px solid var(--border-light);
  border-radius: 8px;
  padding: 0 14px;
  height: 44px;
  margin-bottom: 6px;
}

.slug-prefix, .slug-suffix {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-ghost);
  white-space: nowrap;
}

.slug-input {
  background: none;
  border: none;
  outline: none;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-light);
  padding: 0 4px;
  min-width: 80px;
  flex: 1;
}

.slug-status {
  font-size: 11px;
  font-family: var(--mono);
  padding-left: 4px;
  margin-bottom: 16px;
  height: 16px;
}
.slug-status.available { color: var(--green); }
.slug-status.taken { color: var(--red); }
.slug-status.invalid { color: var(--red); }

/* Form fields */
.form-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
  display: block;
}

.form-input {
  width: 100%;
  background: var(--surface);
  border: 2px solid var(--border-light);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 12px;
}
.form-input:focus { outline: none; border-color: var(--accent); box-shadow: var(--shadow-sm); }

.btn-deploy {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--accent);
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  margin-top: 8px;
  box-shadow: 4px 4px 0 rgba(74, 58, 255, 0.3);
  transition: transform 0.1s, box-shadow 0.1s;
}
.btn-deploy:hover:not(:disabled) {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 rgba(74, 58, 255, 0.4);
}
.btn-deploy:disabled { opacity: 0.35; cursor: not-allowed; }

/* App detail */
.app-detail-header { margin-bottom: 24px; }

.app-detail-title {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.app-detail-slug {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent-light);
}

.app-detail-description {
  color: var(--text-muted);
  margin: 12px 0;
}

.app-preview-iframe {
  width: 100%;
  height: 400px;
  border: 2px solid var(--border-light);
  border-radius: 12px;
  background: #fff;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.app-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid var(--border-light);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s, box-shadow 0.1s;
}
.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--accent);
}
.btn-danger { color: var(--red); border-color: var(--red); box-shadow: 3px 3px 0 rgba(238, 68, 68, 0.3); }
.btn-danger:hover { box-shadow: 4px 4px 0 var(--red); }

/* Deploy history */
.deploy-list { margin-top: 24px; }
.deploy-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 2px solid var(--border);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
}

/* People */
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.person-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 2px solid var(--border-light);
  border-radius: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s, box-shadow 0.1s;
}
.person-card:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--accent);
}

.person-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--border-light);
  border: 2px solid var(--border);
}

.person-name { color: var(--text); font-size: 14px; font-weight: 600; }
.person-stats { font-family: var(--mono); color: var(--text-dim); font-size: 11px; }

/* Utilities */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-dim);
  font-family: var(--mono);
}

.loading {
  text-align: center;
  padding: 48px;
  color: var(--text-dim);
  font-family: var(--mono);
}

.time-ago { color: var(--text-faint); }

.section-title {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

/* Landing page */
.landing-hero {
  background: #4a3aff;
  background-image:
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  padding: 80px 24px 72px;
  display: flex;
  justify-content: center;
}

.landing-logo {
  display: block;
  width: 280px;
  height: auto;
  margin: 0 auto 32px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}

.landing-hero-inner {
  max-width: 520px;
  width: 100%;
}

.landing-drop-card {
  background: #fff;
  border: 3px solid #000;
  border-radius: 16px;
  padding: 56px 32px;
  text-align: center;
  box-shadow: 8px 8px 0 #000;
}

.landing-drop-icon {
  width: 52px;
  height: 52px;
  background: #4a3aff;
  color: #fff;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  margin: 0 auto 20px;
}

.landing-drop-title {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  color: #000;
  letter-spacing: 0.03em;
}

.landing-drop-hint {
  font-family: var(--mono);
  font-size: 14px;
  color: #999;
  margin-top: 6px;
  letter-spacing: 0.05em;
}

.landing-divider {
  height: 6px;
  background: #4a3aff;
}

.landing-features {
  background: #f5f5f0;
  padding: 64px 24px 80px;
  text-align: center;
}

.landing-features-inner {
  max-width: 880px;
  margin: 0 auto;
}

.landing-heading {
  font-family: var(--mono);
  font-size: 32px;
  font-weight: 700;
  color: #000;
  letter-spacing: 0.05em;
  margin-bottom: 40px;
}

.landing-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 56px;
}

.landing-card {
  background: #fff;
  border: 3px solid #000;
  border-radius: 12px;
  padding: 28px 24px;
  text-align: left;
  box-shadow: 5px 5px 0 #000;
}

.landing-card h3 {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  color: #000;
  margin-bottom: 10px;
}

.landing-card p {
  font-size: 14px;
  color: #555;
  line-height: 1.55;
}

.landing-card em {
  font-style: normal;
  color: #4a3aff;
  font-family: var(--mono);
  font-size: 12px;
}

.landing-login-btn {
  display: inline-block;
  padding: 16px 48px;
  background: #000;
  color: #fff;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
  border-radius: 10px;
  border: 3px solid #000;
  text-decoration: none;
  box-shadow: 4px 4px 0 #4a3aff;
  transition: transform 0.1s, box-shadow 0.1s;
}
.landing-login-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 #4a3aff;
}

@media (max-width: 640px) {
  .landing-cards {
    grid-template-columns: 1fr;
  }
  .landing-hero { padding: 48px 16px 40px; }
  .landing-drop-card { padding: 36px 20px; }
  .landing-heading { font-size: 24px; }
}
