/* Liuyao Results */
td{
	/* border:1px solid #000; */
}
table.liuyao{
	border:0px solid #000;
}
table.liuyao_inner td{
	border:1px solid #000;
}
.yao1{
	width:100px;
	height:10px;
	border:1px solid black;
	background-color: black;
}
.yao01{
	width:45px;
	height:10px;
	border:1px solid black;
	background-color: black;
	float:left;
}
.yao02{
	width:10px;
	height:10px;
	display: block;
	/* border:1px solid black; */
	float:left;
}
.yao03{
	width:45px;
	height:10px;
	border:1px solid black;
	background-color: black;
	float:left;
}
.changeyao div{
	background-color: red !important;
	border: 1px solid red;
}
.center_td td{
	text-align: center;
}
.god6{
	width: 55px;
}
.hgod{
	text-align: left !important;
}
.qin6{
	text-align: left !important;
}
.yao{
	width: 122px;
	padding-left: 10px;
}
.yaodiv{
	width: 100px;
}
.yaod{
	width: 40px;
	color: red;
	font-size: 12px;
	padding: 0 1px;
}
table.yaochangetable{
	border: 0px solid #000 !important;
	border-collapse: collapse;
}
.yaochangetable td{
	border: 0px solid #000 !important;
	padding: 0px;
}
.yaochangetable .yaochange{
	font-size: 17px;
	color: red;
	font-weight: bold;
	margin-left: 6px;
	margin-right: 4px;
}
.yaoc{
	/* width: 112px; */
	padding: 0 10px 0 0;
	border-left: 0px !important;
}
.qin6m div, .qin6d div{ /* apply to <div id="qin6{1-6}_day"> and <div id="qin6{1-6}_month"> */
	margin-top: -1px;
}
.yaoac{
	padding: 0;
	border-right: 0px !important;
}
table.yao_after_change_table{
	border: 0px solid #000 !important;
	border-collapse: collapse;
}
.yao_after_change_table td{
	border: 0px solid #000 !important;
	padding: 0px;
}
.ly_addinfo{
	font-size:10px;
}
.yaoac .yaoac_text{
	font-size: 12px;
	color: red;
	margin-left: 4px;
	margin-right: 4px;
	text-align: right;
}
.ly_direct-1{
	color: white;
	background-color: red;
	border: 1px solid red;
}
.ly_direct--1{
	color: white;
	background-color: black;
	border: 1px solid black;
}
.ly_changed-sameday{
	color: red;
	font-weight: bold;
	/* border: 1px solid red; */
}
.yaoac div span{/*applies to .ly_direct-1, .ly_direct--1, .ly_changed-sameday*/
	/* display: block; */
	border-radius: 3px;
	/* float: left; */
	margin: 0 2px 0 0;
}
.qin6m div, .qin6d div{
	text-align: right;
}
.qin6m div span, .qin6d div span{
	/* display: block;
	float: left; */
	margin: 0 1px 0 1px;
}
.ly_empty{
	border:1px solid black;
	background-color: black;
	color: white;
	border-radius: 3px;
}
.ly_produce, .ly_6harmony, .ly_counter-6harmony, .ly_produce-6harmony, .ly_same, .ly_same5e{
	color: red;
	border: 1px solid red;
	border-radius: 3px;
}
.ly_counter, .ly_clash, .ly_harm, .ly_punish{
	color: black;
	border: 1px solid black;
	border-radius: 3px;
}
.ly_cs12-0, .ly_cs12-4{
	color: red;
}
.ly_cs12-1, .ly_cs12-2, .ly_cs12-3, .ly_cs12-5, .ly_cs12-6, .ly_cs12-7, .ly_cs12-8, .ly_cs12-9, .ly_cs12-10, .ly_cs12-11{
	color: black;
}
.ly_cs12-0, .ly_cs12-1, .ly_cs12-2, .ly_cs12-3, .ly_cs12-4, .ly_cs12-5, .ly_cs12-6, .ly_cs12-7, .ly_cs12-8, .ly_cs12-9, .ly_cs12-10, .ly_cs12-11{
	text-align: center;
	background-color: rgb(255, 223, 175);
	/* float: right !important; */
	border: 1px solid rgb(108, 108, 108);
	border-radius: 3px;
}

