/* === crypto.navilab.jp — 暗号資産AI分析ツール CSS === */

:root {
  --bg: #0d1117;
  --bg-card: #161b22;
  --bg-hover: #1c2333;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --green: #3fb950;
  --red: #f85149;
  --orange: #d29922;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans JP', sans-serif;
  --mono: 'SF Mono', 'JetBrains Mono', 'Fira Code', monospace;
  --radius: 8px;
  --max-width: 1100px;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;  /* 原則6: 日本語は行間広めに */
  min-height: 100vh;
}

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

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

/* === Header === */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  position: sticky;
  top: 0;
  background: rgba(13, 17, 23, 0.95);
  backdrop-filter: blur(8px);
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}
.site-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.site-logo span { color: var(--accent); }
.header-nav { display: flex; gap: 20px; list-style: none; }
.header-nav a { color: var(--text-muted); font-size: 14px; }
.header-nav a:hover, .header-nav a.active { color: var(--text); text-decoration: none; }

/* Mobile nav */
.hamburger-toggle { display: none; }
.hamburger-btn {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 8px;
}
.hamburger-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  transition: transform 0.2s;
}

/* === Hero === */
.hero {
  padding: 32px 0 24px;
  text-align: center;
}
.hero h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}
.hero p { color: var(--text-muted); font-size: 14px; }

/* === Fear & Greed Gauge === */
.fg-section { text-align: center; margin: 24px 0; }
.fg-gauge {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 24px;
}
.fg-value {
  font-size: 56px;       /* 原則1: 最重要KPIは大きく */
  font-weight: 800;
  font-family: var(--mono);
  line-height: 1;
}
.fg-label { font-size: 14px; color: var(--text-muted); }
.fg-bar {
  width: 200px;
  height: 8px;
  background: linear-gradient(to right, var(--red), var(--orange), var(--green));
  border-radius: 4px;
  position: relative;
  margin-top: 8px;
}
.fg-indicator {
  position: absolute;
  top: -4px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 4px rgba(0,0,0,0.5);
}

/* === Coin Table === */
.coin-table-section { margin: 24px 0; }
.section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 8px;     /* 原則3: タイトルと内容の区切りを明確に */
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.coin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.coin-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.coin-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.coin-table tr:last-child td { border-bottom: none; }
.coin-table tr:hover { background: var(--bg-hover); cursor: pointer; }

.coin-name {
  display: flex;
  align-items: center;
  gap: 8px;
}
.coin-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  color: var(--accent);
}
.coin-symbol {
  font-weight: 600;
}
.coin-fullname {
  font-size: 12px;
  color: var(--text-muted);
}

.price { font-family: var(--mono); font-weight: 600; text-align: right; }
.change { font-family: var(--mono); font-weight: 600; text-align: right; }
.positive { color: var(--green); }
.negative { color: var(--red); }

.sparkline-cell { width: 100px; }
.sparkline-canvas { width: 100px; height: 32px; }

.market-cap { text-align: right; color: var(--text-muted); font-size: 13px; }

/* === Dashboard Cards === */
.cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card-title {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.card-value {
  font-size: 28px;
  font-weight: 700;
  font-family: var(--mono);
}

/* === AI Report Cards === */
.report-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.report-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color 0.2s;
}
.report-card:hover { border-color: var(--accent); }
.report-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.report-card-coin { font-weight: 700; font-size: 16px; }
.outlook-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.outlook-up { background: rgba(63, 185, 80, 0.15); color: var(--green); }
.outlook-down { background: rgba(248, 81, 73, 0.15); color: var(--red); }
.outlook-neutral { background: rgba(139, 148, 158, 0.15); color: var(--text-muted); }
.report-card-reasons {
  list-style: none;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
}
.report-card-reasons li {
  padding: 4px 0;
  border-top: 1px solid var(--border);
}
.report-card-reasons li:first-child { border-top: none; }

