/* ── Design Tokens ──────────────────────────────────────────────────────── */
:root {
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --color-bg: #0f0f11;
  --color-surface: #1a1a1f;
  --color-surface-hover: #24242b;
  --color-border: #2a2a33;
  --color-accent: #3b82f6;
  --color-accent-hover: #2563eb;
  --color-text: #f0f0f3;
  --color-text-muted: #8b8b9e;
  --color-danger: #ef4444;
  --color-success: #22c55e;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --transition: 0.2s ease;
}

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

body {
  font-family: var(--font-family);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Screen Layout ─────────────────────────────────────────────────────── */
.screen { min-height: 100vh; }
.hidden { display: none !important; }

/* ── Auth Screen ───────────────────────────────────────────────────────── */
#auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
    var(--color-bg);
}

.auth-card {
  text-align: center;
  padding: 48px 40px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 420px;
  width: 90%;
}

.auth-icon { font-size: 56px; margin-bottom: 16px; }

.auth-card h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.auth-subtitle {
  color: var(--color-text-muted);
  margin-bottom: 32px;
  font-size: 15px;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 16px;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}
.btn-primary:hover { background: var(--color-accent-hover); }

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}
.btn-ghost:hover {
  color: var(--color-text);
  border-color: var(--color-text-muted);
}

.btn-large {
  padding: 14px 32px;
  font-size: 16px;
  border-radius: 10px;
}

/* ── Header ────────────────────────────────────────────────────────────── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-icon { font-size: 24px; }

.app-header h1 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-email {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* ── Main Content ──────────────────────────────────────────────────────── */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px;
}

/* ── Project Grid ──────────────────────────────────────────────────────── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.project-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.project-card:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.project-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.project-icon {
  font-size: 36px;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 12px;
  flex-shrink: 0;
}

.project-card-header h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.project-tag {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-accent);
  background: rgba(59, 130, 246, 0.1);
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 2px;
}

.project-description {
  color: var(--color-text-muted);
  font-size: 14px;
  line-height: 1.6;
  flex-grow: 1;
}

.project-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

.project-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-accent);
  display: flex;
  align-items: center;
  gap: 4px;
}

.project-link::after {
  content: '→';
  transition: transform var(--transition);
}

.project-card:hover .project-link::after {
  transform: translateX(4px);
}

.project-status {
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-live {
  color: var(--color-success);
  background: rgba(34, 197, 94, 0.1);
}

.status-dev {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.status-server {
  color: #8b5cf6;
  background: rgba(139, 92, 246, 0.1);
}

.status-cli {
  color: #6b7280;
  background: rgba(107, 114, 128, 0.1);
}

.status-appstore {
  color: #0ea5e9;
  background: rgba(14, 165, 233, 0.1);
}

.status-pending {
  color: #f97316;
  background: rgba(249, 115, 22, 0.1);
}

.status-coming {
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.1);
}

.status-archived {
  color: var(--color-text-muted);
  background: rgba(139, 139, 158, 0.1);
}

/* ── Error Message ─────────────────────────────────────────────────────── */
.error-msg {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--color-danger);
  border-radius: 8px;
  font-size: 14px;
}

/* ── Loading ───────────────────────────────────────────────────────────── */
.loading-placeholder {
  color: var(--color-text-muted);
  text-align: center;
  padding: 60px 20px;
  font-size: 15px;
}

/* ── Empty State ───────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-muted);
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .app-header { padding: 12px 16px; }
  .main-content { padding: 20px 16px; }
  .project-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 32px 24px; }
  .user-email { display: none; }
}
