@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg: #06060a;
  --surface: rgba(255,255,255,0.04);
  --glass: rgba(255,255,255,0.06);
  --glass-border: rgba(255,255,255,0.08);
  --glass-hover: rgba(255,255,255,0.10);
  --text: #e4e4e7;
  --text-muted: #71717a;
  --text-dim: #52525b;
  --accent: #6366f1;
  --accent2: #8b5cf6;
  --cyan: #06b6d4;
  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;
  --orange: #f97316;
  --pink: #ec4899;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Animated background */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 20% 50%, rgba(99,102,241,0.08) 0%, transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(139,92,246,0.06) 0%, transparent 50%),
              radial-gradient(circle at 50% 80%, rgba(6,182,212,0.05) 0%, transparent 50%);
  animation: bgShift 30s ease-in-out infinite;
  z-index: -1;
}

@keyframes bgShift {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(-2%, 1%); }
  66% { transform: translate(1%, -2%); }
}

h1, h2, h3, h4 { font-family: 'Space Grotesk', sans-serif; }

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

/* Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.header {
  padding: 48px 0 32px;
  text-align: center;
}

.header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.header .subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 32px;
}

/* Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 20px 24px;
  text-align: center;
  transition: all 0.3s ease;
}

.stat-card:hover {
  background: var(--glass-hover);
  border-color: rgba(99,102,241,0.2);
  box-shadow: 0 0 30px rgba(99,102,241,0.08);
}

.stat-card .stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
}

.stat-card .stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Filters */
.filters-bar {
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-group select,
.filter-group input {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text);
  padding: 8px 12px;
  font-size: 0.85rem;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  min-width: 130px;
  transition: border-color 0.2s;
}

.filter-group select:focus,
.filter-group input:focus {
  border-color: var(--accent);
}

.filter-group select option {
  background: #1a1a2e;
  color: var(--text);
}

.filter-reset {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 8px;
  color: var(--red);
  padding: 8px 16px;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: 'DM Sans', sans-serif;
  margin-left: auto;
  transition: all 0.2s;
  align-self: flex-end;
}

.filter-reset:hover {
  background: rgba(239,68,68,0.2);
}

/* Layout */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  margin-bottom: 48px;
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.creative-card {
  background: #12121a;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
  padding: 16px;
}

.creative-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99,102,241,0.3);
  box-shadow: 0 8px 40px rgba(99,102,241,0.12);
}

.creative-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.creative-card .card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: #fff;
}

.days-badge {
  background: rgba(0,0,0,0.5);
  border-radius: 8px;
  padding: 4px 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
}

.days-green { color: var(--green); }
.days-yellow { color: var(--yellow); }
.days-gray { color: var(--text-muted); }

.creative-card .card-publisher {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.creative-card .card-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.creative-card .card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 12px;
}

.tag {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 500;
  border: 1px solid transparent;
}

.tag-genre { background: rgba(99,102,241,0.15); color: #818cf8; }
.tag-setting { background: rgba(6,182,212,0.15); color: #22d3ee; }
.tag-hook { background: rgba(249,115,22,0.15); color: #fb923c; }
.tag-style { background: rgba(139,92,246,0.15); color: #a78bfa; }
.tag-gameplay { background: rgba(236,72,153,0.15); color: #f472b6; }
.tag-fake { background: rgba(239,68,68,0.2); color: #f87171; font-weight: 600; }
.tag-active { background: rgba(34,197,94,0.15); color: #4ade80; }
.tag-inactive { background: rgba(113,113,122,0.15); color: #a1a1aa; }
.tag-platform { background: rgba(255,255,255,0.05); color: #a1a1aa; border-color: rgba(255,255,255,0.1); font-size: 0.6rem; }

.creative-card .card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-dim);
  gap: 8px;
}

.creative-card .card-link {
  color: var(--accent);
  font-weight: 500;
  white-space: nowrap;
}

.platform-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
}

.platform-dot.fb { background: #1877f2; }
.platform-dot.ig { background: #e4405f; }
.platform-dot.msg { background: #0084ff; }
.platform-dot.an { background: var(--text-dim); }

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-card {
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 20px;
}

.sidebar-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

.longevity-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.85rem;
}

.longevity-item:last-child { border-bottom: none; }

.longevity-item .name { color: var(--text); }
.longevity-item .days {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
}

.trend-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 0.85rem;
}

.trend-item .trend-name { color: var(--text); }
.trend-item .trend-change {
  font-weight: 600;
  font-size: 0.8rem;
}

.trend-up { color: var(--green); }
.trend-down { color: var(--red); }
.trend-flat { color: var(--text-dim); }

/* Charts section */
.charts-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 48px;
}

.chart-card {
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 24px;
}

.chart-card h3 {
  font-size: 1rem;
  margin-bottom: 16px;
}

.chart-card canvas {
  width: 100% !important;
  max-height: 280px;
}

/* Fake Gameplay Insight */
.insight-card {
  background: linear-gradient(135deg, rgba(239,68,68,0.08), rgba(249,115,22,0.06));
  border: 1px solid rgba(239,68,68,0.15);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 48px;
}

.insight-card h3 {
  color: var(--orange);
  margin-bottom: 12px;
}

.insight-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.insight-stat {
  text-align: center;
}

.insight-stat .val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--orange);
}

.insight-stat .lbl {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Results count */
.results-info {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Footer */
.footer {
  text-align: center;
  padding: 32px 0;
  color: var(--text-dim);
  font-size: 0.8rem;
  border-top: 1px solid var(--glass-border);
}

/* No results */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}

.no-results .emoji { font-size: 3rem; margin-bottom: 16px; }
.no-results p { font-size: 1.1rem; }

/* Responsive */
@media (max-width: 1024px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
}

@media (max-width: 768px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .charts-section { grid-template-columns: 1fr; }
  .filters-bar { flex-direction: column; }
  .filter-group select, .filter-group input { min-width: 100%; }
  .header h1 { font-size: 1.8rem; }
  .sidebar { grid-template-columns: 1fr; }
  .insight-stats { grid-template-columns: 1fr; }
  .cards-grid { grid-template-columns: 1fr; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