/* === CTA Section === */
.cta-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  margin: 32px 0;
}
.cta-section h2 { font-size: 18px; margin-bottom: 8px; }
.cta-section p { color: var(--text-muted); font-size: 14px; margin-bottom: 16px; }
.cta-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.cta-btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  transition: opacity 0.2s;
}
.cta-btn:hover { opacity: 0.85; text-decoration: none; }
.cta-btn-primary { background: var(--accent); color: #fff; }
.cta-btn-secondary { background: var(--bg-hover); color: var(--text); border: 1px solid var(--border); }

/* === Footer === */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  margin-top: 48px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}
.footer-disclaimer {
  max-width: 600px;
  margin: 0 auto 16px;
  line-height: 1.8;
}
.footer-nav { display: flex; gap: 16px; justify-content: center; margin-bottom: 12px; list-style: none; }
.footer-nav a { color: var(--text-muted); }

/* === Responsive === */
@media (max-width: 768px) {
  .hamburger-btn { display: flex; }
  .header-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px;
    gap: 12px;
  }
  .hamburger-toggle:checked ~ .header-nav { display: flex; }

  .hero h1 { font-size: 20px; }
  .fg-gauge { flex-direction: column; padding: 12px 16px; }
  .fg-bar { width: 160px; }

  .coin-table { font-size: 13px; }
  .coin-table th, .coin-table td { padding: 8px 6px; }
  .sparkline-cell { display: none; }
  .market-cap-cell { display: none; }

  .cards-row { grid-template-columns: 1fr; }
  .report-cards { grid-template-columns: 1fr; }
  .cta-buttons { flex-direction: column; align-items: center; }
}

/* === Utilities === */
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.updated-at { font-size: 12px; color: var(--text-muted); text-align: right; margin-top: 8px; }

/* セクション説明文 */
.section-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 16px;
  max-width: 800px;
}

/* セクション内リンク */
.section-links {
  font-size: 13px;
  margin-top: 10px;
  padding: 10px 14px;
  background: rgba(88, 166, 255, 0.05);
  border-radius: var(--radius);
  line-height: 1.8;
}
.section-links a { font-weight: 600; }

