@import "default.css";

main {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr 0.7fr 0.7fr 1fr;
    grid-template-rows: 1fr 3fr 3fr;
    grid-gap: 15px;
    padding: 15px 15px 0 15px;
}

main > article:nth-of-type(6) {
    grid-column: span 2;
}
main > article:nth-of-type(9) {
    grid-column: span 2;
}
main > article:nth-of-type(10) {
    grid-column: span 2;
}
main > article:nth-of-type(5) {
    grid-row: span 2;
}

#dryer_list_container {
    overflow-y: scroll;
}

#dryer_list_container > label {
    display: block;
    width: calc(100% - 130px);
    height: 1.2rem;
    font-size: 1rem;
    padding: 0 40px 0.5rem 40px;
    margin: 15px 25px;
    border-bottom: 1px solid #999;
    position: relative;
    cursor: pointer;
    color: #aaa;
}

#dryer_list_container > label:hover {
    color: #000;
}

#dryer_list_container > input:checked + label {
    color: #000;
    pointer-events: none;
}

#dryer_list_container > label:before,
#sel_dryer_data_container > h5:before {
    content: "";
    display: block;
    position: absolute;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background-color: #aaa;
    left: 10px;
    top: 6px;
}

#dryer_list_container > label:after {
    content: ">";
    position: absolute;
    right: 10px;
    top: 6px;
}

#sel_dryer_data_container > h5.normal:before,
#dryer_list_container > label.normal:before {
    background-color: #298acd;
}

#sel_dryer_data_container > h5.alert:before,
#dryer_list_container > label.alert:before {
    background-color: #e6b451;
}

#sel_dryer_data_container > h5.warn:before,
#dryer_list_container > label.warn:before {
    background-color: #d96a59;
}

.a_header + #sel_dryer_data_container {
    width: calc(100% - 70px);
    height: calc(100% - 60px);
    padding: 15px 15px 25px 15px;
    margin: 0 20px 20px 20px;
    background-color: #ddd;
    display: grid;
    place-items: center;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1.3fr repeat(7, 1fr);
}

#sel_dryer_data_container > h5 {
    font-size: 1em;
    font-weight: normal;
    position: relative;
    width: calc(90% - 60px);
    padding: 0 30px;
    grid-column: span 2;
}

#sel_dryer_data_container > p {
    font-size: 0.9rem;
    white-space: nowrap;
}

#sel_dryer_data_container > p:nth-of-type(2n) {
    background-color: #298acd;
    border-radius: 15px;
    color: white;
    padding: 5px 15px;
}

#sel_dryer_data_container > p:nth-of-type(2n - 1) {
    width: calc(90% - 60px);
}

#sensor_info_container {
    display: grid;
    place-items: center;
    /*justify-items: center;*/
    /*align-items: start;*/
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    width: calc(100% - 40px);
    height: calc(100% - 25px);
    /*min-height: auto;*/
    padding: 0 20px 15px 20px;
    margin-top: 10px;
    grid-gap: 20px;
    position: relative;
}

#sensor_info_container > div {
    position: absolute;
    width: 100%;
    height: calc(100% + 15px);
    top: -15px;
    left: 0;
    background-color: rgba(200, 200, 200, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

#sensor_info_container > div > img {
}

#sensor_info_container > article {
    width: 100%;
    height: 100%;
    border: 2px solid #aaa;
    border-radius: 15px;
    /*display: grid;*/
    /*grid-template-columns: 1.5fr 1fr;*/
    /*grid-template-rows: 40px 1fr;*/
    /*place-items: center;*/
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

#sensor_info_container > article.on {
    border-color: #298acd;
}

#sensor_info_container > article > h2 {
    grid-column: span 2;
    background-color: #aaaaaa;
    color: white;
    padding: 0 15px;
    place-self: flex-start;
    font-size: 1.3em;
    height: 30px;
    margin-top: auto;
    top: 10px;
    left: 0;
    position: absolute;
}

#sensor_info_container > article > h2.on {
    background-color: #298acd;
}

#sensor_info_container > article > img {
    height: 45px;
    margin-top: 40px;
    display: none;
}

#sensor_info_container > article.on > img:last-of-type {
    display: block;
}

#sensor_info_container > article:not(.on) > img:first-of-type {
    display: block;
}

#sensor_info_container > article > p {
    color: #aaa;
    font-size: 1.2rem;
    display: block;
    /*width: 80px;*/
    text-align: left;
    margin-left: 1vh;
    margin-top: 40px;
}

#sensor_info_container > article > p.on {
    color: #298acd;
}

#sensor_info_container > article > p:after {
    content: attr(data-unit);
    margin-left: 0.5rem;
}

