/* ============================================================
   BuildStatus — Design System
   Dashboard: Dark slate/blue theme
   Public pages: Clean white/light for client-facing
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Tokens ──────────────────────────────────────────────── */
:root {
  --bg: #070a0f;
  --bg-card: #0c1017;
  --bg-input: #111825;
  --bg-elevated: #151c2a;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-glow: rgba(59, 130, 246, 0.15);
  --text-primary: #e8ecf4;
  --text-secondary: #8494b2;
  --text-muted: #4a5a7a;
  --border: rgba(255,255,255,0.06);
  --border-accent: rgba(59, 130, 246, 0.3);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 2px 12px rgba(0,0,0,0.3);
  --gradient: linear-gradient(135deg, #2563eb, #3b82f6);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; }

/* ── Navbar ──────────────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
  text-decoration: none;
}

.navbar-brand .brand-icon { font-size: 20px; }

.navbar-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.navbar-links a {
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.navbar-links a:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

.navbar-links a.active {
  color: var(--accent);
  background: var(--accent-glow);
}

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

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-elevated);
  border-color: rgba(255,255,255,0.12);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12.5px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 8px;
  font-size: 16px;
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all 0.25s ease;
}

.card:hover {
  border-color: rgba(255,255,255,0.1);
  box-shadow: var(--shadow);
}

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

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ── Form Elements ───────────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── Progress Bar ────────────────────────────────────────── */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar .progress-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--gradient);
  transition: width 0.5s ease;
}

.progress-bar-lg {
  height: 12px;
  border-radius: 6px;
}

.progress-bar-lg .progress-fill {
  border-radius: 6px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.progress-label .progress-percent {
  font-weight: 700;
  color: var(--accent);
  font-size: 14px;
}

/* ── Status Badges ───────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  letter-spacing: 0.02em;
}

.badge-active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.badge-paused {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.badge-completed {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent);
}

/* ── Project Card ────────────────────────────────────────── */
.project-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all 0.25s ease;
  cursor: pointer;
}

.project-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.project-card .project-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.project-card .project-client {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.project-card .project-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
}

/* ── Update Timeline ─────────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 24px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  z-index: 1;
}

.timeline-item .update-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.timeline-item .update-category {
  background: var(--accent-glow);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10.5px;
  font-weight: 600;
}

.timeline-item .update-text {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
}

.timeline-item .update-photo {
  margin-top: 10px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  max-height: 300px;
}

.timeline-item .update-photo img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* ── Photo Upload ────────────────────────────────────────── */
.photo-upload {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-input);
}

.photo-upload:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.photo-upload.has-photo {
  padding: 8px;
  border-style: solid;
}

.photo-upload .upload-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.photo-upload .upload-text {
  font-size: 13px;
  color: var(--text-secondary);
}

.photo-upload .upload-preview {
  max-height: 200px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  width: 100%;
}

/* ── Share Link ──────────────────────────────────────────── */
.share-link-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 4px 4px 14px;
}

.share-link-box input {
  flex: 1;
  background: none;
  border: none;
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  outline: none;
}

.share-link-box .btn-copy {
  padding: 8px 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.share-link-box .btn-copy:hover {
  background: var(--accent-hover);
}

/* ── Dashboard Layout ────────────────────────────────────── */
.dashboard {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 20px;
}

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

.dashboard-header h1 {
  font-size: 22px;
  font-weight: 800;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
  max-width: 400px;
  margin: 0 auto 20px;
}

/* ── Project Detail Layout ───────────────────────────────── */
.project-layout {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px;
}

.project-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.project-top h1 {
  font-size: 20px;
  font-weight: 800;
}

.update-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}

.update-form-card h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 16px;
  letter-spacing: 0.03em;
}

.progress-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--bg-input);
  outline: none;
}

.progress-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-overlay.active { display: flex; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.modal h2 {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* ── Toast ───────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 2000;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast--success { border-left: 3px solid var(--success); }
.toast--error { border-left: 3px solid var(--danger); }

/* ── Hero (Landing Page) ─────────────────────────────────── */
.hero {
  text-align: center;
  padding: 80px 20px 60px;
  max-width: 720px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #e8ecf4 0%, #93a8d0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero h1 span {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto 28px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-actions .btn { padding: 14px 28px; font-size: 15px; }

/* ── Feature Cards ───────────────────────────────────────── */
.features {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.features h2 {
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 40px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  transition: all 0.25s;
}

.feature-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
}

.feature-card .feature-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.feature-card h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── Demo Preview (Landing) ──────────────────────────────── */
.demo-section {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

.demo-card {
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.1);
}

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.site-footer a { color: var(--text-secondary); }
.site-footer a:hover { color: var(--accent); }

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════
   PUBLIC STATUS PAGE — Light/White Theme
   (Client-facing, no auth, professional)
   ═══════════════════════════════════════════════════════════ */

.public-page {
  background: #f8f9fc;
  color: #1a202c;
  min-height: 100vh;
  font-family: 'Inter', system-ui, sans-serif;
}

.public-page .pub-header {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 20px 24px;
}

.public-page .pub-header-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.public-page .pub-contractor {
  font-size: 14px;
  font-weight: 600;
  color: #4a5568;
}

.public-page .pub-contractor-contact {
  font-size: 12px;
  color: #718096;
}

.public-page .pub-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px;
}

.public-page .pub-project-name {
  font-size: 28px;
  font-weight: 800;
  color: #1a202c;
  margin-bottom: 4px;
}

.public-page .pub-project-address {
  font-size: 14px;
  color: #718096;
  margin-bottom: 24px;
}

.public-page .pub-progress-container {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 28px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.public-page .pub-progress-bar {
  height: 14px;
  background: #e2e8f0;
  border-radius: 7px;
  overflow: hidden;
}

.public-page .pub-progress-fill {
  height: 100%;
  border-radius: 7px;
  transition: width 0.5s ease;
}

.public-page .pub-progress-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 13px;
  color: #718096;
}

.public-page .pub-progress-percent {
  font-weight: 800;
  font-size: 20px;
}

.public-page .pub-updates-title {
  font-size: 16px;
  font-weight: 700;
  color: #4a5568;
  margin-bottom: 16px;
}

.public-page .pub-update {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.public-page .pub-update-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #a0aec0;
  margin-bottom: 8px;
}

.public-page .pub-update-category {
  background: #ebf4ff;
  color: #3b82f6;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.public-page .pub-update-text {
  font-size: 14px;
  color: #2d3748;
  line-height: 1.6;
}

.public-page .pub-update-photo {
  margin-top: 10px;
  border-radius: 8px;
  overflow: hidden;
}

.public-page .pub-update-photo img {
  width: 100%;
  display: block;
}

.public-page .pub-footer {
  text-align: center;
  padding: 32px 20px;
  font-size: 12px;
  color: #a0aec0;
}

.public-page .pub-footer a {
  color: #3b82f6;
  text-decoration: none;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero h1 { font-size: 30px; }
  .hero p { font-size: 15px; }
  .feature-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: 1fr; }
  .dashboard-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .project-top { flex-direction: column; }
  .navbar-links { gap: 8px; }
  .navbar-links a { padding: 6px 8px; font-size: 12px; }
}

@media (max-width: 480px) {
  .hero { padding: 48px 16px 40px; }
  .hero h1 { font-size: 26px; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
}
