/**
 * Styles for [can_xuong_tinh_so] shortcode.
 * Reuse .xnc-* (form, TL;DR) + thêm .cx-* cho phần riêng:
 *   - cx-total-row, cx-progress-* — thanh đo tổng cân lượng
 *   - cx-breakdown-grid, cx-bd-* — 4 thẻ yếu tố
 *   - cx-luan-prose — block luận giải
 */

.cx-wrap {
    /* Inherit toàn bộ từ .xnc-wrap */
}

/* ===== Total row trong TL;DR ===== */
.cx-total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    margin: 8px 0 16px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    border-left: 4px solid #b8860b;
    flex-wrap: wrap;
}

.cx-total-label {
    font-size: 26px;
    font-weight: 700;
    color: #7b1414;
    letter-spacing: 0.5px;
}

.cx-total-numeric {
    font-size: 15px;
    color: #4a4a4a;
}

.cx-total-numeric strong {
    color: #b8860b;
    font-size: 20px;
}

.cx-total-numeric small {
    color: #888;
    margin-left: 6px;
    font-size: 12px;
}

/* ===== Progress bar 21..71 ===== */
.cx-progress-wrap {
    margin: 18px 0 8px;
}

.cx-progress-track {
    position: relative;
    height: 14px;
    background: #f0e6d2;
    border-radius: 7px;
    overflow: visible;
    border: 1px solid #d4a865;
}

.cx-progress-fill {
    height: 100%;
    border-radius: 7px 0 0 7px;
    transition: width 0.4s ease-out;
}