#sensor_info_container > article > p:empty:before {
    content: "-";
}

#conn_status_container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    padding: 15px;
    width: calc(100% - 30px);
    height: calc(100% - 30px);
    /*min-height: 240px;*/
}

#conn_status_container > div {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 20px 1fr;
}

#conn_status_container > div > p {
    font-size: 15px;
    text-align: center;
    margin: 0;
}

#conn_status_container > div > div > canvas + p {
    font-size: 12px;
}

#conn_status_container > div > div > canvas + p:after {
    content: "%";
}

#conn_status_container > div > div > canvas + p:empty:before {
    content: "0";
}

#conn_status_container > div > div > canvas {
    height: 80px;
    width: 80px;
    position: absolute;
    top: calc(50% - 40px);
    left: calc(50% - 40px);
}

#conn_status_container > div > div {
    position: relative;
    display: grid;
    place-items: center;
}

#conn_status_container > div > div > .conn_st {
    width: 70%;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 10px;
}

#conn_status_container > div > div > .conn_st[data-conn="off"] {
    background-color: #aaaaaa;
    color: white;
}

#conn_status_container > div > div > .conn_st[data-conn="off"]:before {
    content: "해제됨";
}

#conn_status_container > div > div > .conn_st[data-conn="on"] {
    background-color: #298acd;
    color: white;
}

#conn_status_container > div > div > .conn_st[data-conn="on"]:before {
    content: "연결됨";
}

#conn_status_container > div > div > .conn_st[data-conn="check"]:before {
    content: "확인필요";
}

#conn_status_container > div > div > .conn_st[data-conn="check"] {
    background-color: #e6b451;
    color: white;
}

#conn_status_container > div > div > .conn_st[data-conn="need_check"]:before {
    content: "체크중";
}

#conn_status_container > div > div > .conn_st[data-conn="need_check"] {
    background-color: #aaaaaa;
    color: white;
}

#weather_5_day_container {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1.2fr 1fr;
    grid-gap: 15px;
}

#weather_5_day_container > article:first-of-type {
    display: grid;
    grid-template-columns: 1fr 0.75fr 0.75fr 0.75fr;
    grid-template-rows: 30px 1fr;
    place-items: center;
    position: relative;
    padding: 0 15px;
    width: calc(100% - 30px);
    height: 100%;
    grid-gap: 15px;
}

#weather_5_day_container > article:first-of-type > div {
    grid-row: span 2;
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

#weather_5_day_container > article:first-of-type > div > img {
    width: auto;
    height: 90px;
    margin-bottom: 25px;
}

#weather_5_day_container > article:first-of-type > div:after {
    content: attr(data-weather);
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 5px 0;
    background-color: rgba(126, 202, 255, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 15px;
}

#weather_5_day_container > article:first-of-type > h5 {
    grid-column: span 3;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    font-size: 20px;
}

#weather_5_day_container > article:first-of-type > p {
    border: 2px solid #298acd;
    width: calc(100% - 4px);
    height: calc(100% - 34px);
    font-size: 25px;
    padding-top: 30px;
    display: grid;
    place-items: center;
    position: relative;
    border-radius: 10px;
}

#weather_5_day_container > article:first-of-type > p:before {
    content: attr(data-it);
    position: absolute;
    top: 0;
    left: 0;
    font-size: 18px;
    padding: 5px 15px;
    background-color: #298acd;
    font-weight: bolder;
    color: white;
    border-radius: 5px 0 5px 0;
}

#weather_5_day_container > article:first-of-type > p:empty:after {
    content: "-";
}

/*#weather_5_day_container > article:first-of-type {*/
/*    display: grid;*/
/*    grid-template-columns: 1fr 1fr;*/
/*    grid-template-rows: 2fr 1fr;*/
/*    place-items: center;*/
/*    position: relative;*/
/*}*/

/*#weather_5_day_container > article:first-of-type > h5 {*/
/*    font-size: 60px;*/
/*    color: #298acd;*/
/*}*/

/*#weather_5_day_container > article:first-of-type > h5:after {*/
/*    content: attr(data-unit);*/
/*}*/

/*#weather_5_day_container > article:first-of-type > h5:empty:before {*/
/*    content: "-";*/
/*}*/

/*#weather_5_day_container > article:first-of-type > div {*/
/*    width: 100%;*/
/*    height: 100%;*/
/*    display: flex;*/
/*    justify-content: center;*/
/*    align-items: center;*/
/*}*/

/*#weather_5_day_container > article:first-of-type > div > img {*/
/*    height: 40px;*/
/*    width: auto;*/
/*}*/

