/* Chart builder icons */
.chartBuilder:before,
.chartBuilder-win-shortcut:before {
    font-family: 'Font Awesome 5 Free';
    content: '\f200';
}

/* ===== Modern Chart Editor Settings Panel ===== */

/* Section headers — replace the grey block-style headers */
.chartBuilder-section {
    padding: 16px 4px 8px;
    margin: 18px 4px 10px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #1a202c;
    background: transparent;
    text-align: left;
    border-bottom: 2px solid #4a90e2;
}

.chartBuilder-section:first-child {
    margin-top: 6px;
}

/* Settings field labels — slightly tighter, modern weight */
.xmlEditorFieldPanel .x-component-default > span[title] {
    font-size: 13px;
    font-weight: 500;
    color: #2d3748;
}

/* Field containers — give them breathing room */
.xmleditor-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 4px;
}

.xmleditor-table > tbody > tr > td {
    padding: 4px 6px;
    vertical-align: middle;
}

/* Settings panel body — soft background */
.xmlEditorFieldPanel > .x-panel-body {
    background: #fafbfc;
    padding: 8px 12px;
}

/* Settings panel header */
.xmlEditorFieldPanel > .x-panel-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e8ef;
}

.xmlEditorFieldPanel > .x-panel-header .x-title-text {
    font-size: 15px;
    font-weight: 600;
    color: #1a202c;
}

/* ===== Form fields — modernize text inputs, sliders, etc ===== */
.xmlEditorFieldPanel .x-form-text-default {
    border-radius: 6px;
    border: 1px solid #d8dde6;
    background: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.xmlEditorFieldPanel .x-form-text-default:focus,
.xmlEditorFieldPanel .x-form-focus.x-form-text-default {
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.15);
    outline: none;
}

.xmlEditorFieldPanel .x-form-trigger-wrap-default {
    border-radius: 6px;
    border: 1px solid #d8dde6;
    background: #ffffff;
}

.xmlEditorFieldPanel .x-form-trigger-wrap-default:hover {
    border-color: #b0b9c6;
}

.xmlEditorFieldPanel .x-form-focus-trigger-wrap.x-form-trigger-wrap-default {
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.15);
}

/* Inner inputs inside trigger wraps */
.xmlEditorFieldPanel .x-form-trigger-wrap-default > .x-form-text-wrap > input.x-form-text {
    border: none;
    background: transparent;
}

/* Slider track/thumb */
.xmlEditorFieldPanel .x-slider-horz .x-slider-inner {
    background: #e5e8ef;
    border-radius: 3px;
    height: 6px;
}

.xmlEditorFieldPanel .x-slider-horz .x-slider-thumb {
    background: #4a90e2;
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    width: 14px;
    height: 14px;
    margin-top: -4px;
}

.xmlEditorFieldPanel .x-slider-horz .x-slider-thumb:hover {
    background: #357abd;
}

/* ===== Color picker field — show a color swatch in the trigger ===== */
.esp-colorPicker .x-form-trigger-wrap-default {
    overflow: hidden;
}

.esp-colorPicker .x-form-trigger-default {
    width: 28px;
    border-left: 1px solid #d8dde6;
    background-color: var(--esp-color-swatch, #ffffff);
    background-image: linear-gradient(45deg, #ddd 25%, transparent 25%),
                      linear-gradient(-45deg, #ddd 25%, transparent 25%),
                      linear-gradient(45deg, transparent 75%, #ddd 75%),
                      linear-gradient(-45deg, transparent 75%, #ddd 75%);
    background-size: 8px 8px;
    background-position: 0 0, 0 4px, 4px -4px, -4px 0;
    cursor: pointer;
    position: relative;
}

.esp-colorPicker .x-form-trigger-default::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: var(--esp-color-swatch, transparent);
}

.esp-colorPicker .x-form-trigger-default::before {
    content: '';
    position: absolute;
    right: 4px;
    top: 50%;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #5a6478;
    transform: translateY(-50%);
    z-index: 1;
}

/* ===== Color picker dropdown — modernize palette + custom color row ===== */
.esp-colorPicker-dropdown {
    border: 1px solid #d8dde6 !important;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    background: #ffffff;
    overflow: hidden;
}

.esp-colorPicker-dropdown .x-color-palette {
    padding: 10px;
    background: #ffffff;
}

.esp-colorPicker-dropdown .x-color-palette a {
    border-radius: 4px;
    margin: 2px;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.esp-colorPicker-dropdown .x-color-palette a:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.esp-colorPicker-dropdown .x-color-palette-selected {
    border: 2px solid #4a90e2 !important;
}

/* Custom color row inside the picker */
.esp-colorPicker-customRow {
    border-top: 1px solid #e5e8ef;
    background: #fafbfc;
}

.esp-colorPicker-customLabel {
    font-size: 12px;
    font-weight: 500;
    color: #5a6478;
}

.esp-colorPicker-customWrap {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid #d8dde6;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.esp-colorPicker-customWrap:hover {
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.15);
}

.esp-colorPicker-customInput {
    position: absolute;
    inset: -2px;
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    border: none;
    padding: 0;
    cursor: pointer;
    background: transparent;
}

.esp-colorPicker-customHex {
    font-size: 12px;
    font-weight: 500;
    color: #2d3748;
    margin-left: 10px;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    text-transform: uppercase;
}

/* ===== AmCharts 5 Export Menu Styling ===== */

/* Menu container */
.am5exporting.am5exporting-list {
    background: #ffffff;
    border: 1px solid #e5e8ef;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    padding: 6px 0;
    min-width: 160px;
    list-style: none;
    margin: 0;
    overflow: hidden;
}

/* Menu items */
.am5exporting-item {
    list-style: none;
}

.am5exporting-item > a {
    display: block;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #2d3748;
    text-decoration: none;
    transition: background-color 0.12s ease;
    cursor: pointer;
    white-space: nowrap;
}

.am5exporting-item > a:hover {
    background: #f0f4fa;
    color: #1a202c;
}

/* Alt labels (e.g., "Image" next to PNG) */
.am5exporting-label-alt {
    font-weight: 400;
    color: #8896a7;
    margin-left: 4px;
    font-size: 12px;
}

/* Separator items */
.am5exporting-type-separator > a {
    padding: 4px 16px 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8896a7;
    cursor: default;
    border-top: 1px solid #e5e8ef;
    margin-top: 4px;
    padding-top: 8px;
}

.am5exporting-type-separator > a:hover {
    background: transparent;
}

/* Custom items (Edit, etc.) — give them a slight accent with pencil icon */
.am5exporting-type-custom > a {
    font-weight: 600;
    color: #4a90e2;
}

.am5exporting-type-custom > a::before {
    font-family: 'Font Awesome 5 Free';
    content: '\f303';
    font-weight: 900;
    margin-right: 8px;
    font-size: 12px;
}

.am5exporting-type-custom > a:hover {
    background: #eef4fc;
    color: #357abd;
}

/* The trigger icon (three dots) */
.am5exporting-icon {
    opacity: 0.5;
    transition: opacity 0.15s ease;
}

.am5exporting-icon:hover {
    opacity: 1;
}

/* ===== Engine Version Selector (Customize pane) ===== */
.chartbuilder-engine-selector {
    padding: 8px 12px;
    background: #ffffff;
    border-bottom: 1px solid #e5e8ef;
}