.ly_greyed_out{
	color: rgba(192, 192, 192);
}
.ly_shibody, .ly_guabody{
	color: black;
	border: 1px solid black;
	border-radius: 3px;
	background-color: rgba(228, 228, 228);
	display: inline-block;
	width: 14px;
	height: 25px;
	line-height: 11px;
	white-space: pre;
	margin-left: 1px;
	text-align: center;
}
td.qin6, td.hgod{
	border-left: 0px !important;
}
td.sbgb{
	border-right: 0px !important;
	text-align: left;
}

div.action-section{
    display: flex;
	border: 0px solid #000;
	padding: 5px 0;
    margin-top: 5px;
}
div.action_buttons{
}
div.action_message{
	float: left;
	text-align: right;
	margin-left: 5px;
    line-height: 40px;
}

/* Container and Layout */
.liuyao-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    background-color: #fff;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.page-header h1 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

.page-actions {
    display: flex;
    gap: 1rem;
}

/* Action Links and Buttons */
.action-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    background-color: #e9d5ff;
    color: #000;
    text-decoration: none;
    font-size: 0.875rem;
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
}

.action-link:hover {
    background-color: #d8b4fe;
    color: #000;
    text-decoration: none;
}

/* Form Styles */
.liuyao-form {
    /* margin-top: 2rem; */
}

.form-group {
    /* margin-bottom: 1.5rem; */
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #333;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: #d8b4fe;
    outline: none;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

/* Error Message */
#error_message {
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 4px;
    background-color: #fff3cd;
    color: #856404;
    display: none;
}

#error_message:not(:empty) {
    display: block;
}

/* Result Section */
.result-section {
    /* background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); */
}

/* Liuyao Specific Styles */
td {
    /* border: 1px solid #000; */
}

table.liuyao {
    border: 0px solid #000;
}

table.liuyao_inner td {
    border: 1px solid #000;
}

.yao1 {
    width: 100px;
    height: 10px;
    border: 1px solid black;
    background-color: black;
}

.yao01 {
    width: 45px;
    height: 10px;
    border: 1px solid black;
    background-color: black;
    float: left;
}

.yao02 {
    width: 10px;
    height: 10px;
    display: block;
    float: left;
}

.yao03 {
    width: 45px;
    height: 10px;
    border: 1px solid black;
    background-color: black;
    float: left;
}

.changeyao div {
    background-color: red !important;
    border: 1px solid red;
}

.center_td td {
    text-align: center;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .liuyao-container {
        padding: 1rem;
    }

    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .table th,
    .table td {
        padding: 0.5rem;
    }

    .form-control {
        font-size: 0.875rem;
    }
}

/* Utility Classes */
.text-nowrap {
    white-space: nowrap;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Action Icons */
.chart-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.chart-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    background-color: #e9d5ff;
    color: #000;
    border: none;
    transition: all 0.2s;
    cursor: pointer;
}

.chart-action-btn:hover {
    background-color: #d8b4fe;
}

.chart-action-btn i {
    font-size: 1rem;
}

/* Reading Section */
.reading-section {
    margin-top: 1rem;
    width: 100%;
}

.reading-table {
    width: 100%;
}

.reading-table td {
    padding: 0.75rem 0;
}

.reading-table textarea {
    width: 100%;
    min-height: 120px;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    resize: vertical;
    font-size: 0.875rem;
    line-height: 1.5;
}

.liuyao-container {
    padding: 0.5rem 1rem;
}

.page-header {
    text-align: center;
    margin-bottom: 1rem;
}

.page-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0;
}

.liuyao-form {
    /* background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */
}

.section-header {
    background-color: var(--light-purple);
    padding: 0.75rem 1rem;
    margin: 0 -1.5rem 1.5rem;
    color: var(--text-dark);
    font-weight: 500;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: #495057;
    font-weight: 500;
}

