/* frontend/css/style.css */

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-card: #161616;
  --bg-hover: #1a1a1a;
  --text-primary: #f0f0f0;
  --text-secondary: #888888;
  --text-muted: #555555;
  --accent: #ffffff;
  --accent-dim: #cccccc;
  --border: #222222;
  --success: #22c55e;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --max-width: 1080px;
  --radius: 6px;
}

html { font-size: 16px; }
body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

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

/* === Layout === */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.page { padding: 80px 0 120px; }

/* === Typography === */
h1 { font-size: 2.5rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
h2 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }
h3 { font-size: 1.125rem; font-weight: 600; }
.tagline { color: var(--text-secondary); font-size: 1.125rem; line-height: 1.5; max-width: 560px; }
.mono { font-family: var(--font-mono); font-size: 0.875rem; }

/* === Nav === */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(10, 10, 10, 0.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
nav .container { display: flex; justify-content: space-between; align-items: center; }
nav .logo { font-weight: 700; font-size: 1.125rem; letter-spacing: -0.02em; }
nav .links { display: flex; gap: 24px; }
nav .links a { color: var(--text-secondary); font-size: 0.875rem; }
nav .links a:hover { color: var(--text-primary); }

/* === Product Grid === */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}
.product-card:hover { border-color: #333; background: var(--bg-hover); }
.product-card .name { font-weight: 600; margin-bottom: 8px; }
.product-card .tagline { color: var(--text-secondary); font-size: 0.875rem; margin-bottom: 16px; }
.product-card .price { font-family: var(--font-mono); font-weight: 600; }

/* === Buttons === */
.btn {
  display: inline-block;
  padding: 12px 28px;
  font-weight: 600;
  font-size: 0.9375rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn:hover { opacity: 0.85; }
.btn-primary { background: var(--accent); color: var(--bg-primary); }
.btn-secondary { background: transparent; color: var(--accent); border: 1px solid var(--border); }

/* === Product Page === */
.product-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.product-hero .info h1 { margin-bottom: 16px; }
.product-hero .info .price { font-family: var(--font-mono); font-size: 2rem; font-weight: 700; margin: 24px 0; }
.product-hero .info .buy-form { display: flex; gap: 12px; align-items: center; margin-top: 24px; }
.product-hero .info .buy-form input {
  background: var(--bg-secondary); border: 1px solid var(--border);
  color: var(--text-primary); padding: 12px 16px; border-radius: var(--radius);
  font-size: 0.9375rem; width: 240px;
}
.product-hero .info .buy-form input::placeholder { color: var(--text-muted); }
.product-details { margin-top: 64px; }
.product-details h2 { margin-bottom: 16px; }
.product-details .description { color: var(--text-secondary); line-height: 1.8; }

/* === Dashboard === */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 48px; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.stat-card .label { color: var(--text-secondary); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-card .value { font-family: var(--font-mono); font-size: 2rem; font-weight: 700; margin-top: 8px; }

.chart-container {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; margin-bottom: 48px;
}

/* === Blog === */
.blog-list { display: flex; flex-direction: column; gap: 16px; }
.blog-item {
  padding: 20px 0; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: baseline;
}
.blog-item .title { font-weight: 600; }
.blog-item .date { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.8125rem; }

/* === Footer === */
footer {
  border-top: 1px solid var(--border);
  padding: 48px 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
  text-align: center;
}

/* === Responsive === */
@media (max-width: 768px) {
  h1 { font-size: 1.75rem; }
  .product-hero { grid-template-columns: 1fr; gap: 32px; }
  .stats-grid { grid-template-columns: 1fr; }
  nav .links { gap: 16px; }
}
