/* PageWatch — Black & White Theme */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #ffffff;
  --bg-secondary: #f5f5f5;
  --bg-tertiary: #e8e8e8;
  --text: #111111;
  --text-secondary: #555555;
  --text-muted: #888888;
  --border: #d0d0d0;
  --border-light: #e5e5e5;
  --accent: #111111;
  --accent-hover: #333333;
  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }
.hidden { display: none !important; }

/* ── Nav ── */
nav {
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
}
.logo img {
  display: inline-block;
}
nav .container { display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 20px; font-weight: 700; letter-spacing: -0.5px; }
.logo span { color: var(--text-muted); font-weight: 400; }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { color: var(--text-secondary); font-size: 14px; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  font-family: var(--font);
}
.btn-primary {
  background: var(--accent);
  color: #ffffff !important;
  border-color: var(--accent);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.15s ease;
}
.btn-primary:hover { 
  background: var(--accent-hover);
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  color: #ffffff !important;
}
.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.15s ease;
}
.btn-secondary:hover { 
  background: var(--bg-secondary);
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}
a.btn { text-decoration: none; justify-content: center; }
a.btn:hover { text-decoration: none; }
.btn-danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn-danger:hover { opacity: 0.9; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Forms ── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(17,17,17,0.08);
}

/* ── Cards ── */
.card {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

/* ── Hover Lift Effect ── */
.lift-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.lift-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

/* ── Hero (Landing) ── */
.hero {
  text-align: center;
  padding: 80px 0 60px;
}
.hero h1 {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1.1;
  margin-bottom: 16px;
}
.hero p {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 16px;
}
.hero-badges { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-secondary);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.badge:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

/* ── Pricing ── */
.pricing-section { padding: 60px 0; }
.pricing-section h2 { text-align: center; font-size: 32px; margin-bottom: 40px; }
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}
.pricing-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.pricing-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}
.pricing-card.featured {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
}
.pricing-card.featured:hover {
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.18);
}
.pricing-card .plan-name {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.pricing-card .price {
  font-size: 40px;
  font-weight: 700;
  margin-bottom: 4px;
}
.pricing-card .price-period { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }
.pricing-card ul {
  list-style: none;
  text-align: left;
  margin-bottom: 24px;
}
.pricing-card li {
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
}
.pricing-card li:last-child { border-bottom: none; }
.pricing-card li::before { content: "✓ "; font-weight: 600; color: var(--text); }

/* ── Auth Forms ── */
.auth-section {
  max-width: 420px;
  margin: 60px auto;
  padding: 0 24px;
}
.auth-section h2 { font-size: 24px; margin-bottom: 24px; text-align: center; }
.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.auth-tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--font);
}
.auth-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--red);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
}
.auth-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #16a34a;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
}

/* ── Dashboard ── */
.dashboard { display: grid; grid-template-columns: 300px 1fr; min-height: calc(100vh - 57px); }
.sidebar {
  border-right: 1px solid var(--border-light);
  padding: 20px;
  overflow-y: auto;
}
.main-content { padding: 24px; overflow-y: auto; }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.sidebar-header h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }

/* ── Monitor List ── */
.monitor-list { display: flex; flex-direction: column; gap: 4px; }
.monitor-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.1s;
}
.monitor-item:hover { background: var(--bg-secondary); }
.monitor-item.active { background: var(--bg-tertiary); }
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.green { background: var(--green); }
.status-dot.yellow { background: var(--yellow); }
.status-dot.red { background: var(--red); }
.status-dot.gray { background: var(--text-muted); }
.monitor-info { flex: 1; min-width: 0; }
.monitor-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.monitor-url {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.monitor-diff {
  font-size: 12px;
  font-weight: 600;
  font-family: var(--mono);
}

/* ── Add Monitor Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.modal {
  background: var(--bg);
  border-radius: 12px;
  padding: 32px;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
.modal h3 { font-size: 18px; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ── Timeline ── */
.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}
.timeline-header h2 { font-size: 20px; }
.timeline-meta { font-size: 13px; color: var(--text-muted); }

.timeline { display: flex; flex-direction: column; gap: 12px; }
.timeline-entry {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
}
.timeline-entry:hover { border-color: var(--border); box-shadow: var(--shadow); }
.timeline-thumb {
  width: 80px;
  height: 50px;
  border-radius: 4px;
  background: var(--bg-tertiary);
  overflow: hidden;
  flex-shrink: 0;
}
.timeline-thumb img { width: 100%; height: 100%; object-fit: cover; }
.timeline-details { flex: 1; }
.timeline-time { font-size: 13px; color: var(--text-muted); }
.timeline-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
}
.timeline-status.changed { color: var(--red); }
.timeline-status.no-change { color: var(--green); }
.timeline-status.error { color: var(--yellow); }
.timeline-score {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--mono);
  flex-shrink: 0;
}

/* ── Diff Viewer ── */
.diff-viewer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 24px;
}
.diff-pane { border: 1px solid var(--border-light); border-radius: var(--radius); overflow: hidden; }
.diff-pane-header {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-light);
}
.diff-pane img { width: 100%; display: block; }
.diff-toggle {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* ── Diff Slider ── */
.diff-slider-container { position: relative; overflow: hidden; border: 1px solid var(--border-light); border-radius: var(--radius); }
.diff-slider-container img { width: 100%; display: block; }
.diff-slider-overlay { position: absolute; top: 0; left: 0; width: 50%; height: 100%; overflow: hidden; }
.diff-slider-overlay img { width: 100%; position: absolute; top: 0; left: 0; min-width: 100%; }
.diff-slider-overlay::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 3px;
  height: 100%;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(0,0,0,0.3);
  z-index: 5;
}
.diff-slider-handle { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; z-index: 10; margin: 0; }

