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

:root {
  --bg: #f5f6f8;
  --bg-card: #ffffff;
  --bg-card-hover: #fafbfc;
  --bg-sidebar: #ffffff;
  --border: #e8eaed;
  --border-hover: #d1d5db;
  --border-subtle: #f0f1f3;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-light: #eef2ff;
  --accent-glow: rgba(79,70,229,0.08);
  --green: #059669;
  --green-light: #ecfdf5;
  --orange: #d97706;
  --orange-light: #fffbeb;
  --red: #dc2626;
  --red-light: #fef2f2;
  --blue: #2563eb;
  --blue-light: #eff6ff;
  --purple: #7c3aed;
  --purple-light: #f5f3ff;
  --radius: 14px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.03);
  --shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.02);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.03);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; }
body {
  font-family:'Inter',system-ui,-apple-system,sans-serif;
  background:var(--bg); color:var(--text); line-height:1.5; min-height:100vh;
  -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale;
}

/* ─── Layout ─── */
.app { display:flex; min-height:100vh; }

/* ─── Sidebar ─── */
.sidebar {
  width:240px; background:var(--bg-sidebar); border-right:1px solid var(--border);
  padding:24px 14px; display:flex; flex-direction:column; gap:2px;
  position:fixed; top:0; left:0; bottom:0; z-index:10;
}
.sidebar-brand {
  font-size:16px; font-weight:800; color:var(--accent); letter-spacing:-0.03em;
  padding:4px 12px 20px; display:flex; align-items:center; gap:8px;
}
.sidebar-brand span { color:var(--text-dim); font-weight:400; font-size:14px; }
.sidebar-brand::before {
  content:''; width:24px; height:24px; border-radius:7px;
  background:linear-gradient(135deg, var(--accent), #818cf8);
  flex-shrink:0;
}
.sidebar-section {
  font-size:10px; font-weight:700; color:var(--text-dim); text-transform:uppercase;
  letter-spacing:0.08em; padding:20px 12px 6px;
}
.sidebar-link {
  display:flex; align-items:center; gap:10px; padding:8px 12px; border-radius:var(--radius-sm);
  color:var(--text-muted); text-decoration:none; font-size:13px; font-weight:500;
  transition:all var(--transition); position:relative;
}
.sidebar-link:hover { color:var(--text); background:#f1f5f9; }
.sidebar-link.active {
  color:var(--accent); background:var(--accent-light); font-weight:600;
}
.sidebar-link.active::before {
  content:''; position:absolute; left:-14px; top:50%; transform:translateY(-50%);
  width:3px; height:20px; border-radius:0 3px 3px 0; background:var(--accent);
}
.sidebar-link .icon { width:18px; text-align:center; font-size:14px; opacity:0.7; }
.sidebar-link.active .icon { opacity:1; }
.sidebar-badge {
  margin-left:auto; background:var(--accent); color:#fff;
  font-size:10px; padding:2px 7px; border-radius:10px; font-weight:700;
  min-width:20px; text-align:center;
  animation:badgePop .4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.sidebar-footer {
  margin-top:auto; padding:12px; font-size:11px; color:var(--text-dim);
  border-top:1px solid var(--border-subtle);
}
.sidebar-footer .status-dot {
  width:6px; height:6px; border-radius:50%; background:var(--green); display:inline-block;
  margin-right:4px; animation:statusPulse 2s ease infinite;
}

/* ─── Main Content ─── */
.main { margin-left:240px; flex:1; padding:28px 36px; max-width:1440px; }

/* ─── Page Header ─── */
.page-header {
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom:28px;
}
.page-title {
  font-size:24px; font-weight:800; letter-spacing:-0.03em; color:var(--text);
}
.page-subtitle { font-size:13px; color:var(--text-muted); margin-top:3px; }

/* ─── Stats Row ─── */
.stats-row { display:grid; grid-template-columns:repeat(6, 1fr); gap:12px; margin-bottom:28px; }
.stat-pill {
  background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius);
  padding:18px 16px; text-align:center; position:relative; overflow:hidden;
  transition:all var(--transition);
}
.stat-pill::after {
  content:''; position:absolute; bottom:0; left:0; right:0; height:2px;
  background:transparent; transition:all var(--transition);
}
.stat-pill:hover {
  transform:translateY(-2px); box-shadow:var(--shadow-md);
  border-color:var(--border-hover);
}
.stat-pill:hover::after { background:currentColor; opacity:0.3; }
.stat-value {
  font-size:30px; font-weight:800; letter-spacing:-0.04em;
  color:var(--text); line-height:1;
}
.stat-label {
  font-size:10px; color:var(--text-dim); text-transform:uppercase;
  letter-spacing:0.06em; margin-top:6px; font-weight:600;
}
.stat-value.accent { color:var(--accent); }
.stat-value.green { color:var(--green); }
.stat-value.orange { color:var(--orange); }
.stat-value.blue { color:var(--blue); }
.stat-value.purple { color:var(--purple); }

/* ─── Filters ─── */
.filters-bar {
  display:flex; gap:6px; margin-bottom:20px; flex-wrap:wrap; align-items:center;
}
.filter-chip {
  padding:6px 14px; border-radius:20px; font-size:12px; font-weight:500;
  border:1px solid var(--border); background:var(--bg-card); color:var(--text-muted);
  cursor:pointer; transition:all var(--transition); text-decoration:none;
  user-select:none;
}
.filter-chip:hover { border-color:var(--border-hover); color:var(--text); background:#f8fafc; }
.filter-chip.active {
  background:var(--accent); border-color:var(--accent); color:#fff; font-weight:600;
  box-shadow:0 1px 3px rgba(79,70,229,0.25);
}
.filter-divider { width:1px; height:20px; background:var(--border); margin:0 4px; }
.filter-spacer { flex:1; }

/* ─── Data Table ─── */
.table-wrap {
  background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius);
  overflow:hidden; box-shadow:var(--shadow);
}
.data-table { width:100%; border-collapse:collapse; }
.data-table th {
  text-align:left; padding:11px 16px; font-size:10px; font-weight:700;
  color:var(--text-dim); text-transform:uppercase; letter-spacing:0.06em;
  border-bottom:1px solid var(--border); background:#fafbfd;
}
.data-table td { padding:14px 16px; font-size:13px; border-bottom:1px solid var(--border-subtle); }
.data-table tbody tr {
  transition:all var(--transition); cursor:pointer; position:relative;
}
.data-table tbody tr:hover {
  background:#f8fafc;
}
.data-table tbody tr:hover td:first-child::before {
  content:''; position:absolute; left:0; top:0; bottom:0; width:3px;
  background:var(--accent); border-radius:0 2px 2px 0;
}
.data-table tbody tr td:first-child { position:relative; }
.data-table tbody tr:last-child td { border-bottom:none; }

/* Table cell variants */
.cell-feature { max-width:300px; }
.cell-feature-name {
  font-weight:600; color:var(--text); display:block;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.cell-feature-page { font-size:11px; color:var(--text-dim); margin-top:1px; }
.cell-date { color:var(--text-dim); font-size:12px; white-space:nowrap; font-variant-numeric:tabular-nums; }
.cell-assigned { color:var(--text-muted); font-size:12px; }

/* ─── Badges ─── */
.badge {
  display:inline-flex; align-items:center; padding:3px 10px; border-radius:20px;
  font-size:10px; font-weight:700; letter-spacing:0.03em; text-transform:uppercase;
  white-space:nowrap;
}
.badge-functional { background:var(--accent-light); color:var(--accent); }
.badge-cosmetic { background:#f1f5f9; color:#64748b; }
.badge-content_update { background:var(--orange-light); color:var(--orange); }
.badge-large { background:var(--red-light); color:var(--red); }
.badge-medium { background:var(--orange-light); color:var(--orange); }
.badge-small { background:var(--green-light); color:var(--green); }
.badge-new { background:var(--accent-light); color:var(--accent); }
.badge-reviewing { background:var(--orange-light); color:var(--orange); }
.badge-approved { background:var(--green-light); color:var(--green); }
.badge-in_jira { background:var(--blue-light); color:var(--blue); }
.badge-dismissed { background:#f1f5f9; color:#94a3b8; }

.domain-dot {
  width:8px; height:8px; border-radius:50%; display:inline-block; margin-right:6px;
  box-shadow:0 0 0 2px rgba(0,0,0,0.04);
}
.domain-dot.otobus { background:var(--orange); }
.domain-dot.ucak { background:var(--blue); }
.domain-dot.arac { background:var(--green); }
.domain-dot.otel { background:var(--purple); }

/* ─── Buttons ─── */
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  padding:8px 16px; border-radius:var(--radius-sm); font-size:13px; font-weight:500;
  border:1px solid var(--border); background:var(--bg-card); color:var(--text-muted);
  cursor:pointer; transition:all var(--transition); text-decoration:none;
  font-family:inherit; line-height:1;
}
.btn:hover { border-color:var(--border-hover); color:var(--text); background:#f8fafc; box-shadow:var(--shadow-sm); }
.btn:active { transform:scale(0.97); }
.btn-accent {
  background:var(--accent); border-color:var(--accent); color:#fff;
  box-shadow:0 1px 3px rgba(79,70,229,0.25);
}
.btn-accent:hover { background:var(--accent-hover); box-shadow:0 2px 6px rgba(79,70,229,0.3); }
.btn-sm { padding:5px 12px; font-size:12px; }
.btn-ghost { border:none; box-shadow:none; background:transparent; }
.btn-ghost:hover { background:#f1f5f9; }
.btn-danger { color:var(--red); border-color:rgba(220,38,38,0.15); }
.btn-danger:hover { background:var(--red-light); border-color:rgba(220,38,38,0.3); }
.btn-green { background:var(--green); border-color:var(--green); color:#fff; }
.btn-green:hover { background:#047857; }

/* ─── Detail Page ─── */
.detail-grid { display:grid; grid-template-columns:1fr 360px; gap:24px; }
.detail-main { display:flex; flex-direction:column; gap:20px; }
.detail-sidebar { display:flex; flex-direction:column; gap:14px; }

.card {
  background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius);
  padding:20px; transition:all var(--transition);
}
.card:hover { box-shadow:var(--shadow); }
.card-header {
  font-size:11px; font-weight:700; color:var(--text-dim); text-transform:uppercase;
  letter-spacing:0.06em; margin-bottom:14px;
  display:flex; align-items:center; gap:6px;
}
.card-header::before {
  content:''; width:3px; height:12px; border-radius:2px; background:var(--accent);
}
.card-body { font-size:14px; line-height:1.7; color:var(--text); }
.card-body p { margin-bottom:8px; }
.card-body p:last-child { margin-bottom:0; }

/* ─── Agent Cards ─── */
.agent-card {
  background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius);
  padding:20px; position:relative; overflow:hidden; transition:all var(--transition);
}
.agent-card:hover { box-shadow:var(--shadow-md); }
.agent-card::before {
  content:''; position:absolute; top:0; left:0; right:0; height:3px;
}
.agent-card.competitor::before { background:linear-gradient(90deg, var(--orange), var(--orange-light)); }
.agent-card.strategy::before { background:linear-gradient(90deg, var(--purple), var(--purple-light)); }
.agent-card.prd::before { background:linear-gradient(90deg, var(--blue), var(--blue-light)); }

.agent-header {
  display:flex; align-items:center; justify-content:space-between; margin-bottom:14px;
}
.agent-name { font-size:14px; font-weight:700; color:var(--text); }
.agent-icon { font-size:16px; margin-right:6px; }
.agent-body { font-size:13px; line-height:1.8; color:var(--text-muted); }
.agent-body strong { color:var(--text); font-weight:600; }
.agent-body .field { margin-bottom:10px; }
.agent-body .field:last-child { margin-bottom:0; }
.agent-body .field-label {
  font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:0.06em;
  color:var(--text-dim); margin-bottom:2px;
}
.agent-body .field-value { color:var(--text); }
.agent-loading { color:var(--text-dim); font-style:italic; font-size:13px; }
.agent-loading::before { content:''; display:inline-block; width:12px; height:12px; border:2px solid var(--border); border-top-color:var(--accent); border-radius:50%; animation:spin .8s linear infinite; margin-right:8px; vertical-align:middle; }

/* PRD Card special */
.prd-preview {
  margin-top:12px; padding:16px; border-radius:var(--radius-sm);
  background:linear-gradient(135deg, rgba(37,99,235,0.04), rgba(79,70,229,0.04));
  border:1px solid rgba(37,99,235,0.12);
}
.prd-preview-title { font-weight:700; font-size:14px; color:var(--text); margin-bottom:10px; }

/* ─── Screenshot Comparison ─── */
.screenshot-compare { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.screenshot-item { position:relative; }
.screenshot-item img {
  width:100%; border-radius:var(--radius-sm); border:1px solid var(--border);
  transition:transform var(--transition);
}
.screenshot-item img:hover { transform:scale(1.02); }
.screenshot-label {
  font-size:10px; color:var(--text-dim); text-transform:uppercase;
  letter-spacing:0.06em; margin-bottom:6px; font-weight:700;
  display:flex; align-items:center; gap:6px;
}
.screenshot-label.before::before { content:''; width:8px; height:3px; border-radius:2px; background:var(--red); }
.screenshot-label.after::before { content:''; width:8px; height:3px; border-radius:2px; background:var(--green); }

/* ─── Assign ─── */
.assign-select {
  width:100%; background:var(--bg-card); border:1px solid var(--border);
  border-radius:var(--radius-sm); color:var(--text); padding:9px 12px;
  font-size:13px; font-family:inherit; cursor:pointer;
  transition:border-color var(--transition);
  appearance:none; -webkit-appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 12px center;
}
.assign-select:hover { border-color:var(--border-hover); }
.assign-select:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 3px rgba(79,70,229,0.1); }

/* ─── Status Flow ─── */
.status-flow { display:flex; gap:6px; flex-wrap:wrap; }

/* ─── Notes ─── */
.notes-textarea {
  width:100%; background:#fafbfc; border:1px solid var(--border);
  border-radius:var(--radius-sm); color:var(--text); padding:10px 14px;
  font-size:13px; font-family:inherit; resize:vertical; min-height:80px;
  transition:all var(--transition);
}
.notes-textarea:hover { border-color:var(--border-hover); }
.notes-textarea:focus { outline:none; border-color:var(--accent); background:var(--bg-card); box-shadow:0 0 0 3px rgba(79,70,229,0.08); }

/* ─── Info Grid ─── */
.info-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.info-item { font-size:13px; }
.info-label { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:0.06em; color:var(--text-dim); margin-bottom:1px; }
.info-value { color:var(--text); font-weight:500; }

/* ─── Empty State ─── */
.empty-state { text-align:center; padding:80px 40px; }
.empty-icon {
  width:80px; height:80px; margin:0 auto 20px; border-radius:50%;
  background:linear-gradient(135deg, var(--accent-light), var(--purple-light));
  display:flex; align-items:center; justify-content:center;
  font-size:32px;
  animation:float 3s ease-in-out infinite;
}
.empty-title { font-size:18px; font-weight:700; color:var(--text); margin-bottom:8px; }
.empty-desc { font-size:14px; color:var(--text-muted); max-width:400px; margin:0 auto; line-height:1.6; }
.empty-actions { margin-top:20px; display:flex; gap:10px; justify-content:center; }

/* ─── Toast / Notification ─── */
.toast {
  position:fixed; bottom:24px; right:24px; padding:12px 20px;
  background:var(--text); color:#fff; border-radius:var(--radius-sm);
  font-size:13px; font-weight:500; box-shadow:var(--shadow-lg);
  z-index:100; animation:slideUp .3s ease, fadeOut .3s ease 2.5s forwards;
}

/* ─── Crawl Progress ─── */
.crawl-progress {
  position:fixed; top:0; left:240px; right:0; height:3px; z-index:20;
  background:var(--border-subtle);
}
.crawl-progress-bar {
  height:100%; width:0;
  background:linear-gradient(90deg, var(--accent), var(--blue));
  border-radius:0 3px 3px 0;
  transition:width 1s ease;
}
.crawl-progress.active .crawl-progress-bar {
  animation:progressIndeterminate 1.5s ease-in-out infinite;
}

/* ─── Responsive ─── */
@media (max-width:1200px) {
  .stats-row { grid-template-columns:repeat(3, 1fr); }
}
@media (max-width:1024px) {
  .sidebar { display:none; }
  .main { margin-left:0; padding:20px 16px; }
  .detail-grid { grid-template-columns:1fr; }
  .screenshot-compare { grid-template-columns:1fr; }
  .stats-row { grid-template-columns:repeat(2, 1fr); }
  .crawl-progress { left:0; }
}
@media (max-width:640px) {
  .stats-row { grid-template-columns:1fr 1fr; }
  .page-header { flex-direction:column; align-items:flex-start; gap:12px; }
}

/* ─── Animations ─── */
@keyframes fadeIn { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:none} }
.fade-in { animation:fadeIn .4s cubic-bezier(0.4, 0, 0.2, 1); }

@keyframes slideUp { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:none} }
@keyframes fadeOut { to{opacity:0;transform:translateY(-10px)} }

@keyframes spin { to{transform:rotate(360deg)} }

@keyframes float {
  0%,100% { transform:translateY(0) }
  50% { transform:translateY(-8px) }
}

@keyframes badgePop {
  0% { transform:scale(0) }
  80% { transform:scale(1.1) }
  100% { transform:scale(1) }
}

@keyframes statusPulse {
  0%,100% { opacity:1; box-shadow:0 0 0 0 rgba(5,150,105,0.4) }
  50% { opacity:1; box-shadow:0 0 0 4px rgba(5,150,105,0) }
}

@keyframes progressIndeterminate {
  0% { width:0; margin-left:0 }
  50% { width:60% }
  100% { width:0; margin-left:100% }
}

/* Staggered animation for table rows */
.data-table tbody tr { animation:fadeIn .3s ease backwards; }
.data-table tbody tr:nth-child(1) { animation-delay:.05s }
.data-table tbody tr:nth-child(2) { animation-delay:.1s }
.data-table tbody tr:nth-child(3) { animation-delay:.15s }
.data-table tbody tr:nth-child(4) { animation-delay:.2s }
.data-table tbody tr:nth-child(5) { animation-delay:.25s }
.data-table tbody tr:nth-child(6) { animation-delay:.3s }
.data-table tbody tr:nth-child(7) { animation-delay:.35s }
.data-table tbody tr:nth-child(8) { animation-delay:.4s }
.data-table tbody tr:nth-child(9) { animation-delay:.45s }
.data-table tbody tr:nth-child(10) { animation-delay:.5s }

/* Stagger for agent cards */
.agent-card:nth-of-type(1) { animation:fadeIn .4s ease .1s backwards; }
.agent-card:nth-of-type(2) { animation:fadeIn .4s ease .2s backwards; }
.agent-card:nth-of-type(3) { animation:fadeIn .4s ease .3s backwards; }

.pulse { animation:pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }
