:root {
    --number-wood: rgb(8, 73, 0);
    --number-wood-light: rgb(119, 207, 108);
    --number-fire: rgb(184, 31, 0);
    --number-fire-light:rgb(255, 215, 207);
    --number-earth: rgb(133, 96, 0);
    --number-earth-light:rgb(255, 251, 199);
    --number-metal:#555;
    --number-metal-light:#ccc;
    --number-water: rgb(17 108 227);
    --number-water-light:rgb(151, 237, 252);
}

/* common section */
.section-subtitle {
    font-size: 16px;
    border-bottom: 1px solid #e3e6f0;
    padding-bottom: 8px;
    margin-bottom: 15px;
    font-weight: 600;
    color: #4e73df;
}

.highlighted-row{
    background-color: #7cd76e;
}

table.number-table td{
    border: 1px solid var(--primary-purple);
}

.number-alert{
    margin-bottom: 0px !important;
    background-color: var(--active-purple);
    border-color: var(--dark-purple);
    color: var(--dark-purple);
}

/* mingpan css (triangle drawing) */
.number-row {
    display: flex;
    justify-content: center;
    gap: 1px;
    margin: auto;
    width: 400px;
}

.upper-row{
    padding-top: 4rem;
    padding-bottom: 5px;
}

.lower-row{
    padding-top: 2px;
    padding-bottom: 1rem;
}

.number-row .number-box {
    border: 2px solid #000;
    padding: 6px;
    width: 40px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    font-weight: bold;
}

.box-separator{
    width: 35px;
}

.triangle-wrapper {
    position: relative;
    width: 400px;
    height: 230px;
    margin: 0 auto;
}

.triangle {
    position: absolute;
    width: 0;
    height: 0;
}

.triangle.up {
    top: 58%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-left: 178px solid transparent;
    border-right: 178px solid transparent;
    border-bottom: 178px solid white;
    opacity: 1;
    z-index: 1;
}

.triangle.down {
    top: 34%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-left: 241px solid transparent;
    border-right: 241px solid transparent;
    border-top: 241px solid white;
    opacity: 1;
    z-index: 2;
}

.diamond {
    position: absolute;
    top: 61%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 54px;
    height: 54px;
    z-index: 3;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 32px;
    transform-origin: center;
}

.diamond-text {
    transform: rotate(-45deg);
    font-size: 32px;
    font-weight: bold;
}

.diamond-wood{
    background-color: var(--number-wood-light);
}
.diamond-wood .diamond-text{
    color: var(--number-wood);
}
.diamond-fire{
    background-color: var(--number-fire-light);
}
.diamond-fire .diamond-text{
    color: var(--number-fire);
}
.diamond-earth{
    background-color: var(--number-earth-light);
}
.diamond-earth .diamond-text{
    color: var(--number-earth);
}
.diamond-metal{
    background-color: var(--number-metal-light);
}
.diamond-metal .diamond-text{
    color: var(--number-metal);
}
.diamond-water{
    background-color: var(--number-water-light);
}
.diamond-water .diamond-text{
    color: var(--number-water);
}

.number-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 4;
    pointer-events: none;
}

.num {
    position: absolute;
    font-size: 22px;
    font-weight: bold;
    color: black;
}

/* Place numbers around the triangles */
.n-6 { top: 10px; left: 90px; }
.n-7 { top: 10px; left: 150px; }
.n-2 { top: 10px; right: 150px; }
.n-3 { top: 10px; right: 90px; }

.n-4 { top: 65px; left: 150px; }
.n-5 { top: 65px; right: 150px; }

.n-5b { bottom: 15px; left: 150px; }
.n-4b { bottom: 15px; right: 150px; }

