/* =============================================================================
   Zanix Channels — class map
   -----------------------------------------------------------------------------
   Shared shell:
     .zaniix-card
     .zaniix-card--channels | --kpi | --summary | --chart | --table | --filter
     .zaniix-card__header | __title | __subtitle | __body | __empty

   Shared parts:
     .zaniix-table-wrap / .zaniix-table / .zaniix-table__row / .zaniix-table__cell--*
     .zaniix-channel-name / .zaniix-channel-icon / .zaniix-channel-icon--{key}
     .zaniix-status / .zaniix-status--good|medium|bad|neutral / .zaniix-status__dot
     .zaniix-share-bar / .zaniix-share-bar--budget|profit
     .zaniix-legend / .zaniix-legend__item|__label|__dot|__percent
     .zaniix-metric-toggle / .zaniix-metric-toggle__btn
     .zaniix-sparkline / .zaniix-sparkline__canvas

   Widget roots:
     .zaniix-channel-kpi | .zaniix-channel-summary
     .zaniix-channel-profit-share | .zaniix-channel-budget
     .zaniix-channel-trend | .zaniix-channel-table | .zaniix-channel-filter
   ============================================================================= */

.elementor-element.elementor-widget-zaniix-channel-kpi-card,
.elementor-element.elementor-widget-zaniix-channel-profit-share,
.elementor-element.elementor-widget-zaniix-channel-budget-vs-profit,
.elementor-element.elementor-widget-zaniix-channel-trend-chart,
.elementor-element.elementor-widget-zaniix-channel-table,
.elementor-element.elementor-widget-zaniix-channel-summary-card,
.elementor-element.elementor-widget-zaniix-channel-filter,
.elementor-widget-zaniix-channel-kpi-card,
.elementor-widget-zaniix-channel-profit-share,
.elementor-widget-zaniix-channel-budget-vs-profit,
.elementor-widget-zaniix-channel-trend-chart,
.elementor-widget-zaniix-channel-table,
.elementor-widget-zaniix-channel-summary-card,
.elementor-widget-zaniix-channel-filter {
    --container-widget-width: 100%;
    --container-widget-flex-grow: 1;
    --width: 100%;
    --flex-grow: 1;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
    align-self: stretch !important;
    justify-self: stretch !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.elementor-widget-zaniix-channel-profit-share .elementor-widget-container,
.elementor-widget-zaniix-channel-budget-vs-profit .elementor-widget-container,
.elementor-widget-zaniix-channel-trend-chart .elementor-widget-container,
.elementor-widget-zaniix-channel-table .elementor-widget-container,
.elementor-widget-zaniix-channel-filter .elementor-widget-container {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Glass shell — same translucent glow as dashboard insight / KPI cards */
.elementor-widget-zaniix-channel-profit-share .elementor-widget-container,
.elementor-widget-zaniix-channel-budget-vs-profit .elementor-widget-container,
.elementor-widget-zaniix-channel-trend-chart .elementor-widget-container,
.elementor-widget-zaniix-channel-table .elementor-widget-container,
.elementor-widget-zaniix-channel-filter .elementor-widget-container {
    position: relative;
    display: block;
    width: 100% !important;
    box-sizing: border-box;
    overflow: hidden;
    padding: 18px;
    border-radius: 22px;
    direction: rtl;
    color: #ffffff;
    background: rgba(15, 15, 35, 0.45) !important;
    background-color: rgba(15, 15, 35, 0.45) !important;
    background-image: none !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 14px 34px rgba(0, 0, 0, 0.28) !important;
    backdrop-filter: blur(25px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(25px) saturate(160%) !important;
    isolation: isolate;
}

.elementor-widget-zaniix-channel-profit-share .elementor-widget-container::before,
.elementor-widget-zaniix-channel-budget-vs-profit .elementor-widget-container::before,
.elementor-widget-zaniix-channel-trend-chart .elementor-widget-container::before,
.elementor-widget-zaniix-channel-table .elementor-widget-container::before,
.elementor-widget-zaniix-channel-filter .elementor-widget-container::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 120% 90% at 50% 38%, rgba(55, 110, 220, 0.28) 0%, transparent 55%),
        radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.08) 0%, transparent 34%),
        radial-gradient(circle at 88% 88%, rgba(160, 95, 255, 0.12) 0%, transparent 36%);
    pointer-events: none;
    z-index: 0;
    border-radius: inherit;
}

