/* Container Override */
.container {
    max-width: 100% !important;
    padding: 1rem;
}

/* Card Override */
.card {
    max-width: 100%;
}

.card-bazi-header {
    padding: 0.75rem;
}

span.bazi-person-info {
    display: block;
    font-size: 0.9rem;
    font-weight: normal;
}

.card-bazi-header .bazi-life-palace {
    line-height: 1.3rem;
}

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

/* BaZi Table Styles */
.bazi-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--dark-purple);
    background-color: transparent;
    table-layout: fixed;
}

.bazi-table th {
    text-align: center;
    vertical-align: middle;
    color: var(--text-dark);
    font-weight: 500;
    padding: 0.3rem;
    border: 1px solid var(--dark-purple);
}

.bazi-table td {
    text-align: center;
    vertical-align: middle;
    padding: 0.3rem;
    border: 1px solid var(--dark-purple);
    background-color: transparent;
}

/* Day column specific styling */
.main-bazi-table > thead > tr > th:nth-child(3),
.main-bazi-table > tbody > tr > td:nth-child(3) {
    background-color: var(--light-purple);
}

/* Add borders between pillars */
.bazi-table th:not(:last-child),
.bazi-table td:not(:last-child) {
    border-right: 1px solid var(--dark-purple);
}

/* Add borders between main sections */
.bazi-table tr.heavenly-stems td,
.bazi-table tr.earthly-branches td {
    border-bottom: 1px solid var(--dark-purple);
}

.heavenly-stems td {
    font-size: 2em;
    padding: 0.3rem;
    position: relative;
}

.earthly-branches td {
    font-size: 2em;
    padding: 0.3rem;
    position: relative;
}

.ten-god {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    font-size: 0.8rem;
    color: #000000;
}

.hidden-gods td {
    padding: 0.3rem;
}

.hidden-gods-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    white-space: nowrap;
}

.hidden-gods-table td {
    border: none !important;
    padding: 0.0rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
}

.center-cell {
    text-align: center;
    font-size: 1.2em;
    width: 40%;
}

.side-cell {
    text-align: center;
    font-size: 1em;
    width: 30%;
}

.small {
    font-size: 0.8em;
}

.sha-gods td {
    padding: 0.3rem;
    vertical-align: top;
    line-height: 1.2;
    white-space: normal;
    word-wrap: break-word;
    font-size: 0.9em;
}

.branch-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 50px;
}

.earth-element {
    font-size: 0.6em;
    color: #000;
    margin-top: 0.2em;
}

.emptiness {
    position: absolute;
    top: 0px;
    left: 0px;
    font-size: 11px;
    line-height: 1;
    background-color: black;
    color: white;
    padding: 1px 3px;
    border-radius: 3px;
}

.sha-gods .good-god { color: red; }
.sha-gods .bad-god { color: black; }
.sha-gods .neutral-god { color: blue; }
.sha-gods{
    font-size:0.95em;
}

/* Button Styles */
.bazi-btn {
    background-color: var(--dark-purple);
    border-color: var(--dark-purple);
    color: #fff;
}

.bazi-btn:hover {
    background-color: var(--hover-purple);
    border-color: var(--hover-purple);
    color: #fff;
}

/* Add styles for the row label column */
.row-label {
    font-size: 0.9rem;
    color: #666;
    text-align: center;
    vertical-align: middle;
    border-right: 2px solid #dee2e6;
    background-color: transparent !important;
    font-weight: normal;
    white-space: nowrap !important;
}

/* Style the first column header to match */
.bazi-table > thead > tr > th {
    font-size: 0.9rem;
    color: #666;
    background-color: transparent;
    font-weight: normal;
}

/* Ensure the title column cells don't get overridden by other styles */
.bazi-table > tbody > tr > td:first-child {
    background-color: transparent !important;
    font-size: 0.9rem;
    color: #666;
}

/* Add styles for the element tags */
.element-tag {
    font-size: 0.8em;
    color: #666;
    vertical-align: super;
}

/* Hidden Gods New Layout */
.hidden-gods-new-layout {
    width: 100%;
    border-collapse: collapse;
    margin: 0 auto;
}

.hidden-gods-new-layout tr:last-child {
    border-bottom: none;
}

.hidden-gods-new-layout td {
    padding: 4px;
    border: none !important;
}

td.god-cell {
    text-align: right;
    font-weight: normal;
    color: #666;
    font-size: 0.9rem;
    width: 50%;
    padding: 0 4px 0 0; 
}

td.ten-god-cell {
    text-align: left;
    font-size: 0.9rem;
    width: 50%;
    padding: 0 0 0 4px;
    white-space: nowrap;
}

tr.star-luck td, tr.self-sitting td {
    font-size: 0.9em;
}

/* Give some vertical padding to the hidden gods row */
.hidden-gods td {
    vertical-align: top;
}

/* Sha God Locations Display */
table.shagod-location-table td {
    border: 1px solid var(--dark-purple);
}

.god-names-row td {
    background-color: var(--light-purple);
    font-size: 0.9rem;
    color: #333;
    text-align: center;
    padding: 4px;
    border-bottom: none;
    font-weight: bold;
}

.god-locations-row td {
    text-align: center;
    padding: 4px;
    border-top: none;
}