.circled-num {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* Position the circled numbers */
.circle-1 { top: -112px; left: 175px; }
.circle-2 { top: 115px; left: 0px; }
.circle-3 { top: 115px; right: 0px; }
.num-north{
    border: 3px solid rgb(32, 58, 255);
    background-color: #a5d4f5;
    color:rgb(18, 59, 104);
}
.num-west{
    border: 3px solid #ddd;
    background-color: #fff;
    color: #000;
}
.num-east{
    border: 3px solid rgb(3, 77, 24);
    background-color: rgb(149, 250, 178);
    color: rgb(3, 77, 24);
}
.num-south{
    border: 3px solid rgb(130, 0, 0);
    background-color: rgb(255, 219, 219);
    color: rgb(130, 0, 0);
}
.num-south-hard{
    border-radius: 50%;
    margin: 0 5px;
    border: 3px solid rgb(130, 0, 0) !important;
    font-size: 25px !important;
    width: 50px !important;
    height: 50px !important;
}

/* Chart container styling */
.mingpan-chart, .liunian-chart {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

/* Chart description box styling for personal number & liunian */
.chart-description-box {
    border: 2px solid #e74a3b;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    text-align: center;
    background-color: #fff;
}

.liunian-description {
    border-color: #4e73df;
}

.number-title {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
    position: relative;
    display: inline-block;
}

.title-divider {
    display: inline-block;
    width: 15px;
    margin: 0 10px;
    border-top: 2px solid #333;
    vertical-align: middle;
}

.number-description {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 10px;
    color: #555;
}

.number-footer {
    font-size: 18px;
    font-weight: bold;
    color: #e74a3b;
}

.liunian-description .number-description {
    color: #555;
    font-size: 16px;
}
.liunian-description .number-footer {
    color: #4e73df;
    font-size: 18px;
}

/* 我的命盘 */
.chart-box {
    background-color: #f8f9fc;
    border: 2px solid #4e73df;
    border-radius: 15px;
    padding: 10px;
    text-align: center;
    height: 100%;
    min-height: 152px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.chart-title {
    color: #5a5c69;
    font-size: 1.2rem;
    font-weight: 600;
}

.chart-value {
    font-weight: bold;
}

.chart-box .large-value {
    font-size: 4rem;
}

.my-number{
    border: 1px solid transparent;
    padding: 10px;
    border-radius: 5%;
}

/* 我的数字 / 生肖 */
.personal-number-table td{
    border-bottom-width: 0px;
}

/* Styling for number badges and presence/absence boxes 有数/缺失: */
.presence-box,
.absence-box {
    border: 2px solid #4e73df;
    border-radius: 8px;
    padding: 10px 15px;
    background-color: #f8f9fc;
}

.absence-box {
    border-color: #e74a3b;
}

.presence-title,
.absence-title {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 15px;
}

.presence-title {
    color: #4e73df;
}

.absence-title {
    color: #e74a3b;
}

.presence-numbers,
.absence-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.number-badge {
    display: inline-block;
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    border-radius: 50%;
    font-weight: bold;
    background-color: #4e73df;
    color: white;
    border: 0px solid transparent;
}

.missing-number {
    background-color: #e74a3b;
}

/* Optional: Different colors for different numbers */
.number-1, .number-6 { background-color: var(--number-metal-light); color: var(--number-metal); border-color: var(--number-metal); }
.number-2, .number-7 { background-color: var(--number-water-light);  color: var(--number-water); border-color: var(--number-water); }
.number-4, .number-9 { background-color: var(--number-wood-light);  color: var(--number-wood); border-color: var(--number-wood); }
.number-3, .number-8 { background-color: var(--number-fire-light);  color: var(--number-fire); border-color: var(--number-fire); }
.number-5 { background-color: var(--number-earth-light);  color: var(--number-earth); border-color: var(--number-earth); }

/* Five Elements Table Styling 个人五行 / 流年五行 */
.five-element-table {
    width: 100%;
    margin-top: 15px;
    font-size: 16px;
    border-collapse: collapse;
    border: 2px solid #000;
}

.five-element-table th,
.five-element-table td {
    text-align: center;
    vertical-align: middle;
    padding: 6px;
    border: 1px solid #ddd;
}

.table-header th {
    background-color: #f2f2f2;
    font-weight: bold;
}
.table-header th.with-badge {
    padding: 3px !important;
}

.element-names td {
    font-weight: bold;
    background-color: #f0f0f0;
}

.element-values td {
    font-weight: bold;
}

.comparison-values td {
    font-size: 16px;
    color: #666;
}

.text-danger {
    color: #e74a3b !important;
}

.text-success {
    color: #1cc88a !important;
}

.text-warning {
    color: #f6c23e !important;
}
.fe-green{
    color: rgb(0, 132, 37);
}
.fe-red{
    color: rgb(239, 29, 29);
}
.fe-orange{
    color: rgb(239, 130, 28);
}

/* 5 Element tables styling 数字五行 */
.five-element-info-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 14px;
}

.five-element-info-table th, 
.five-element-info-table td {
    border: 1px solid #ddd;
    padding: 4px;
    text-align: center;
    vertical-align: middle;
}

.five-element-info-table .table-header th {
    background-color: #f2f2f2;
    font-weight: bold;
    padding: 10px;
    border-bottom: 2px solid #ddd;
}

.five-element-info-table .header-row th {
    background-color: #f8f9fc;
    font-weight: bold;
    font-size: 13px;
}

.five-element-relation-table {
    border-collapse: collapse;
    width: 100%;
}

.five-element-relation-table th, 
.five-element-relation-table td {
    border: 1px solid #ddd;
    padding: 6px 8px;
    text-align: center;
    vertical-align: middle;
    font-size: 13px;
}

.five-element-relation-table .table-header th {
    background-color: #f2f2f2;
    padding: 10px;
    font-weight: bold;
}

.five-element-relation-table .sub-header-row th {
    background-color: #f8f9fc;
    font-size: 14px;
    padding: 5px;
}

.sub-header-row .normal-desc{
    font-weight: normal;
}

.explanation-cell {
    text-align: left;
    padding: 10px 15px;
    line-height: 1.5;
}

.highlight-orange {
    color: #fd7e14;
    font-weight: bold;
}

.conclusion-cell {
    text-align: center;
    font-weight: bold;
    padding: 10px;
    background-color: #f8f9fc;
}

/* 个人风水 - 四神兽 */
.four-animal-circle{
    border-radius: 50%;
    width: 32px;
    height: 32px;
    border-width: 2px;
    line-height: 28px;
    display: inline-block;
}

/* 81 Pairs Table styling */
.pairs-table {
    font-size: 13px;
    border-collapse: collapse;
}

.pairs-table th {
    background-color: #f2f2f2;
    text-align: center;
    padding: 8px;
}

.pairs-table td {
    padding: 8px;
    vertical-align: middle;
    text-align: center;
}

.pairs-table tr:nth-child(4n+1),
.pairs-table tr:nth-child(4n+2) {
    background-color: #f8f9fc;
}

.pairs-detail {
    text-align: left !important;
    padding: 10px 15px;
    background-color: #f8f9fc;
    line-height: 1.5;
    font-size: 13px;
}
.pairs-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}


/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .table-bordered th, .table-bordered td, tr.header-row th, tr.header-row td, tr.sub-header-row th{
        font-size: 1rem;
    }

    .row{
        padding: 1rem 0 0 0 !important;
        margin-left: 0px;
    }
}

/* User Owner Number Section in Number List */
.user-number-display {
    font-size: 1.8rem;
    text-align: center;
    color: var(--text-dark);
}
.user-number-display .number-char {
    margin: 0 0.5rem;
    font-weight: bold;
}