/* === New Coins Highlight (Dashboard) === */
.new-coins-highlight {
  margin: 20px 0;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-left: 3px solid var(--orange);
}
.new-coins-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.new-coins-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.new-coin-chip {
  flex: 0 0 auto;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 160px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.new-coin-chip:hover { border-color: var(--accent); }
.new-coin-chip-header { display: flex; justify-content: space-between; align-items: center; }
.new-coin-chip-symbol { font-weight: 700; }
.new-coin-chip-chain { font-size: 10px; color: var(--text-muted); }
.new-coin-chip-data { font-size: 11px; color: var(--text-muted); }

.detail-btn {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: var(--radius);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.detail-btn:hover { background: var(--accent); color: #fff; }

/* === Global Stats Bar === */
.global-bar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 6px 0;
  font-size: 12px;
  color: var(--text-muted);
  overflow-x: auto;
  white-space: nowrap;
}
.global-bar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.gb-item strong { color: var(--text); font-weight: 600; }
.gb-change { font-size: 11px; }
.gb-divider { color: var(--border); }

/* === Top Row (F&G + summary) === */
.top-row {
  display: flex;
  gap: 20px;
  align-items: stretch;
  margin: 20px 0;
}
.top-row .fg-gauge {
  flex: 0 0 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.summary-cards {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.mini-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
}
.mini-card-label { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; }
.mini-card-value { font-size: 18px; font-weight: 700; font-family: var(--mono); }

/* === Tabs === */
.tabs-section { margin: 20px 0; }
.tab-buttons { display: flex; gap: 0; margin-bottom: 12px; }
.tab-btn {
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.tab-btn:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.tab-btn:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.tab-btn:not(:first-child) { border-left: none; }
.tab-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.trend-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.trend-chip {
  flex: 0 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s;
}
.trend-chip:hover { border-color: var(--accent); text-decoration: none; }
a.trend-chip { color: var(--text); }
.trend-chip img { width: 24px; height: 24px; border-radius: 50%; }
.trend-chip .tc-symbol { font-weight: 700; }
.trend-chip .tc-name { color: var(--text-muted); font-size: 12px; }

/* === Table enhancements === */
.table-scroll { overflow-x: auto; }
.coin-table th.r, .coin-table td.r { text-align: right; }
.coin-table .col-supply { width: 120px; }
.supply-bar {
  width: 80px;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
}
.supply-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; }
.supply-text { font-size: 11px; color: var(--text-muted); margin-left: 4px; }
.ai-badge {
  display: inline-block;
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  border-radius: 50%;
  font-size: 12px;
}
.ai-up { background: rgba(63,185,80,0.2); color: var(--green); }
.ai-down { background: rgba(248,81,73,0.2); color: var(--red); }
.ai-neutral { background: rgba(139,148,158,0.2); color: var(--text-muted); }

/* === Category Bars === */
.category-bars {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cat-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 220px;
}
.cat-info { display: flex; flex-direction: column; gap: 2px; }
.cat-name { color: var(--text); font-weight: 600; font-size: 13px; }
.cat-desc { color: var(--text-muted); font-size: 11px; line-height: 1.4; }
.cat-pct { font-weight: 700; font-family: var(--mono); white-space: nowrap; }

/* === News Feed === */
.news-filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.news-filter-btn {
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.news-filter-btn:hover { border-color: var(--accent); color: var(--text); }
.news-filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.news-feed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
  max-height: 600px;
  overflow-y: auto;
}
.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.15s;
}
.news-card:hover { border-color: var(--accent); text-decoration: none; }
.news-header { display: flex; justify-content: space-between; align-items: center; }
.news-source { font-size: 11px; color: var(--text-muted); }
.news-time { font-size: 11px; color: var(--text-muted); }
.news-title { font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--text); }
.sentiment-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.sentiment-bullish { background: rgba(63,185,80,0.15); color: var(--green); }
.sentiment-bearish { background: rgba(248,81,73,0.15); color: var(--red); }
.sentiment-neutral { background: rgba(139,148,158,0.1); color: var(--text-muted); }

/* === Report Full Card === */
.report-full-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  transition: border-color 0.15s;
}
.report-full-card:hover { border-color: var(--accent); }
.rfc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.rfc-coin { display: flex; align-items: center; gap: 10px; }
.rfc-outlooks { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rfc-outlook { padding: 12px; background: var(--bg-hover); border-radius: var(--radius); }
.rfc-outlook-label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.rfc-outlook-dir { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.rfc-reasons { list-style: none; font-size: 13px; color: var(--text-muted); }
.rfc-reasons li { padding: 3px 0; border-top: 1px solid var(--border); }
.rfc-reasons li:first-child { border-top: none; }
.rfc-tech {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.rfc-tech-item { color: var(--text-muted); }
.rfc-tech-item strong { color: var(--text); }
.rfc-risks {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.rfc-risk-tag {
  font-size: 12px;
  padding: 3px 8px;
  background: rgba(248, 81, 73, 0.1);
  color: var(--red);
  border-radius: 10px;
}
.rfc-highlight {
  margin-top: 10px;
  font-size: 13px;
  color: var(--accent);
  padding: 8px 12px;
  background: rgba(88, 166, 255, 0.05);
  border-radius: var(--radius);
}

@media (max-width: 768px) {
  .rfc-outlooks { grid-template-columns: 1fr; }
}

/* === Responsive additions === */
@media (max-width: 768px) {
  .top-row { flex-direction: column; }
  .top-row .fg-gauge { flex: 0 0 auto; }
  .summary-cards { grid-template-columns: repeat(2, 1fr); }
  .coin-table .col-1h { display: none; }
  .coin-table .col-vol { display: none; }
  .coin-table .col-supply { display: none; }
  .coin-table .col-ai { display: none; }
  .news-feed { grid-template-columns: 1fr; max-height: 400px; }
  .global-bar-inner { font-size: 11px; gap: 4px; }
}