/*#weather_5_day_container > article:first-of-type > div > img.humc {*/
/*    height: 30px;*/
/*    margin-right: 5px;*/
/*}*/

#weather_5_day_container > article:last-of-type {
    background-color: #298acd;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: 1fr 1fr;
    width: calc(100% - 30px);
    padding: 0 15px;
    grid-gap: 10px;
}

#weather_5_day_container > article:last-of-type > div {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    place-items: center;
}

#weather_5_day_container > article:last-of-type > div > p:nth-of-type(1) {
    grid-column: span 2;
    font-size: 15px;
}

#weather_5_day_container > article:last-of-type > div > p:nth-of-type(2):after {
    content: "℃";
}
#weather_5_day_container > article:last-of-type > div > p:nth-of-type(3):after {
    content: "%";
}

#weather_5_day_container > article:last-of-type > div > p {
    color: white;
    font-size: 15px;
}

#weather_5_day_container > article:last-of-type > div > p:empty:before {
    content: "-";
}

#weather_5_day_container > article:last-of-type > div > img {
    grid-row: span 2;
    width: 35px;
    height: 35px;
}

#flow_art_container {
    display: grid;
    place-items: center;
}

#flow_art_container > svg {
    height: 100%;
    width: auto;
}

#pv_chat_and_data_container {
    display: grid;
    grid-template-columns: 4fr 1fr;
    grid-template-rows: 1fr;
    grid-gap: 15px;
}

#pvStreamChart {
    width: 100%;
    height: 100%;
}

#pv_chat_and_data_container > section {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    grid-gap: 10px;
}

#conn_status_container > div > div.dd_font {
    font-size: 25px;
    display: flex;
    justify-content: center;
    align-items: baseline;
    height: auto;
    margin: auto;
}

.dd_font:empty:before {
    content: "0.0";
}

.dd_font:after {
    content: "ms";
    font-size: 0.75em;
}

.a_header {
    position: relative;
}

#selected_dryer_name {
    position: absolute;
    top: 15px;
    right: 25px;
    padding: 5px 20px;
    background-color: #aaa;
    color: white;
    border-radius: 20px;
}

#selected_dryer_name.on {
    background-color: #298acd;
}

#selected_dryer_name:empty:before {
    content: "-";
}
.ES_box {
    width: 140px;
    height: 50px;
    background-color: #b8e2ff;
    font-size: 17px;
}

.power > label {
    border: 2px solid #aaa;
    color: #aaa;
    padding: 5px 10px;
    font-size: 20px;
    font-weight: bolder;
    margin: 5px;
    cursor: pointer;
}

.power > input:disabled + label {
    pointer-events: none;
}

.power > #dryer_on_btn:checked + label {
    color: #fff;
    background-color: #298acd;
    border-color: #298acd;
}
.power > #dryer_off_btn:checked + label {
    color: #fff;
    background-color: #ee404c;
    border-color: #ee404c;
}
.span_title {
    position: absolute;
    top: 31.3vh;
    margin-left: 2.5vw;
}

.dryer_demo_card {
    border: 1px solid #b7ddd4;
    background: #fff;
    border-radius: 10px;
    padding: 10px;
    margin: 8px;
    color: #244;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}
.dryer_demo_card.on {
    border-color: #00a77f;
    background: #ecfaf6;
}
.dryer_demo_card h5 {
    margin: 0 0 6px;
    font-size: 15px;
}
.dryer_demo_card p {
    margin: 3px 0;
    font-size: 12px;
}
/* =========================================================
   메인화면 - 건조 진행 상태 섹션 디자인
   적용 대상:
   <div id="dry_progress">
       <span id="dry_progress_data">0 %</span>
   </div>
   ========================================================= */

/* 건조 진행 상태 섹션 내부 정렬 */
article:has(#dry_progress) {
    position: relative;
    overflow: hidden;
}

/* 가운데 콘텐츠 영역 */
article:has(#dry_progress) .m_c {
    height: calc(100% - 48px);
    min-height: 190px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    gap: 8px;
    padding: 10px 0 14px;
}

/* 원형 진행률 영역 */
#dry_progress {
    --progress-color: #2c91d2;
    --progress-bg: #e9eef3;

    width: 118px;
    height: 118px;
    border-radius: 50%;
    position: relative;

    display: flex;
    justify-content: center;
    align-items: center;

    background: radial-gradient(circle at center, #ffffff 0 58%, transparent 59%), conic-gradient(var(--progress-color) 0deg, var(--progress-color) 230deg, var(--progress-bg) 231deg 360deg);

    box-shadow:
        0 8px 18px rgba(36, 118, 173, 0.14),
        inset 0 0 0 1px rgba(44, 145, 210, 0.12);
}

/* 원형 진행률 안쪽 은은한 링 */
#dry_progress::before {
    content: "";
    width: 82px;
    height: 82px;
    border-radius: 50%;
    position: absolute;

    background: #ffffff;
    box-shadow:
        inset 0 0 0 1px rgba(0, 0, 0, 0.04),
        0 3px 8px rgba(0, 0, 0, 0.05);
}

