/* apps/maihoa.css */

.maihoa-tabs-wrapper .nav-pills .nav-link {
    background: #fff;
    color: #444;
    border: 1px solid #dee2e6;
    margin: 0 5px;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.3s;
}

.maihoa-tabs-wrapper .nav-pills .nav-link.active {
    background: #c0392b;
    color: #fff;
    border-color: #c0392b;
    box-shadow: 0 4px 10px rgba(192, 57, 43, 0.3);
}

.maihoa-tabs-wrapper .nav-pills .nav-link:hover:not(.active) {
    background: #f8f9fa;
    border-color: #c0392b;
}

.maihoa-guide h3 {
    color: #c0392b;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.maihoa-guide p {
    color: #555;
    line-height: 1.6;
    font-size: 0.95rem;
}

.maihoa-header h1 {
    font-family: 'Be Vietnam Pro', sans-serif;
    letter-spacing: 1px;
}

/* Professional Result Styles */
/* Mai Hoa Form Layout Scaling */
#content-maihoa-lap-que .card {
    max-width: 800px;
    margin: 0 auto;
}

.maihoa-guide {
    max-width: 800px;
    margin: 3rem auto 0;
}

#maihoa-result-summary {
    max-width: 950px;
    margin: 0 auto;
}

.maihoa-result-card {
    background-color: #fff;
    border: none;
    padding: 5px 15px;
    max-width: 900px;
    margin: 0 auto;
    font-family: Arial, Helvetica, sans-serif;
    color: #111;
}

.document-header {
    position: relative;
    border-bottom: 2px solid #ddd;
    padding-bottom: 5px;
    margin-bottom: 2px;
}

.document-header-img {
    position: absolute;
    right: 0;
    top: 5px;
    height: 90px;
    width: auto;
    object-fit: contain;
    opacity: 0.85;
}

.document-header-title {
    font-size: 1.1rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.maihoa-info-grid {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.85rem;
}

.maihoa-info-row {
    display: flex;
    flex-wrap: wrap;
    line-height: 1.4;
}

.maihoa-info-label {
    min-width: 150px;
}

.maihoa-calligraphy {
    position: absolute;
    right: 0;
    top: 5px;
    height: 100px;
}

/* Hexagram Section */
.hexagrams-container {
    border-bottom: thin solid #ccc;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.que-title {
    font-size: 0.95rem;
    font-weight: bold;
    color: #9b27b0;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.que-subtitle {
    font-size: 0.8rem;
    color: #888;
    margin-top: 5px;
    text-transform: uppercase;
}

/* Hexagram Line Drawing */
.line-draw-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
    height: 14px;
}

.line-segment {
    height: 10px;
}

.line-solid {
    width: 90px;
    background: #0056b3;
    /* Default blue for static */
    border-radius: 2px;
}

.line-broken {
    width: 90px;
    display: flex;
    justify-content: space-between;
}

.line-broken .half {
    width: 38px;
    height: 10px;
    background: #0056b3;
    /* Default blue for static */
    border-radius: 2px;
}

/* Moving line override - RED */
tr.moving-row .line-solid,
tr.moving-row .line-broken .half,
.line-moving,
.line-moving .half {
    background: #c0392b !important;
}

/* Hexagram Graphic Overrides */
.hex-graphic-static .line-solid,
.hex-graphic-static .line-broken .half {
    background: #0056b3 !important;
}

.hex-graphic-moving .line-solid,
.hex-graphic-moving .line-broken .half {
    background: #c0392b !important;
}

/* Table Area */
.hex-table-container {
    position: relative;
    display: flex;
}

.left-panel,
.right-panel {
    flex: 1;
}

.left-panel {
    padding-right: 15px;
}

.right-panel {
    padding-left: 15px;
    border-left: thin solid #999;
}

.omen-header {
    font-size: 1.05rem;
    font-weight: bold;
    text-transform: uppercase;
    text-align: center;
    padding: 8px 0;
    margin-bottom: 10px;
    border-bottom: thin solid #ccc;
}

.hex-table {
    width: 100%;
    border-collapse: collapse;
}

.hex-table th {
    font-size: 0.8rem;
    padding: 4px 0;
    text-align: left;
    border-bottom: 2px solid #ccc;
    color: #111;
}

.hex-table td {
    padding: 2px 0;
    font-size: 0.85rem;
}

/* RED TEXT for entire moving row */
tr.moving-row td {
    color: #c0392b !important;
}

/* Specific alignments */
.text-center {
    text-align: center !important;
}

/* Hao specific icon in table */
.hao-icon {
    display: inline-block;
    width: 24px;
    vertical-align: middle;
}

