/* style.css - Heat Pump Install PWA */

:root {
  --bg: #ffffff;
  --surface: #f9fafb;
  --border: #e5e7eb;
  --text: #111827;
  --text-muted: #4b5563;
  --primary: #14b8a6;
  --primary-light: #78ffff;
  --danger: #dc2626;
  --warning: #f59e0b;
  --success: #14b8a6;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111827;
    --surface: #1f2937;
    --border: #374151;
    --text: #f9fafb;
    --text-muted: #d1d5db;
    --primary-light: #1e3a2f;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
  }
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 70px;
  -webkit-font-smoothing: antialiased;
}

#app { max-width: 480px; margin: 0 auto; padding: 0 1rem; }

/* App Header */
.app-header {
  padding: 1rem 0;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.app-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.pro-badge {
  display: inline-block;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  font-size: 0.6rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 700;
  margin-left: 0.5rem;
  vertical-align: middle;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 0.5rem 0;
  padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0));
  z-index: 100;
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 0.65rem;
  cursor: pointer;
  padding: 0.25rem 0.75rem;
  gap: 0.15rem;
  transition: color 0.2s;
}

.nav-btn .nav-icon { font-size: 1.3rem; }
.nav-btn.active { color: var(--primary); }

.nav-btn.add-btn {
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -1rem;
  box-shadow: 0 2px 8px rgba(22,163,74,0.4);
}

/* Screen Title */
.screen-title {
  font-size: 1.25rem;
  font-weight: 700;
  padding: 1rem 0 0.5rem;
}

/* Card */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.card h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

/* Project List */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.project-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--primary);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 0.5rem;
}

.project-name {
  font-weight: 600;
  color: var(--text);
  font-size: 1.1rem;
}

.project-status {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
}

.status-draft { background: #e5e7eb; color: #4b5563; }
.status-active { background: #dbeafe; color: #1d4ed8; }
.status-complete { background: #78ffff; color: #00a492; }

.project-address {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.project-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Form Elements */
.field-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text);
  font-size: 0.9rem;
}

.field-input,
.field-select,
.field-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
  margin-bottom: 1rem;
}

.field-textarea {
  min-height: 100px;
  resize: vertical;
}

.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  outline: none;
  border-color: var(--primary);
}

/* Buttons */
.btn-primary,
.save-btn {
  width: 100%;
  padding: 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 0.5rem;
}

.btn-primary:hover,
.save-btn:hover {
  background: #00a492;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22,163,74,0.3);
}

.btn-secondary {
  width: 100%;
  padding: 1rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 0.5rem;
}

.delete-btn {
  width: 100%;
  padding: 0.75rem;
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
}

/* Checklist */
.checklist {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.checklist-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.checklist-item label {
  flex: 1;
  cursor: pointer;
}

.checklist-item.checked label {
  text-decoration: line-through;
  opacity: 0.6;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Premium Gate */
.premium-gate-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}

.premium-gate-content {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 400px;
  text-align: center;
}

.premium-gate-badge {
  display: inline-block;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 700;
  margin-bottom: 1rem;
}

.premium-buy-btn {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1rem;
}

.premium-restore-link {
  display: block;
  margin-top: 1rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
}

/* Loading */
.loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}

.tab-btn {
  flex: 1;
  padding: 0.75rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 600;
  margin-bottom: -2px;
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Responsive */
@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}