/* 진행률 숫자 */
#dry_progress_data {
    position: relative;
    z-index: 1;

    display: block;
    font-size: 22px;
    font-weight: 700;
    color: #1c84c6;
    line-height: 1;
    letter-spacing: -0.03em;
}

/* 진행률 아래 라벨 */
#dry_progress + div {
    margin-top: 12px !important;

    font-size: 15px;
    font-weight: 700;
    color: #555;
    line-height: 1.2;
}

/* 남은 시간 */
#dry_progress_rem {
    min-width: 112px;
    padding: 7px 14px;
    margin-top: 2px;

    border-radius: 18px;
    background: #eaf6ff;
    border: 1px solid rgba(44, 145, 210, 0.35);

    color: #1c84c6;
    font-size: 17px;
    font-weight: 700;
    text-align: center;
    line-height: 1;
    letter-spacing: 0.02em;
}

/* 하단 보조 상태 문구 */
article:has(#dry_progress) .m_c::after {
    content: "건조 상태 정상";
    margin-top: 8px;
    padding: 5px 12px;

    border-radius: 14px;
    background: rgba(0, 176, 133, 0.1);
    color: #009b78;

    font-size: 13px;
    font-weight: 700;
}

/* 좁은 칸에서도 넘치지 않게 보정 */
@media (max-height: 880px) {
    #dry_progress {
        width: 102px;
        height: 102px;
    }

    #dry_progress::before {
        width: 70px;
        height: 70px;
    }

    #dry_progress_data {
        font-size: 20px;
    }

    #dry_progress_rem {
        font-size: 15px;
        padding: 6px 12px;
    }
}
/* =========================================================
   메인페이지 - 계통도 SVG 정상 운전 흐름 표시
   ========================================================= */

/* 계통도 전체 영역 */
#flow_art_container {
    width: 100%;
    height: 100%;

    display: flex;
    justify-content: center;
    align-items: center;

    overflow: hidden;
    background: #ffffff;
}

/* 삽입된 SVG */
#flow_art_container svg {
    width: 100%;
    height: 100%;

    max-width: 680px;
    max-height: 330px;

    filter: drop-shadow(0 6px 10px rgba(41, 138, 205, 0.08));
}

/* SVG 내부 흐름 라인 기본값 */
#flow_art_container .flow-line {
    stroke-width: 4;
    stroke-linecap: round;

    /*
       점선 간격을 넓게 잡아야 실제 배관/전력 흐름처럼 차분하게 보인다.
    */
    stroke-dasharray: 18 18;

    /*
       상태는 고정하고 선 안의 흐름만 천천히 이동한다.
    */
    animation: flowLineMove 5.5s linear infinite;

    transition:
        stroke 0.4s ease,
        opacity 0.4s ease,
        stroke-width 0.4s ease;
}

/* SVG에서 re 클래스가 붙은 라인은 반대 방향으로 흐르게 한다. */
#flow_art_container .flow-line.re {
    animation-direction: reverse;
}

/* 전기 흐름 */
#flow_art_container .flow-active {
    stroke: #298acd;
    opacity: 0.9;
}

/* 열 흐름 */
#flow_art_container .flow-heat {
    stroke: #f2a51a;
    opacity: 0.9;
}

/* 대기 상태 */
#flow_art_container .flow-ready {
    stroke: #b6b6b6;
    opacity: 0.3;
    animation-play-state: paused;
}

/* 계통도 장비 아이콘에 약한 선명도 보정 */
#flow_art_container image,
#flow_art_container g {
    transition:
        opacity 0.2s ease,
        filter 0.2s ease;
}

/* 흐름 애니메이션 */
@keyframes flowLineMove {
    from {
        stroke-dashoffset: 0;
    }

    to {
        stroke-dashoffset: -72;
    }
}

/* SVG 로딩 실패 또는 대기 표시 */
.flow-art-fallback {
    width: calc(100% - 40px);
    height: calc(100% - 40px);

    display: flex;
    justify-content: center;
    align-items: center;

    border: 1px dashed #9fc8de;
    border-radius: 12px;
    background: #f8fcff;

    color: #298acd;
    font-size: 16px;
    font-weight: 700;
}
