﻿/* ── [cmc_cycle_indicators] Crypto Cycle Indicators Dashboard ─────────────── */

.cmc-ci {
    font-family: inherit!important;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    direction: rtl;
    width: 100%;
}

.cmc-ci-error {
    padding: 20px;
    color: #64748b;
    font-size: 13px;
}

/* ── Row 1: Puell chart + sidebar ── */
.cmc-ci-row1 {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-height: 380px;
    border-bottom: 1px solid #e2e8f0;
}

/* ── Row 2: Rainbow + Pi Cycle charts ── */
.cmc-ci-row2 {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-height: 320px;
    border-bottom: 1px solid #e2e8f0;
}

.cmc-ci-row2 .cmc-ci-chart-panel {
    flex: 1 1 0;
    min-width: 0;
    border-left: 1px solid #e2e8f0;
}

.cmc-ci-row2 .cmc-ci-chart-panel:first-child { border-left: none; }

/* ── Chart panel ── */
.cmc-ci-chart-panel {
    flex: 1 1 0;
    min-width: 0;
    padding: 14px 18px 10px;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cmc-ci-row1 > .cmc-ci-chart-panel { border-right: none; }

.cmc-ci-chart-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    direction: rtl;
    flex-wrap: wrap;
    gap: 6px;
}

.cmc-ci-chart-title {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
}

/* ── Range tabs ── */
.cmc-ci-tabs {
    display: flex;
    gap: 4px;
    direction: ltr;
    flex-shrink: 0;
}

.cmc-ci-tab {
    background: transparent!important;
    border: 1px solid #e2e8f0!important;
    cursor: pointer!important;
    font-size: 10px!important;
    font-weight: 600!important;
    color: #64748b!important;
    padding: 2px 8px!important;
    border-radius: 4px!important;
    transition: all 0.12s!important;
    font-family: inherit!important;
    line-height: 1.5!important;
    white-space: nowrap!important;
}

