/* ============================================================
   PWA Install Tester — Styles
   Theme: Clean bright white/blue design
   ============================================================ */

:root {
  --blue: #3B82F6;
  --blue-light: #93C5FD;
  --blue-dark: #1D4ED8;
  --green: #10B981;
  --green-light: #D1FAE5;
  --red: #EF4444;
  --red-light: #FEE2E2;
  --yellow: #F59E0B;
  --yellow-light: #FEF3C7;
  --bg: #F8FAFC;
  --bg-card: #FFFFFF;
  --border: #E2E8F0;
  --border-hover: #CBD5E1;
  --text: #1E293B;
  --text-muted: #64748B;
  --text-dim: #94A3B8;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --transition: 200ms ease;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.08);
}

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

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

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

.app {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

/* Header */
.header {
  padding: 24px 0 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.logo-row { display: flex; align-items: center; gap: 12px; }

.logo-badge {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: #EFF6FF;
  border-radius: var(--radius);
  border: 1px solid #DBEAFE;
}

h1 { font-size: 1.25rem; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.tagline { font-size: 0.78rem; color: var(--text-muted); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; border: none; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.875rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition); white-space: nowrap;
}

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

.btn-outline {
  background: var(--bg-card); color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }

/* Input Section */
.input-section { margin-bottom: 24px; }

.url-row { display: flex; gap: 10px; }

#urlInput {
  flex: 1; padding: 11px 16px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: var(--font); font-size: 0.9rem; outline: none;
  transition: border-color var(--transition);
}
#urlInput:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,130,246,0.08); }
#urlInput::placeholder { color: var(--text-dim); }

.hint { font-size: 0.75rem; color: var(--text-dim); margin-top: 6px; }

/* Loader */
.loader { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px 20px; }
.loader[hidden] { display: none; }
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--border); border-top-color: var(--blue);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Results */
.results[hidden] { display: none; }
.results { animation: fadeUp 350ms ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* Summary Banner */
.summary-banner {
  padding: 16px 20px; border-radius: var(--radius);
  margin-bottom: 20px; font-weight: 600; font-size: 0.95rem;
  display: flex; align-items: center; gap: 10px;
}
.summary-pass { background: var(--green-light); color: #065F46; border: 1px solid #A7F3D0; }
.summary-warn { background: var(--yellow-light); color: #92400E; border: 1px solid #FDE68A; }
.summary-fail { background: var(--red-light); color: #991B1B; border: 1px solid #FECACA; }

/* Cards */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.card-title { font-size: 0.95rem; font-weight: 600; margin-bottom: 14px; }

/* Manifest Details */
.manifest-details { font-size: 0.82rem; }

.manifest-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid #F1F5F9;
}
.manifest-row:last-child { border-bottom: none; }
.manifest-key { font-weight: 500; color: var(--text-muted); }
.manifest-val { font-weight: 600; color: var(--text); text-align: right; max-width: 60%; word-break: break-all; }

/* Checklist */
.checklist { font-size: 0.84rem; }

.check-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid #F1F5F9;
}
.check-item:last-child { border-bottom: none; }

.check-icon {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; flex-shrink: 0; margin-top: 1px;
}
.check-pass { background: var(--green-light); color: #065F46; }
.check-fail { background: var(--red-light); color: #991B1B; }
.check-warn { background: var(--yellow-light); color: #92400E; }

.check-text { flex: 1; }
.check-label { font-weight: 600; }
.check-desc { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* Icon Grid */
.icon-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
}

.icon-cell {
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 8px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); text-align: center;
  transition: border-color var(--transition);
}
.icon-cell.present { border-color: #A7F3D0; background: #F0FDF4; }
.icon-cell.missing { border-color: #FECACA; background: #FEF2F2; }

.icon-size { font-size: 0.7rem; font-weight: 600; color: var(--text); margin-top: 4px; }
.icon-status { font-size: 0.65rem; color: var(--text-muted); }

/* Display Preview */
.display-preview {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.display-option {
  padding: 14px; border: 2px solid var(--border);
  border-radius: var(--radius-sm); text-align: center;
  transition: all var(--transition);
}
.display-option.active { border-color: var(--blue); background: #EFF6FF; }
.display-mode-name { font-weight: 600; font-size: 0.85rem; }
.display-mode-desc { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

/* Color Preview */
.color-preview { display: flex; gap: 16px; flex-wrap: wrap; }

.color-swatch {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.swatch-box {
  width: 64px; height: 64px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.swatch-label { font-size: 0.72rem; color: var(--text-muted); }
.swatch-value { font-size: 0.7rem; font-weight: 600; font-family: monospace; }

/* Platform Table */
.platform-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.platform-table th {
  text-align: left; padding: 8px 10px; font-size: 0.7rem;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-dim); border-bottom: 1px solid var(--border);
}
.platform-table td { padding: 8px 10px; border-bottom: 1px solid #F1F5F9; }
.platform-table tr:last-child td { border-bottom: none; }

/* Export */
.export-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }

/* Empty State */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state[hidden] { display: none; }
.empty-icon { margin-bottom: 16px; }
.empty-state h2 { font-size: 1.1rem; margin-bottom: 6px; }
.empty-state p { color: var(--text-muted); font-size: 0.85rem; max-width: 400px; margin: 0 auto; }

/* Responsive */
@media (max-width: 600px) {
  .url-row { flex-direction: column; }
  h1 { font-size: 1.1rem; }
  .display-preview { grid-template-columns: 1fr 1fr; }
}
