/* =============================================================================
   Agent Memory — Style (basé sur hashlock-algo/style.css)
   ============================================================================= */

:root {
  --bg:         #0d1117;
  --bg-card:    #161b22;
  --bg-card2:   #1c2128;
  --border:     #30363d;
  --text:       #e6edf3;
  --text-muted: #8b949e;
  --primary:    #58a6ff;
  --primary-hover: #79b8ff;
  --success:    #3fb950;
  --error:      #f85149;
  --warning:    #d29922;
  --algo-green: #00b4d8;
  --radius:     12px;
  --shadow:     0 4px 24px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* HEADER */
header {
  background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
  border-bottom: 1px solid var(--border);
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  position: relative;
}

.header-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-title h1 {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--algo-green), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.site-logo {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(0, 180, 216, 0.35));
}

.header-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
}

.back-link {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.back-link:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(88,166,255,0.07);
}
.stats-link {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--algo-green);
  text-decoration: none;
  font-size: 0.82rem;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(63,185,80,0.35);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.stats-link:hover {
  color: var(--algo-green);
  border-color: var(--algo-green);
  background: rgba(63,185,80,0.07);
}

/* MAIN */
main {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 20px 64px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* HERO */
.hero-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding-top: 8px;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
}

.hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.hero-card:hover {
  border-color: rgba(88,166,255,0.35);
  box-shadow: var(--shadow);
}

.hero-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--bg-card2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}

.hero-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.hero-card-price {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  margin: 2px 0 4px;
}
.hero-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.hero-tagline {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  line-height: 1.7;
}
.hero-tagline strong {
  color: var(--text);
}

/* SECTION */
.section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.section-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
}
.section-desc a {
  color: var(--primary);
  text-decoration: none;
}
.section-desc a:hover { text-decoration: underline; }

/* STEPS */
.steps-list {
  list-style: none;
  counter-reset: steps;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
}
.steps-list li {
  counter-increment: steps;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.steps-list li::before {
  content: counter(steps);
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(88,166,255,0.12);
  border: 1px solid rgba(88,166,255,0.3);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* INFO BOX */
.info-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.info-box strong {
  color: var(--text);
  font-size: 0.8rem;
}
.addr {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
  color: var(--algo-green);
  word-break: break-all;
  background: none;
  border: none;
  padding: 0;
}

/* ENDPOINT CARD */
.endpoint-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.method {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 5px;
  font-family: monospace;
  letter-spacing: 0.05em;
}
.method.post { background: rgba(88,166,255,0.15); color: var(--primary); border: 1px solid rgba(88,166,255,0.3); }
.method.get  { background: rgba(63,185,80,0.12);  color: var(--success);  border: 1px solid rgba(63,185,80,0.3); }

.endpoint-header code {
  font-size: 0.88rem;
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, monospace;
}

.price-badge {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(88,166,255,0.1);
  border: 1px solid rgba(88,166,255,0.25);
  padding: 3px 10px;
  border-radius: 20px;
}
.price-badge.free {
  color: var(--success);
  background: rgba(63,185,80,0.1);
  border-color: rgba(63,185,80,0.25);
}

.endpoint-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* CODE BLOCKS */
.code-block-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: -6px;
}

.code-block {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  line-height: 1.65;
  color: var(--text);
  overflow-x: auto;
  white-space: pre;
}

code {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.82em;
  background: var(--bg-card2);
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--algo-green);
}

/* STATS */
.stats-section { align-items: center; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.1;
}
.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* FOOTER */
footer {
  text-align: center;
  padding: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
footer a:hover { color: var(--primary); }

/* RESPONSIVE */
@media (max-width: 640px) {
  header { padding: 20px 16px; flex-direction: column; }
  .back-link  { position: static; transform: none; }
  .stats-link { position: static; transform: none; }
  .hero-grid  { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .stat-value { font-size: 1.5rem; }
  main { padding: 20px 14px 48px; }
  .code-block { font-size: 0.72rem; }
}