.elementor-widget-zaniix-channel-profit-share .elementor-widget-container > *,
.elementor-widget-zaniix-channel-budget-vs-profit .elementor-widget-container > *,
.elementor-widget-zaniix-channel-trend-chart .elementor-widget-container > *,
.elementor-widget-zaniix-channel-table .elementor-widget-container > *,
.elementor-widget-zaniix-channel-filter .elementor-widget-container > * {
    position: relative;
    z-index: 1;
}

/* ----- Shared card structure ----- */
.zaniix-card--channels {
    direction: rtl;
    color: #ffffff;
}

.zaniix-card__header {
    margin-bottom: 12px;
}

.zaniix-card__title {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
}

.zaniix-card__subtitle {
    margin: 0;
    color: #94a3b8;
    font-size: 13px;
}

.zaniix-card__body {
    width: 100%;
}

.zaniix-card__empty {
    /* styled globally via .zaniix-empty-state / dashboard-widgets.css */
}

/* ----- Shared table ----- */
.zaniix-table-wrap {
    overflow-x: auto;
}

.zaniix-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}

.zaniix-table th,
.zaniix-table td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    text-align: right;
    vertical-align: middle;
    white-space: nowrap;
}

.zaniix-table th {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 500;
}

.zaniix-table__cell--profit.is-negative {
    color: #ef4444;
}

/* ----- Channel name / icon ----- */
.zaniix-channel-name {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.zaniix-channel-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
}

/* ----- Status ----- */
.zaniix-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    flex-direction: row-reverse;
}

.zaniix-status--good {
    color: #22c55e;
}

.zaniix-status--medium {
    color: #f59e0b;
}

.zaniix-status--bad {
    color: #ef4444;
}

.zaniix-status--neutral {
    color: #94a3b8;
}

.zaniix-status__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.zaniix-status--dot-only .zaniix-status__dot {
    width: 10px;
    height: 10px;
}