.form-label.required::after {
    content: "*";
    color: #dc3545;
    margin-left: 0.25rem;
}

.form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #000;
    border-radius: 4px;
    font-size: 0.9rem;
}

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.datetime-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.25rem 0;
    flex-wrap: nowrap;
    width: 100%;
}

.use-current-time {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
    font-size: 0.85rem;
}

.current-time {
    font-family: monospace;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.datetime-group {
    position: relative;
    flex: 1;
    min-width: 0;
}

.datetime-group .form-control {
    /* padding: 0.5rem 2.5rem 0.5rem 0.75rem; */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 100%;
    font-size: 0.9rem;
    background-color: white;
}

.calendar-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--dark-purple);
    pointer-events: none;
}

.input-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.input-table td {
    padding: 0.25rem;
    vertical-align: middle;
}

.input-table td:first-child {
    width: 80px;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 1rem;
}

.question-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #000;
    border-radius: 8px;
    font-size: 0.9rem;
    background-color: white;
    transition: border-color 0.2s;
}

.question-input:focus {
    outline: none;
    border-color: var(--dark-purple);
    box-shadow: 0 0 0 2px rgba(var(--dark-purple-rgb), 0.1);
}

.yao-options {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: nowrap;
}

.yao-option {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
}

.yao-option label {
    cursor: pointer;
    font-size: 3rem;
    line-height: 1.5rem;
	font-weight: bold;
    color: var(--text-dark);
}

.liuyao-entry .changeyao{
	color: red;
    font-size: 2rem;
}

.submit-row {
    text-align: center;
    padding-top: 1rem !important;
}

.submit-button {
    background: var(--dark-purple);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
}

.hidden-inputs {
    display: none;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.action-button {
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.action-button.primary {
    background: var(--dark-purple);
    color: white;
}

.action-button.secondary {
    background: var(--light-purple);
    color: var(--text-dark);
}

.action-button:hover {
    opacity: 0.9;
}

.error-message {
    color: #dc3545;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    background: #fff5f5;
    display: none;
}

.liuyao-action-column {
    width: 66px;
}

.liuyao-datetime {
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .liuyao-form {
        padding: 1rem;
    }
    
    .input-table td:first-child {
        width: 80px;
    }
    
    .datetime-section {
        flex-wrap: nowrap;
    }
    
    .datetime-group {
        flex: 1;
    }
    
    .yao-options {
        flex-wrap: nowrap;
        gap: 0.5rem;
    }
    
    .yao-option label {
        font-size: 0.8rem;
    }

    .liuyao-action-column {
        width: 50px;
    }

    .liuyao-datetime {
        font-size: 0.7rem;
    }
}

/* Fullscreen Mode */
.fullscreen-mode {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.fullscreen-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    /* padding: 20px; */
}

.fullscreen-content .result-section {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Yao options styling */
td.yao-column{
    padding: 0;
}

.yao-options-container {
    width: 100%;
}

.yao-options-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    border-spacing: 0;
}

.yao-options-table td {
    width: 25%;
    padding: 0;
    text-align: center;
}

.yao-cell {
    cursor: pointer;
    padding: 10px 5px;
    transition: background-color 0.2s;
    position: relative;
    border: 1px solid #ddd;
}

.yao-cell:hover {
    background-color: #f0f0f0;
}

.yao-cell.selected {
    background-color: var(--light-purple);
}

.hidden-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.yao-option {
    display: inline-block;
    font-weight: bold;
    font-size: 1.4rem;
    line-height: 3rem;
}

.yang-yao {
    color: #333;
}

.yin-yao {
    color: #333;
}

.changing-yang {
    color: #e53935; /* Red */
}

.changing-yin {
    color: #e53935; /* Red */
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .yao-cell {
        padding: 12px 2px;
    }
    
    .yao-option {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .yao-options-table {
        width: 100%;
    }
    
    .yao-cell {
        padding: 15px 2px;
    }
}