:root {
  --bg: #0a0e1a;
  --surface: #111827;
  --surface2: #1a2235;
  --border: #1e293b;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --accent: #06b6d4;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
}

* { margin:0; padding:0; box-sizing:border-box; }
body { font-family: 'Inter', -apple-system, system-ui, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

/* Landing */
.hero { text-align: center; padding: 100px 20px 60px; max-width: 900px; margin: 0 auto; }
.hero h1 { font-size: 3.2rem; font-weight: 800; line-height: 1.1; margin-bottom: 24px; background: linear-gradient(135deg, #fff 0%, #3b82f6 50%, #06b6d4 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero .subtitle { font-size: 1.3rem; color: var(--muted); margin-bottom: 40px; }
.hero .cta-group { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 28px; border-radius: 8px; font-size: 1rem; font-weight: 600; border: none; cursor: pointer; transition: all 0.2s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.9; }
.btn-success { background: var(--success); color: #fff; }

nav { display: flex; justify-content: space-between; align-items: center; padding: 20px 40px; max-width: 1200px; margin: 0 auto; }
nav .logo { font-size: 1.4rem; font-weight: 800; color: #fff; display: flex; align-items: center; gap: 8px; }
nav .logo span { color: var(--accent); }
nav .nav-links { display: flex; gap: 24px; align-items: center; }

/* Comparison */
.compare { padding: 60px 20px; max-width: 1000px; margin: 0 auto; }
.compare h2 { text-align: center; font-size: 2rem; margin-bottom: 40px; }
.compare-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.compare-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 28px; text-align: center; }
.compare-card.highlight { border-color: var(--primary); box-shadow: 0 0 30px rgba(59,130,246,0.15); }
.compare-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.compare-card .price { font-size: 2rem; font-weight: 800; margin-bottom: 4px; }
.compare-card .price.strike { text-decoration: line-through; color: var(--muted); font-size: 1.3rem; }
.compare-card .price.ours { color: var(--success); }
.compare-card .period { color: var(--muted); font-size: 0.9rem; }

/* Pricing */
.pricing { padding: 80px 20px; max-width: 1000px; margin: 0 auto; }
.pricing h2 { text-align: center; font-size: 2rem; margin-bottom: 48px; }
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.pricing-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 36px; }
.pricing-card.featured { border-color: var(--primary); position: relative; }
.pricing-card.featured::before { content: 'Most Popular'; position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff; padding: 4px 16px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; }
.pricing-card h3 { font-size: 1.3rem; margin-bottom: 8px; }
.pricing-card .price { font-size: 2.5rem; font-weight: 800; }
.pricing-card .price span { font-size: 1rem; font-weight: 400; color: var(--muted); }
.pricing-card ul { list-style: none; margin: 24px 0; }
.pricing-card li { padding: 8px 0; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.pricing-card li::before { content: '✓'; color: var(--success); font-weight: 700; }

/* Features */
.features { padding: 60px 20px; max-width: 1000px; margin: 0 auto; }
.features h2 { text-align: center; font-size: 2rem; margin-bottom: 40px; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 28px; }
.feature-card h3 { margin-bottom: 8px; font-size: 1.1rem; }
.feature-card p { color: var(--muted); font-size: 0.95rem; }
.feature-icon { font-size: 2rem; margin-bottom: 12px; }

footer { text-align: center; padding: 40px 20px; color: var(--muted); border-top: 1px solid var(--border); margin-top: 60px; }

/* Auth */
.auth-container { max-width: 420px; margin: 80px auto; padding: 20px; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 40px; }
.auth-card h2 { margin-bottom: 24px; text-align: center; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 0.9rem; color: var(--muted); }
.form-group input, .form-group textarea { width: 100%; padding: 10px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 1rem; }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); }
.auth-card .btn { width: 100%; justify-content: center; margin-top: 8px; }
.auth-toggle { text-align: center; margin-top: 16px; color: var(--muted); }
.error-msg { background: rgba(239,68,68,0.1); border: 1px solid var(--danger); color: var(--danger); padding: 10px; border-radius: 6px; margin-bottom: 16px; font-size: 0.9rem; display: none; }

/* App Dashboard */
.app-layout { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: var(--surface); border-right: 1px solid var(--border); padding: 20px 0; flex-shrink: 0; }
.sidebar .logo { padding: 0 20px 24px; font-size: 1.2rem; font-weight: 800; }
.sidebar .logo span { color: var(--accent); }
.sidebar-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 20px; color: var(--muted); font-size: 0.95rem; transition: all 0.2s; }
.sidebar-nav a:hover, .sidebar-nav a.active { color: var(--text); background: var(--surface2); }
.sidebar-bottom { margin-top: auto; padding: 20px; border-top: 1px solid var(--border); }
.plan-badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }
.plan-free { background: rgba(148,163,184,0.2); color: var(--muted); }
.plan-pro { background: rgba(59,130,246,0.2); color: var(--primary); }
.plan-business { background: rgba(6,182,212,0.2); color: var(--accent); }

.main-content { flex: 1; padding: 32px; overflow-y: auto; }
.page-header { margin-bottom: 32px; }
.page-header h1 { font-size: 1.8rem; margin-bottom: 4px; }
.page-header p { color: var(--muted); }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 20px; }
.stat-card .stat-value { font-size: 2rem; font-weight: 800; }
.stat-card .stat-label { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 24px; margin-bottom: 20px; }
.card h3 { margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; }

.competitor-item { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--border); }
.competitor-item:last-child { border-bottom: none; }
.competitor-info h4 { font-size: 0.95rem; margin-bottom: 2px; }
.competitor-info .url { color: var(--muted); font-size: 0.8rem; }
.competitor-info .last-check { color: var(--muted); font-size: 0.75rem; }
.competitor-actions { display: flex; gap: 8px; }

.change-card { background: var(--surface2); border-radius: 8px; padding: 16px; margin-bottom: 12px; border-left: 3px solid var(--warning); }
.change-card .change-header { display: flex; justify-content: space-between; margin-bottom: 8px; }
.change-card .change-comp { font-weight: 600; }
.change-card .change-date { color: var(--muted); font-size: 0.8rem; }
.change-card .change-summary { color: var(--muted); font-size: 0.9rem; line-height: 1.5; }

.add-form { display: flex; gap: 10px; margin-bottom: 20px; }
.add-form input { flex: 1; padding: 10px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; color: var(--text); }
.add-form input:focus { outline: none; border-color: var(--primary); }

.tab-nav { display: flex; gap: 0; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.tab-nav button { background: none; border: none; color: var(--muted); padding: 12px 20px; cursor: pointer; font-size: 0.95rem; border-bottom: 2px solid transparent; transition: all 0.2s; }
.tab-nav button:hover { color: var(--text); }
.tab-nav button.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

.analysis-result { background: var(--surface2); border-radius: 8px; padding: 20px; margin-top: 16px; white-space: pre-wrap; line-height: 1.6; color: var(--muted); }

.loading { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }

@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .app-layout { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .sidebar-nav { display: flex; overflow-x: auto; }
  .sidebar-nav a { white-space: nowrap; }
  nav { padding: 16px 20px; }
  .compare-grid { grid-template-columns: 1fr 1fr; }
}