.hao-icon-solid {
    height: 4px;
    background-color: #0056b3;
    border-radius: 1px;
}

.hao-icon-broken {
    height: 4px;
    display: flex;
    justify-content: space-between;
}

.hao-icon-broken .h-half {
    width: 10px;
    background-color: #0056b3;
    border-radius: 1px;
}

tr.moving-row .hao-icon-solid,
tr.moving-row .hao-icon-broken .h-half {
    background-color: #c0392b !important;
}

/* Footer */
.maihoa-footer {
    text-align: center;
    font-size: 0.85rem;
    color: #555;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.maihoa-footer span.font-weight-bold {
    color: #333;
}

.facebook-btn {
    display: inline-flex;
    align-items: center;
    background-color: #3b5998;
    color: white !important;
    padding: 2px 5px;
    text-decoration: none;
    font-size: 0.8rem;
    margin: 0 4px;
}

/* Tứ Trụ (Four Pillars) Chart Styles */
.tutru-chart-container {
    margin-top: 30px;
    border-top: 2px solid #c0392b;
    padding-top: 20px;
    background-color: #fff;
}

.tutru-title {
    color: #c0392b;
    font-size: 1.4rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.tutru-personal-info {
    margin-bottom: 15px;
    font-size: 0.9rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.tutru-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.tutru-table th,
.tutru-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

.tutru-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.pillar-label {
    background-color: #eee;
    font-weight: bold;
    width: 120px;
    text-align: left !important;
}

.nhat-chu {
    background-color: #fff3cd;
    font-weight: bold;
    color: #856404;
}

/* Luck Cycles & Annual Luck */
.luck-section {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.luck-column {
    flex: 1;
    min-width: 300px;
}

.luck-title {
    font-weight: bold;
    border-bottom: 2px solid #c0392b;
    margin-bottom: 10px;
    padding-bottom: 5px;
    text-transform: uppercase;
    font-size: 0.95rem;
    color: #c0392b;
}

.luck-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
}

.luck-item {
    border: 1px solid #eee;
    padding: 5px;
    text-align: center;
    border-radius: 4px;
    background: #fafafa;
    transition: transform 0.2s;
}

.luck-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.luck-year {
    font-weight: bold;
    font-size: 0.85rem;
    color: #666;
}

.luck-gz {
    font-size: 0.95rem;
    font-weight: bold;
}

.luck-age {
    font-size: 0.75rem;
    color: #888;
}

/* Five Element Colors */
.text-mộc {
    color: #28a745 !important;
}

.text-hỏa {
    color: #dc3545 !important;
}

.text-thổ {
    color: #ffc107 !important;
}

.text-kim {
    color: #6c757d !important;
}

.text-thủy {
    color: #007bff !important;
}

/* Status mappings to Bootstrap colors if needed */
.text-success {
    color: #28a745 !important;
}

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

.text-warning {
    color: #ffc107 !important;
}

.text-secondary {
    color: #6c757d !important;
}

.text-primary {
    color: #007bff !important;
}

/* Lục Hào Results Styling */
.luchao-hex-section {
    background: #fdfdfd;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #eee;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.luchao-table {
    font-size: 0.85rem;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    margin-bottom: 0;
}

.luchao-table thead th {
    background: #f8f9fa;
    color: #2c3e50;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #c0392b;
    padding: 5px 5px;
}

.luchao-line-row td {
    padding: 5px 5px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.luchao-line-row:last-child td {
    border-bottom: none;
}

.luchao-line-cell {
    width: 120px;
}

.luchao-line-cell .line-segment {
    height: 10px;
    border-radius: 2px;
}

.que-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #c0392b;
    letter-spacing: 1px;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.luchao-omen {
    font-size: 1rem;
    font-weight: 700;
    color: #c0392b;
    border-left: 4px solid #c0392b;
    padding-left: 15px;
    margin-top: 15px;
}

.luchao-interpretation {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #eee;
}

.luchao-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    position: relative;
}

.luchao-section-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: #c0392b;
}

.luchao-item {
    padding: 12px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #eee;
    transition: all 0.3s ease;
}

.luchao-item:hover {
    background: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    border-color: #c0392b;
}

.luchao-category {
    font-weight: 700;
    color: #c0392b;
    margin-right: 8px;
    font-size: 0.9rem;
}

.luchao-desc {
    color: #555;
    font-size: 0.9rem;
}

.line-moving {
    background-color: #dc3545 !important;
}

.line-moving.line-broken .half {
    background-color: #dc3545 !important;
}