/* ===== チャートページ専用スタイル（ライトテーマ） ===== */

/* ツールバー */
.chart-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.toolbar-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-right: 4px;
  font-weight: 500;
}

.toolbar-btn {
  background: var(--bg-body);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.15s;
  white-space: nowrap;
}

.toolbar-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.toolbar-btn.active {
  color: #fff;
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}

.color-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}

.dot-win { background: #ffeb3b; }
.dot-loss { background: var(--accent-blue); }

.toolbar-info {
  margin-left: auto;
  gap: 16px;
}

.toolbar-info .info-item {
  font-size: 0.8rem;
  white-space: nowrap;
}

.toolbar-info .info-label {
  color: var(--text-muted);
  margin-right: 4px;
}

.toolbar-info .info-item span:not(.info-label) {
  color: var(--text-primary);
  font-weight: 500;
}

/* チャートコンテナ */
#chart-wrapper {
  margin-bottom: 20px;
}

#chart-container {
  width: 100%;
  height: calc(100vh - 320px);
  min-height: 400px;
  position: relative;
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

#trade-overlay, #zoom-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#trade-overlay { z-index: 5; }
#zoom-overlay { z-index: 10; }
#chart-container.selecting { cursor: crosshair; }
#chart-container.selecting #zoom-overlay { pointer-events: auto; }

/* スタッツカード */
.chart-stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.chart-stat-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.chart-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.icon-green { background: #f0fff4; color: var(--accent-green); }
.icon-red { background: #fff5f5; color: var(--accent-red); }
.icon-blue-bg { background: #ebf8ff; color: var(--accent-blue); }
.icon-orange-bg { background: #fffaf0; color: var(--accent-orange); }
.icon-yellow { background: #fffff0; color: #d69e2e; }

.chart-stat-num {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.chart-stat-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* 凡例セクション */
.legend-section {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.legend-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: var(--bg-body);
  border-radius: var(--radius-xs);
}

.legend-color {
  width: 32px;
  height: 24px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 2px;
}

.legend-item strong {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.legend-item p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* CTAボックス */
.cta-box {
  text-align: center;
  padding: 32px;
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.cta-box h2 {
  font-size: 1.2rem;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.cta-box p {
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-size: 0.9rem;
  line-height: 1.7;
}

.btn-cta {
  display: inline-block;
  background: var(--accent-blue);
  color: #fff;
  text-decoration: none;
  padding: 10px 28px;
  border-radius: var(--radius-xs);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-cta:hover {
  background: #3182ce;
  transform: translateY(-1px);
}

/* フッター */
.page-footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.8;
  padding: 20px 0;
  border-top: 1px solid var(--border-light);
}

/* レスポンシブ */
@media (max-width: 768px) {
  .chart-toolbar {
    padding: 8px 12px;
    gap: 8px;
  }
  .toolbar-info { display: none; }
  #chart-container {
    height: calc(100vh - 260px);
    min-height: 300px;
  }
  .chart-stat-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}