/* ── Diff Flip ── */
.diff-flip-container { position: relative; border: 1px solid var(--border-light); border-radius: var(--radius); overflow: hidden; cursor: pointer; }
.diff-flip-container img { width: 100%; display: block; transition: opacity 0.3s; }
.diff-flip-label { position: absolute; top: 12px; right: 12px; background: rgba(0,0,0,0.7); color: #fff; padding: 4px 10px; border-radius: 4px; font-size: 12px; pointer-events: none; }

/* ── Timeline Summary ── */
.timeline-summary { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Account ── */
.account-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.stat-card {
  padding: 20px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
}
.stat-value { font-size: 32px; font-weight: 700; font-family: var(--mono); }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.api-key-display {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--bg-secondary);
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  word-break: break-all;
}

/* ── Metadata Panel ── */
.metadata-card { border: 1px solid var(--border-light); border-radius: var(--radius); padding: 16px 20px; }
.metadata-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; }
.metadata-item { display: flex; flex-direction: column; gap: 2px; }
.metadata-item.full-width { grid-column: 1 / -1; }
.metadata-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); font-weight: 500; }
.metadata-value { font-size: 13px; color: var(--text); word-break: break-word; }
.metadata-value.mono { font-family: var(--mono); }
.metadata-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.metadata-badge { padding: 2px 8px; background: var(--bg-secondary); border: 1px solid var(--border-light); border-radius: 4px; font-size: 12px; }

/* ── SEO Analysis Panel ── */
.seo-section { margin-bottom: 16px; }
.seo-section-header { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.seo-grade { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 11px; font-weight: 600; }
.seo-grade.good { background: #dcfce7; color: #16a34a; }
.seo-grade.warn { background: #fef9c3; color: #a16207; }
.seo-grade.bad { background: #fee2e2; color: #dc2626; }
.seo-findings { display: flex; flex-direction: column; gap: 4px; }
.seo-finding { font-size: 12px; color: var(--text-secondary); padding: 4px 0; display: flex; align-items: flex-start; gap: 6px; }
.seo-finding .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.seo-finding .dot.green { background: #22c55e; }
.seo-finding .dot.yellow { background: #eab308; }
.seo-finding .dot.red { background: #ef4444; }
.seo-schemas { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.seo-schema-badge { padding: 2px 8px; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 4px; font-size: 11px; color: #1d4ed8; }

/* ── SEO Popup ── */
.seo-popup { background: var(--bg); border-radius: 12px; max-width: 600px; width: 90%; max-height: 80vh; display: flex; flex-direction: column; box-shadow: 0 8px 32px rgba(0,0,0,0.15); }
.seo-popup-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border-light); }
.seo-popup-header h3 { font-size: 16px; }
.seo-close-btn { background: none; border: none; font-size: 24px; color: var(--text-muted); cursor: pointer; padding: 0 4px; line-height: 1; }
.seo-close-btn:hover { color: var(--text); }
.seo-popup-body { padding: 20px; overflow-y: auto; }

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state h3 { font-size: 18px; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 14px; margin-bottom: 20px; }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ── AI Analysis Labels ── */
.ai-label { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; margin: 2px; }
.ai-label.high { background: #dcfce7; color: #16a34a; }
.ai-label.medium { background: #fef9c3; color: #a16207; }

/* ── OCR Text Block ── */
.ocr-block { background: var(--bg-secondary); border: 1px solid var(--border-light); border-radius: 6px; padding: 10px; font-family: var(--mono); font-size: 11px; max-height: 200px; overflow-y: auto; white-space: pre-wrap; margin-top: 4px; }

/* ── Text Diff Block ── */
.text-diff-block { background: var(--bg-secondary); border: 1px solid var(--border-light); border-radius: 6px; padding: 8px 10px; font-family: var(--mono); font-size: 11px; max-height: 250px; overflow-y: auto; margin-top: 4px; }
.text-diff-added { color: #16a34a; padding: 2px 0; border-left: 3px solid #22c55e; padding-left: 8px; margin: 2px 0; white-space: pre-wrap; word-break: break-word; }
.text-diff-removed { color: #dc2626; padding: 2px 0; border-left: 3px solid #ef4444; padding-left: 8px; margin: 2px 0; white-space: pre-wrap; word-break: break-word; text-decoration: line-through; opacity: 0.8; }

/* ── AI Upsell Note ── */
.ai-upsell { font-size: 12px; color: var(--text-muted); padding: 12px; text-align: center; border: 1px dashed var(--border); border-radius: 6px; margin-bottom: 16px; }

/* ── Sitemap URL List ── */
.sitemap-url-list { max-height: 200px; overflow-y: auto; margin-top: 4px; }
.sitemap-url { font-family: var(--mono); font-size: 11px; padding: 3px 0; word-break: break-all; }
.sitemap-url.added { color: #16a34a; }
.sitemap-url.added::before { content: "+ "; font-weight: 600; }
.sitemap-url.removed { color: #dc2626; text-decoration: line-through; opacity: 0.8; }
.sitemap-url.removed::before { content: "- "; font-weight: 600; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .pricing-grid { grid-template-columns: 1fr !important; }
  .dashboard { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--border-light); max-height: 300px; }
  .hero h1 { font-size: 32px; }
  .diff-viewer { grid-template-columns: 1fr; }
  .account-grid { grid-template-columns: 1fr; }
}
