/* =======================================================================
 *  ECharts グラフ ウィジェット用スタイル (株式会社エフ / ef.custom.EChartsChart)
 *  - efDataGrid.css と同じ考え方:
 *    ID セレクタは使わず .ec-chart 配下のクラスにスコープ
 *    (1ページに複数配置しても衝突しない)
 *  - runtimeResources で EChartsWidget_Definition.js と一緒に読み込む
 * ======================================================================= */

/* パレット用アイコン(暫定。御社の自作SVG等に差し替え可) */
.efEChartsIcon::before {
  content: url("EChartsWidget.svg");
  display: inline-block;
  width: 18px;
  height: 18px;
}

/* ルート */
.ec-chart {
    border: 1px solid #ccc;
    border-radius: 5px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    font-family: sans-serif;
    overflow: hidden;
    padding: 6px;
}

/* グラフ本体を入れる div(高さは JS から動的に指定) */
.ec-chart .ec-canvas {
    width: 100%;
    box-sizing: border-box;
}

/* デザイン画面 / 実行時のプレースホルダー */
.ec-chart .ec-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    font-size: 13px;
}

/* ===== グラフ種類 トグル + 円グラフ表示項目セレクタ ===== */
.ec-chart .ec-toolbar {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 4px 4px 8px;
    flex-wrap: wrap;
}
.ec-chart .ec-toolbar button {
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background-color: #fff;
    color: #333;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.ec-chart .ec-toolbar button:hover {
    background-color: #f0f0f0;
}
.ec-chart .ec-toolbar button.active {
    border-color: transparent;
}
.ec-chart .ec-toolbar select {
    padding: 3px 6px;
    font-size: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.ec-chart .ec-pie-metric {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    padding-left: 8px;
    border-left: 1px solid #ddd;
    font-size: 12px;
    color: #555;
}

/* ===== フィルターバー(efDataGrid の .dg-filter 系と同じ構造) ===== */
.ec-chart .ec-filter {
    padding: 6px 10px;
    margin-bottom: 6px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
}
.ec-chart .ec-filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.ec-chart .ec-filter-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.ec-chart .ec-filter select,
.ec-chart .ec-filter input {
    padding: 3px 6px;
    font-size: 13px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.ec-chart .ec-filter input[type="number"] {
    width: 70px;
}
.ec-chart .ec-filter button {
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 13px;
}
.ec-chart .ec-filter-remove {
    padding: 2px 8px;
    background: transparent;
    border: 1px solid #ccc;
}
.ec-chart .ec-filter-topn {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #555;
}

/* ===== 白系テーマ ===== */
.ec-chart.theme-white { border-color: #cccccc; }
.ec-chart.theme-white .ec-toolbar button.active { background-color: #424242; color: #eee; }
.ec-chart.theme-white .ec-filter-search { background-color: #bbb; color: #212121; }
.ec-chart.theme-white .ec-filter-search:hover { background-color: #999; }

/* ===== 赤系テーマ ===== */
.ec-chart.theme-red { border-color: #b71c1c; }
.ec-chart.theme-red .ec-toolbar button.active { background-color: #d32f2f; color: #fff; }
.ec-chart.theme-red .ec-filter-search { background-color: #d32f2f; color: #fff; }
.ec-chart.theme-red .ec-filter-search:hover { background-color: #c62828; }

/* ===== 青系テーマ ===== */
.ec-chart.theme-blue { border-color: #0d47a1; }
.ec-chart.theme-blue .ec-toolbar button.active { background-color: #1976d2; color: #fff; }
.ec-chart.theme-blue .ec-filter-search { background-color: #1976d2; color: #fff; }
.ec-chart.theme-blue .ec-filter-search:hover { background-color: #1565c0; }

/* ===== 黄色系テーマ ===== */
.ec-chart.theme-yellow { border-color: #f9a825; }
.ec-chart.theme-yellow .ec-toolbar button.active { background-color: #fbc02d; color: #000; }
.ec-chart.theme-yellow .ec-filter-search { background-color: #fbc02d; color: #000; }
.ec-chart.theme-yellow .ec-filter-search:hover { background-color: #f9a825; }

/* ===== 緑系テーマ ===== */
.ec-chart.theme-green { border-color: #1b5e20; }
.ec-chart.theme-green .ec-toolbar button.active { background-color: #388e3c; color: #fff; }
.ec-chart.theme-green .ec-filter-search { background-color: #388e3c; color: #fff; }
.ec-chart.theme-green .ec-filter-search:hover { background-color: #2e7d32; }

/* ===== 黒系テーマ ===== */
.ec-chart.theme-dark { border-color: #212121; background-color: #121212; }
.ec-chart.theme-dark .ec-toolbar button {
    background-color: #2a2a2a;
    color: #eee;
    border-color: #444;
}
.ec-chart.theme-dark .ec-toolbar button:hover { background-color: #383838; }
.ec-chart.theme-dark .ec-toolbar button.active { background-color: #616161; color: #fff; }
.ec-chart.theme-dark .ec-toolbar select {
    background-color: #2a2a2a;
    color: #eee;
    border-color: #444;
}
.ec-chart.theme-dark .ec-pie-metric { color: #ccc; border-left-color: #444; }
.ec-chart.theme-dark .ec-filter {
    background-color: #1b1b1b;
    border-color: #333;
    color: #eee;
}
.ec-chart.theme-dark .ec-filter select,
.ec-chart.theme-dark .ec-filter input {
    background-color: #2a2a2a;
    color: #eee;
    border-color: #444;
}
.ec-chart.theme-dark .ec-filter-topn { color: #ccc; }
.ec-chart.theme-dark .ec-filter-search { background-color: #424242; color: #eee; }
.ec-chart.theme-dark .ec-filter-search:hover { background-color: #616161; }
.ec-chart.theme-dark .ec-placeholder { color: #ccc; }