.cx-progress-fill.cx-progress-critical  { background: linear-gradient(90deg, #b91c1c, #dc2626); }
.cx-progress-fill.cx-progress-warning   { background: linear-gradient(90deg, #d97706, #f59e0b); }
.cx-progress-fill.cx-progress-neutral   { background: linear-gradient(90deg, #ca8a04, #eab308); }
.cx-progress-fill.cx-progress-good      { background: linear-gradient(90deg, #15803d, #16a34a); }
.cx-progress-fill.cx-progress-excellent { background: linear-gradient(90deg, #7b1414, #b8860b); }

.cx-progress-marker {
    position: absolute;
    top: -4px;
    width: 4px;
    height: 22px;
    background: #2c1810;
    border-radius: 2px;
    transform: translateX(-2px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.cx-progress-ticks {
    position: relative;
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 11px;
    color: #888;
}

.cx-progress-ticks .cx-tick {
    text-align: center;
    line-height: 1.2;
    flex: 0 0 auto;
}

.cx-progress-ticks .cx-tick small {
    font-size: 10px;
    color: #b8860b;
}

/* ===== Breakdown 4 cards ===== */
.cx-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 14px 0 18px;
}

@media (max-width: 720px) {
    .cx-breakdown-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 420px) {
    .cx-breakdown-grid { grid-template-columns: 1fr; }
}

.cx-breakdown-card {
    background: #fff;
    border: 1px solid #e5d3a5;
    border-radius: 8px;
    padding: 12px 14px;
    border-top: 3px solid #b8860b;
    text-align: center;
}

.cx-bd-year  { border-top-color: #b8860b; }
.cx-bd-month { border-top-color: #7b1414; }
.cx-bd-day   { border-top-color: #d97706; }
.cx-bd-hour  { border-top-color: #15803d; }

.cx-bd-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 8px;
}

.cx-bd-icon { font-size: 20px; }

.cx-bd-label {
    font-size: 14px;
    color: #2c1810;
    font-weight: 700;
}

.cx-bd-detail {
    font-size: 13px;
    color: #4a4a4a;
    font-weight: 600;
    margin-bottom: 2px;
}

.cx-bd-sub {
    font-size: 11px;
    color: #999;
    margin-bottom: 10px;
}

.cx-bd-chi {
    margin: 6px 0 8px;
}

.cx-bd-chi-num {
    font-size: 32px;
    font-weight: 700;
    color: #7b1414;
    line-height: 1;
}

.cx-bd-chi-unit {
    font-size: 13px;
    color: #888;
    margin-left: 4px;
}

.cx-bd-bar {
    height: 6px;
    background: #f0e6d2;
    border-radius: 3px;
    overflow: hidden;
}

.cx-bd-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #b8860b, #d4a865);
    transition: width 0.4s ease-out;
}

.cx-breakdown-sum {
    margin-top: 12px;
    padding: 10px 14px;
    background: #fdf8eb;
    border: 1px dashed #d4a865;
    border-radius: 6px;
    text-align: center;
    font-size: 15px;
}

.cx-breakdown-sum strong {
    color: #7b1414;
    font-size: 16px;
    margin-right: 8px;
}

.cx-breakdown-sum em {
    color: #b8860b;
    font-weight: 700;
    font-style: normal;
}

/* ===== Luận giải prose ===== */
.cx-luan-section {
    background: linear-gradient(180deg, #fff 0%, #fffaf0 100%);
}

.cx-luan-prose {
    padding: 18px 22px;
    background: #fff;
    border-left: 4px solid #b8860b;
    border-radius: 6px;
    margin: 10px 0;
}

.cx-luan-prose p {
    margin: 0;
    font-size: 16px;
    line-height: 1.75;
    color: #2c1810;
    font-style: italic;
}

/* ===== Detail collapse info ===== */
.cx-detail-info {
    background: #f8f4e8;
    padding: 12px 16px;
    border-radius: 6px;
    border-left: 3px solid #b8860b;
}

.cx-detail-info summary {
    cursor: pointer;
    user-select: none;
    color: #7b1414;
    list-style: none;
}

.cx-detail-info summary::-webkit-details-marker { display: none; }

.cx-detail-info summary::before {
    content: '▸ ';
    color: #b8860b;
    font-weight: bold;
    margin-right: 4px;
}

.cx-detail-info[open] summary::before { content: '▾ '; }

.cx-info-list {
    margin: 10px 0 0;
    padding-left: 22px;
    font-size: 14px;
}

.cx-info-list li {
    margin: 4px 0;
    color: #4a4a4a;
}

.cx-info-list strong {
    color: #7b1414;
}

/* ===== Standout factor cards ===== */
.cx-standout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 10px;
}

@media (max-width: 600px) {
    .cx-standout-grid { grid-template-columns: 1fr; }
}

.cx-standout-card {
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e5d3a5;
    border-radius: 8px;
    border-left: 4px solid;
}

.cx-standout-top { border-left-color: #15803d; background: linear-gradient(180deg, #f0fdf4 0%, #fff 60%); }
.cx-standout-bot { border-left-color: #d97706; background: linear-gradient(180deg, #fff7e6 0%, #fff 60%); }

.cx-standout-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.cx-standout-icon { font-size: 20px; }

.cx-standout-head strong {
    font-size: 15px;
    color: #2c1810;
    flex: 1 1 auto;
}

.cx-standout-num {
    background: #7b1414;
    color: #fff;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.cx-standout-top .cx-standout-num { background: #15803d; }
.cx-standout-bot .cx-standout-num { background: #d97706; }

.cx-standout-card p {
    margin: 0;
    font-size: 15.5px;
    line-height: 1.6;
    color: #4a4a4a;
}

/* ===== Luận giải 5 section cards ===== */
.cx-luan-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 10px;
}

@media (min-width: 720px) {
    .cx-luan-grid {
        grid-template-columns: 1fr 1fr;
    }
    .cx-luan-summary {
        grid-column: 1 / -1; /* tổng quan rộng full */
    }
    .cx-luan-advice {
        grid-column: 1 / -1; /* lời khuyên cũng full */
    }
}

.cx-luan-card {
    background: #fff;
    border: 1px solid #e5d3a5;
    border-radius: 8px;
    padding: 14px 18px;
    border-top: 3px solid #b8860b;
}

.cx-luan-card.cx-luan-summary { border-top-color: #7b1414; background: linear-gradient(180deg, #fffaf0 0%, #fff 50%); }
.cx-luan-card.cx-luan-career  { border-top-color: #b8860b; }
.cx-luan-card.cx-luan-family  { border-top-color: #c2410c; }
.cx-luan-card.cx-luan-health  { border-top-color: #15803d; }
.cx-luan-card.cx-luan-advice  { border-top-color: #2563eb; background: linear-gradient(180deg, #eff6ff 0%, #fff 50%); }

.cx-luan-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px dashed #e5d3a5;
}

.cx-luan-icon { font-size: 22px; }

.cx-luan-card-head strong {
    font-size: 15px;
    color: #7b1414;
    letter-spacing: 0.2px;
}

.cx-luan-card-body {
    margin: 0;
    font-size: 15.5px;
    line-height: 1.7;
    color: #2c1810;
}

.cx-luan-card.cx-luan-summary .cx-luan-card-body,
.cx-luan-card.cx-luan-advice .cx-luan-card-body {
    font-size: 15px;
}

/* ===== Tier Deep — luận sâu theo nhóm ===== */
.cx-tier-deep-section {
    background: linear-gradient(180deg, #fffaf0 0%, #fff 80%);
    border-left: 4px solid #7b1414;
}

/* Triết lý */
.cx-tier-philosophy {
    padding: 16px 20px;
    background: #fff;
    border: 1px solid #d4a865;
    border-left: 4px solid #b8860b;
    border-radius: 8px;
    margin: 12px 0 18px;
}

.cx-tier-philosophy-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px dashed #e5d3a5;
}

.cx-tier-philosophy-icon { font-size: 22px; }

.cx-tier-philosophy-head strong {
    font-size: 16px;
    color: #7b1414;
    letter-spacing: 0.3px;
}

.cx-tier-philosophy p {
    margin: 0;
    font-size: 15.5px;
    line-height: 1.75;
    color: #2c1810;
    font-style: italic;
}

/* Block chung cho tier */
.cx-tier-block {
    margin: 20px 0;
    padding: 14px 18px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e5d3a5;
}

.cx-tier-block-title {
    margin: 0 0 12px;
    font-size: 16px;
    color: #7b1414;
    font-weight: 700;
    padding-bottom: 6px;
    border-bottom: 1px dashed #d4a865;
}

/* Timeline thập niên */
.cx-decades-timeline {
    position: relative;
    padding-left: 8px;
}

.cx-decade-item {
    display: flex;
    gap: 14px;
    margin-bottom: 16px;
    align-items: flex-start;
}

.cx-decade-item:last-child { margin-bottom: 0; }

.cx-decade-marker {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #b8860b, #d4a865);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 2px 6px rgba(184, 134, 11, 0.3);
}

.cx-decade-content {
    flex: 1 1 auto;
    padding-top: 4px;
}

.cx-decade-label {
    display: block;
    font-size: 15px;
    color: #7b1414;
    margin-bottom: 4px;
}

.cx-decade-content p {
    margin: 0;
    font-size: 15.5px;
    line-height: 1.7;
    color: #2c1810;
}

/* Lucky grid */
.cx-lucky-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

@media (max-width: 600px) {
    .cx-lucky-grid { grid-template-columns: 1fr; }
}

.cx-lucky-card {
    padding: 10px 14px;
    background: #fafafa;
    border-radius: 6px;
    border-left: 4px solid #b8860b;
}

.cx-lucky-label {
    display: block;
    font-size: 13.5px;
    color: #2c1810;
    margin-bottom: 4px;
}

.cx-lucky-card p {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: #4a4a4a;
}

/* Warnings list */
.cx-warnings-list {
    margin: 0;
    padding-left: 22px;
    list-style: none;
}

.cx-warnings-list li {
    position: relative;
    padding: 8px 12px 8px 14px;
    margin-bottom: 8px;
    background: #fef2f2;
    border-left: 3px solid #b91c1c;
    border-radius: 4px;
    font-size: 15.5px;
    line-height: 1.6;
    color: #2c1810;
}

.cx-warnings-list li::before {
    content: '⚠';
    position: absolute;
    left: -22px;
    top: 8px;
    color: #b91c1c;
    font-size: 14px;
}

.cx-warnings-list li:last-child { margin-bottom: 0; }

/* ===== Mobile ===== */
@media (max-width: 600px) {
    .cx-total-label { font-size: 22px; }
    .cx-total-numeric { width: 100%; }
    .cx-progress-ticks { font-size: 10px; }
    .cx-progress-ticks .cx-tick small { display: none; }
    .cx-bd-chi-num { font-size: 26px; }
    .cx-luan-prose p { font-size: 14.5px; }
    .cx-luan-card { padding: 12px 14px; }
    .cx-luan-card-head strong { font-size: 14px; }
    .cx-luan-card-body { font-size: 14px; }
    .cx-tier-philosophy { padding: 14px 16px; }
    .cx-tier-philosophy p { font-size: 14px; }
    .cx-tier-block { padding: 12px 14px; }
    .cx-decade-marker { flex: 0 0 30px; width: 30px; height: 30px; font-size: 14px; }
    .cx-decade-content p { font-size: 13.5px; }
    .cx-warnings-list li { font-size: 13.5px; }
}