.cmc-ci-tab:hover { background: #f8fafc!important; color: #334155!important; }
.cmc-ci-tab--active { background: #0f172a!important; color: #fff!important; border-color: #0f172a!important; }

/* ── Legend ── */
.cmc-ci-legend {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    direction: rtl;
}

.cmc-ci-leg {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #64748b;
}

.cmc-ci-leg-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.cmc-ci-leg-bar {
    width: 20px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* ── Chart canvas ── */
.cmc-ci-chart-wrap {
    flex: 1;
    position: relative;
    min-height: 240px;
}

.cmc-ci-chart-wrap canvas { width: 100% !important; height: 100% !important; }

/* ── Rainbow footer labels ── */
.cmc-ci-rainbow-footer {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding-top: 4px;
    font-size: 9px;
    font-weight: 600;
}

.rb-cold { color: #2166ac; }
.rb-teal  { color: #41b3a3; }
.rb-warm  { color: #f0b429; }
.rb-hot   { color: #ea3943; }
.rb-src   { color: #94a3b8; font-weight: 400; margin-right: auto; }

/* ── Sidebar ── */
.cmc-ci-sidebar {
    flex: 0 0 250px;
    display: flex;
    flex-direction: column;
    background: #fafbfc;
    order: -1;
}

/* ── Sidebar cards ── */
.cmc-ci-side-card {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.cmc-ci-side-card:last-child { border-bottom: none; }

.cmc-ci-side-icon {
    font-size: 8px;
    color: #94a3b8;
    margin-bottom: 2px;
}

.cmc-ci-side-lbl {
    font-size: 10px;
    font-weight: 600;
    color: #64748b;
    line-height: 1.4;
    margin-bottom: 4px;
    text-align: right;
}

.cmc-ci-side-val {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    text-align: left;
    margin-bottom: 8px;
    direction: ltr;
}

/* Puell zone colors */
.cmc-ci-val-deep-value    { color: #16c784; }
.cmc-ci-val-value         { color: #93d150; }
.cmc-ci-val-fair          { color: #f0b429; }
.cmc-ci-val-overval       { color: #f97316; }
.cmc-ci-val-extreme-overval { color: #ea3943; }

/* ── Track bar ── */
.cmc-ci-track-wrap { margin-bottom: 4px; }

.cmc-ci-track-bar {
    position: relative;
    height: 6px;
    background: linear-gradient(to right, #ea3943, #f97316, #f0b429, #93d150, #16c784);
    border-radius: 3px;
    margin-bottom: 3px;
}

.cmc-ci-track-peak {
    background: linear-gradient(to right, #94a3b8, #f0b429, #ea3943);
}

.cmc-ci-track-fill { display: none; }

.cmc-ci-track-dot {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: #fff;
    border: 2px solid #334155;
    border-radius: 50%;
    pointer-events: none;
}

.cmc-ci-track-labels {
    display: flex;
    justify-content: space-between;
    font-size: 8px;
    color: #94a3b8;
}

.cmc-ci-side-status {
    font-size: 10px;
    font-weight: 600;
    color: #475569;
    text-align: right;
    margin-top: 2px;
}

/* ── Pi Cycle card ── */
.cmc-ci-pi-row {
    display: flex;
    align-items: center;
    gap: 6px;
    direction: rtl;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.cmc-ci-pi-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 80px;
    text-align: right;
}

.cmc-ci-pi-sub {
    font-size: 9px;
    color: #94a3b8;
    line-height: 1.3;
}

.cmc-ci-pi-num {
    font-size: 11px;
    font-weight: 700;
    color: #0f172a;
    direction: ltr;
    text-align: left;
}

.cmc-ci-pi-sep {
    font-size: 9px;
    font-weight: 700;
    color: #64748b;
    flex-shrink: 0;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

.cmc-ci-pi-gap {
    font-size: 10px;
    color: #64748b;
    text-align: right;
    padding: 3px 6px;
    background: #f8fafc;
    border-radius: 4px;
}

.cmc-ci-pi-crossed {
    color: #ea3943;
    background: #fef2f2;
    font-weight: 700;
}

/* ── Cycle peak summary card ── */
.cmc-ci-peak-num {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 2px;
    text-align: right;
}

.cmc-ci-peak-pct {
    font-size: 22px;
    font-weight: 800;
    color: #64748b;
    line-height: 1;
    margin-bottom: 6px;
    direction: ltr;
    text-align: left;
}

.cmc-ci-peak-fill { background: linear-gradient(to right, #94a3b8, #ea3943); }

/* ── Table section ── */
.cmc-ci-table-section {
    padding: 18px 20px 24px;
    background: #fafbfc;
    border-top: 1px solid #e2e8f0;
}

.cmc-ci-table-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 14px;
    text-align: right;
}

.cmc-ci-table-wrap {
    overflow-x: auto;
}

.cmc-ci-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    min-width: 560px;
}

.cmc-ci-table th {
    background: #f8fafc;
    color: #64748b;
    font-weight: 600;
    font-size: 11px;
    padding: 8px 12px;
    text-align: right;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.cmc-ci-th-num { width: 36px; text-align: center; }

.cmc-ci-table td {
    padding: 9px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    white-space: nowrap;
}

.cmc-ci-table tr:last-child td { border-bottom: none; }
.cmc-ci-table tr:hover td { background: #f8fafc; }

.cmc-ci-td-num  { text-align: center; color: #94a3b8; font-size: 11px; }
.cmc-ci-td-name { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.cmc-ci-td-val  { font-weight: 700; color: #0f172a; direction: ltr; text-align: left; }
.cmc-ci-td-chg  { color: #64748b; }
.cmc-ci-td-ref  { color: #64748b; font-size: 11px; }
.cmc-ci-td-trig { text-align: center; }

.cmc-ci-ind-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.cmc-ci-dot-on  { background: #16c784; }
.cmc-ci-dot-off { background: #e2e8f0; }

.cmc-ci-check {
    color: #16c784;
    font-size: 15px;
    font-weight: 700;
}

.cmc-ci-cross {
    color: #ea3943;
    font-size: 14px;
    font-weight: 700;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .cmc-ci-row1 { flex-direction: column; }
    .cmc-ci-row1 > .cmc-ci-chart-panel { border-right: none; border-bottom: 1px solid #e2e8f0; }
    .cmc-ci-sidebar { flex: none; flex-direction: row; flex-wrap: wrap; }
    .cmc-ci-side-card { flex: 1 1 200px; }
}

@media (max-width: 760px) {
    .cmc-ci-row2 { flex-direction: column; }
    .cmc-ci-row2 .cmc-ci-chart-panel { border-left: none; border-bottom: 1px solid #e2e8f0; }
    .cmc-ci-sidebar { flex-direction: column; }
}

@media (max-width: 480px) {
    .cmc-ci-chart-wrap { min-height: 200px; }
    .cmc-ci-tabs { flex-wrap: wrap; }
}