.god-locations-row span {
    color: red;
    font-size: 0.9rem;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .bazi-table th,
    .bazi-table td {
        padding: 0.25rem;
    }

    /* Ensure the title row and title column cells don't get overridden by other styles */
    .bazi-table > thead > tr > th, .bazi-table > tbody > tr > td:first-child {
        font-size: 0.7rem;
    }

    td.god-cell, td.ten-god-cell {
        font-size: 1rem;
    }
    td.god-cell {
        padding: 0 4px 0 0; 
        font-size: 0.9rem;
    }
    td.ten-god-cell {
        padding: 0 0 0 4px; 
        font-size: 0.9rem;
    }

    .current-year-column .god-cell,
    .current-10year-column .god-cell,
    .current-year-column .ten-god-cell,
    .current-10year-column .ten-god-cell{
        padding: 0 0 0 2px;
        font-size: 0.8rem;
        line-height: 1.35rem;
    }

    .god-names-row td {
        padding: 2px;
        font-size: 1rem;
    }
    .god-locations-row span {
        padding: 2px;
        font-size: 0.9rem;
    }

    .heavenly-stems td,
    .earthly-branches td {
        padding: 0.25rem;
    }
    
    .ten-god {
        font-size: 0.5em;
        top: 0.1rem;
        right: 0.1rem;
    }
    
    .hidden-gods-table td {
        padding: 0.15rem;
        font-size: 0.9em;
    }
    
    .small {
        font-size: 0.7em;
    }
    
    .sha-gods td {
        padding: 4px;
    }
}

.button16px{
    width: 16px;
}

.bazi-text {
    font-size: 1.1em;
    line-height: 1.2;
}

.god-row, .earth-row {
    white-space: nowrap;
}

.bazi-char {
    margin: 0 0.5em;
    display: inline-block;
    min-width: 1em;
    text-align: center;
}
.bazi-char:first-child {
    margin-left: 0;
}

@media (max-width: 480px) {
    .container {
        padding: 0.5rem;
    }
    
    .heavenly-stems td,
    .earthly-branches td {
        font-size: 2.5em;
        padding: 0.2rem;
    }
    
    .heavenly-stems td.current-year-column,
    .heavenly-stems td.current-10year-column,
    .earthly-branches td.current-year-column,
    .earthly-branches td.current-10year-column{
        font-size: 2em;
        padding: 0.2rem;
    }
    
    .ten-god {
        font-size: 0.35em;
    }
    
    .hidden-gods-table td {
        padding: 0.1rem;
        font-size: 1em;
    }
    
    .center-cell {
    }
    
    .side-cell {
        font-size: 0.7em;
    }
    
    .small {
        font-size: 0.75em !important;
    }
    
    .sha-gods td {
        padding: 3px;
        vertical-align: top;
    }
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--dark-purple);
    color: var(--dark-purple);
}

.btn-outline:hover {
    background-color: var(--dark-purple);
    color: white;
}

.empty-pillar {
    display: inline-block;
    width: 1em;
    visibility: hidden;
}

/* Five Elements Colors */
.element-wood {
    color: #2E8B57; /* Green */
    font-weight: bold;
}

.element-fire {
    color: #ff3030; /* Red */
    font-weight: bold;
}

.element-earth {
    color: #ce8652; /* Brown */
    font-weight: bold;
}

.element-metal {
    color: #8e8d96; /* Gray */
    font-weight: bold;
}

.element-water {
    color: #096cff; /* Blue */
    font-weight: bold;
}

/* Day pillar bold styling */
.day-pillar {
    font-weight: bold;
}

/* Ten Year Fate Table Styles */
.ten-year-fate-table th {
    font-size: 0.9em;
    padding: 0.5rem;
    white-space: nowrap;
}

.ten-year-fate-table td {
    font-size: 1.5em;
    padding: 0.5rem;
}

.ten-year-fate-table .row-label {
    font-size: 1em;
    font-weight: 500;
    white-space: nowrap;
}

.ten-year-fate-table .hidden-gods-new-layout {
    width: 100%;
    border-collapse: collapse;
    margin: 0 auto;
}

.ten-year-fate-table .hidden-gods-new-layout td {
    padding: 4px;
    border: none !important;
    font-size: 1rem;
}

.ten-year-fate-table td.god-cell {
    text-align: center;
    font-weight: normal;
    /* color: #000; */
    font-size: 1.5rem;
}

.ten-year-fate-table td.ten-god-cell {
    text-align: center;
    white-space: nowrap;
}

.ten-year-fate-table td.god-cell-sub {
    text-align: right;
    color: #666;
    width: 50%;
    padding: 0 4px 0 0;
    font-size: 0.9rem;
}

.ten-year-fate-table td.ten-god-cell-sub {
    text-align: left;
    width: 50%;
    padding: 0 0 0 4px;
    font-size: 0.9rem;
    white-space: nowrap;
}

.ten-year-fate-info {
    text-align: right;
    font-size: 0.9em;
}

/* Current column highlighting */
.ten-year-fate-table th.current-column,
.ten-year-fate-table td.current-column {
    background-color: var(--light-purple);
    font-weight: bold;
    position: relative;
}

/* Current year and 10-year column styles */
.current-year-column,
.current-10year-column {
    color: rgba(0, 0, 0, 0.55); /* Make text slightly lighter */
}

.current-year-column .god-cell,
.current-year-column .ten-god-cell,
.current-10year-column .god-cell,
.current-10year-column .ten-god-cell {
    color: rgba(0, 0, 0, 0.55); /* Make text slightly lighter */
}

.ten-year-fate-table th.current-column::after,
.ten-year-fate-table td.current-column::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

@media (max-width: 768px) {
    .ten-year-fate-table th,
    .ten-year-fate-table td {
        font-size: 1rem;
        padding: 0.3rem;
    }
    
    .ten-year-fate-table .row-label {
        font-size: 1rem;
    }

    .ten-year-fate-table .hidden-gods-new-layout td {
        font-size: 1rem;
        padding: 2px;
    }

    .ten-year-fate-table td.ten-god-cell-sub, .ten-year-fate-table td.god-cell-sub  {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .ten-year-fate-table{
        width: auto !important;
    }
    .year-fate-table{
        width: 100% !important;
    }
}