.zaniix-status--dot-only.zaniix-status--good .zaniix-status__dot { background: #22c55e; }
.zaniix-status--dot-only.zaniix-status--medium .zaniix-status__dot { background: #f59e0b; }
.zaniix-status--dot-only.zaniix-status--bad .zaniix-status__dot { background: #ef4444; }
.zaniix-status--dot-only.zaniix-status--neutral .zaniix-status__dot { background: #64748b; }

/* ----- Share bars ----- */
.zaniix-share-bar {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 140px;
    direction: ltr;
    justify-content: flex-end;
    width: 100%;
}

.zaniix-share-bar__track {
    display: block;
    width: 72px;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.zaniix-share-bar__fill {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.zaniix-share-bar--budget .zaniix-share-bar__fill {
    background: var(--zaniix-purple, #A05FFF);
}

.zaniix-share-bar--profit .zaniix-share-bar__fill {
    background: var(--zaniix-orange, #F88F07);
}

.zaniix-share-bar__label {
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
}

/* ----- Legend ----- */
.zaniix-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.zaniix-legend--inline {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 14px;
}

.zaniix-legend__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.zaniix-channel-profit-share__legend .zaniix-legend__item {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.zaniix-legend--inline .zaniix-legend__item {
    justify-content: flex-start;
}

.zaniix-legend__label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #e2e8f0;
    font-size: 14px;
}

.zaniix-legend__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 10px currentColor;
}

.zaniix-legend__percent {
    color: #ffffff;
    font-weight: 700;
    font-size: 14px;
}

/* ----- Metric toggle ----- */
.zaniix-metric-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.zaniix-metric-toggle__btn {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    background: transparent !important;
    color: #cbd5e1 !important;
    border-radius: 999px !important;
    padding: 8px 14px !important;
    font-size: 13px !important;
    cursor: pointer;
}

.zaniix-metric-toggle__btn.is-active {
    background: var(--zaniix-orange, #F88F07) !important;
    border-color: var(--zaniix-orange, #F88F07) !important;
    color: #ffffff !important;
}

/* ----- Sparkline ----- */
.zaniix-sparkline {
    display: inline-flex;
    align-items: center;
}

.zaniix-sparkline__canvas {
    display: block;
}

/* ----- Profit share layout ----- */
.zaniix-channel-profit-share__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
    gap: 18px;
    align-items: center;
}

/* ----- Filter (matched to campaign filter) ----- */
.elementor-widget-zaniix-channel-filter .elementor-widget-container {
    overflow: visible !important;
}

.elementor-widget-zaniix-channel-filter.is-dropdown-open,
.elementor-widget-zaniix-channel-filter.is-dropdown-open .elementor-widget-container {
    overflow: visible !important;
    z-index: 200 !important;
}

.zaniix-channel-filter {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 100%;
}

.zaniix-channel-filter.is-open {
    z-index: 220;
}

.zaniix-channel-filter__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background-color: rgba(255, 255, 255, 0.06) !important;
    background-image: none !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc;
    padding: 12px 16px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    text-align: right;
    cursor: pointer;
    box-shadow: none !important;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.zaniix-channel-filter__toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
}

.zaniix-channel-filter.is-open .zaniix-channel-filter__toggle {
    border-color: rgba(248, 143, 7, 0.45);
    box-shadow: 0 0 0 1px rgba(248, 143, 7, 0.18);
}

.zaniix-channel-filter__toggle-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.zaniix-channel-filter__toggle-icon {
    color: #94a3b8;
    font-size: 14px;
    line-height: 1;
    transition: transform 0.2s ease, color 0.2s ease;
}

.zaniix-channel-filter.is-open .zaniix-channel-filter__toggle-icon {
    transform: rotate(180deg);
    color: var(--zaniix-orange, #F88F07);
}

.zaniix-channel-filter__search {
    width: 100%;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    background-color: rgba(255, 255, 255, 0.08) !important;
    background-image: none !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc;
    padding: 10px 12px;
    border-radius: 10px;
    outline: none;
    font-family: inherit;
    font-size: 13px;
    margin-bottom: 10px;
    box-shadow: none !important;
}

.zaniix-channel-filter__search:focus {
    border-color: rgba(248, 143, 7, 0.45);
    box-shadow: 0 0 0 1px rgba(248, 143, 7, 0.18);
}

.zaniix-channel-filter__search::placeholder {
    color: #64748b;
}

.zaniix-channel-filter__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    z-index: 1000;
    color: #e2e8f0 !important;
    color-scheme: dark;
    background-color: var(--zaniix-navy, #00072D) !important;
    background-image: linear-gradient(160deg, rgba(0, 7, 45, 0.98) 0%, rgba(0, 7, 45, 0.92) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 14px;
    padding: 10px;
    max-height: 320px;
    overflow: auto;
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.zaniix-channel-filter__options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.zaniix-channel-filter__option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    border: 0 !important;
    background-color: transparent !important;
    background-image: none !important;
    color: #e2e8f0 !important;
    -webkit-text-fill-color: #e2e8f0;
    padding: 10px 12px;
    border-radius: 10px;
    text-align: right;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    box-shadow: none !important;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.zaniix-channel-filter__option:hover,
.zaniix-channel-filter__option:focus {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff;
}

.zaniix-channel-filter__option.is-active {
    background-color: rgba(248, 143, 7, 0.18) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff;
}

.zaniix-channel-filter__option.is-active::after {
    content: "✓";
    color: var(--zaniix-orange, #F88F07);
    font-size: 13px;
    flex: 0 0 auto;
}

.zaniix-channel-filter__option[hidden] {
    display: none;
}

.elementor-widget-zaniix-channel-filter .zaniix-channel-filter__dropdown,
.elementor-widget-zaniix-channel-filter .zaniix-channel-filter__dropdown * {
    box-sizing: border-box;
}

.elementor-widget-zaniix-channel-filter .zaniix-channel-filter__dropdown input[type="search"],
.elementor-widget-zaniix-channel-filter .zaniix-channel-filter__dropdown button {
    font-family: inherit;
}

@media (max-width: 900px) {
    .zaniix-channel-profit-share__body {
        grid-template-columns: 1fr;
    }

    .zaniix-channel-profit-share__chart {
        order: -1;
    }
}
