@font-face {
    font-family: 'FC Sound';
    src: url('../assets/font/FCSound-Regular.ttf') format('truetype');
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'FC Sound', sans-serif;
}

/*---------------------------- header ---------------------------------*/
header {
    background-image: linear-gradient(rgba(5, 87, 175, 0.938), rgba(0, 92, 190, 0.068)),
        url('../assets/Images/header.jpg');
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
}

.container-fluid {
    padding: 20% 5%;
    font-size: 10px;
}

#title_header {
    font-weight: bold;
    font-size: 18px;
}

/*---------------------------- main ---------------------------------*/
main {
    display: flex;
    justify-content: center;
    flex-direction: column;
    width: 100%;
    text-align: center;
}

.title {
    font-size: 20px;
    font-weight: bold;
    margin: 8% 0 8% 0;
}

.more_button {
    background-color: rgb(112, 181, 255);
    border: none;
    margin: 10% 0 10% 0;
    font-size: 14px;
    padding: 10px 20px;
    border-radius: 5px;
}

.more_button:hover {
    box-shadow: 0 8px 16px 0 rgb(112, 181, 255);
    transition: 0.3s;
}

/*---------------------------- layout1 ---------------------------------*/
.layout1 {
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    padding: 5%;
    margin-bottom: 10%;
}

.card {
    border-radius: 15px;
    font-weight: normal;
    padding: 15px;
    margin: 1%;
    display: flex;
    flex-direction: column;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    color: white;
    width: 45%;
}

#card1 {
    background-image: linear-gradient(rgba(0, 53, 110, 0.486)),
        url('../assets/Images/eletrical.JPG');
}

#card2 {
    background-image: linear-gradient(rgba(0, 53, 110, 0.486)),
        url('../assets/Images/plumbing.jpg');
}

#card3 {
    background-image: linear-gradient(rgba(0, 53, 110, 0.486)),
        url('../assets/Images/roof.jpg');
}

#card4 {
    background-image: linear-gradient(rgba(0, 53, 110, 0.486)),
        url('../assets/Images/leakage.jpg');
}

#card5 {
    background-image: linear-gradient(rgba(0, 53, 110, 0.486)),
        url('../assets/Images/architecture.JPG');
}

#card6 {
    background-image: linear-gradient(rgba(0, 53, 110, 0.486)),
        url('../assets/Images/uncheck.png');
}

.all_card {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.details {
    font-size: 14px;
    width: 100%;
    margin-top: 25%;
    text-align: left;
    color: white;
}

#icon {
    width: 26px;
    height: 26px;
}

.icon {
    background-color: white;
    width: fit-content;
    padding: 10px;
    border-radius: 100%;
    display: flex;
    justify-content: center;
}

.card:hover {
    box-shadow: 0 8px 16px 0 rgba(8, 41, 78, 0.555);
    padding: 20px;
    transition: 0.3s;
}

/*---------------------------- layout2 ---------------------------------*/
.container {
    background-color: rgb(220, 241, 255);
    width: 100%;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
}

.layout2,
.layout2_2 {
    width: 95%;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    padding: 5%;
}

.illustration img {
    width: 95%;
    border-radius: 10px;
    margin-top: 5%;
}

.content {
    font-size: 12px;
}

a {
    text-decoration: none;
    color: rgb(2, 78, 179);
}

/*---------------------------- layout_criteria (UPDATED) ---------------------------------*/
.layout_criteria {
    width: 95%; /* UPDATED: Match layout2 width */
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    padding: 5%;
    margin: 3% 0 3% 0;
}

.all_criteria_boxes {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.criteria_box {
    width: 90%;
    margin: 3% 0;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 10px;
    background-color: #ffffff;
    text-align: left;
    transition: 0.3s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    display: flex; /* ADDED: For equal height */
    flex-direction: column; /* ADDED: For equal height */
}

.criteria_box:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}

.criteria_box h4 {
    font-size: 16px;
    font-weight: bold;
    color: rgb(2, 78, 179);
    margin-bottom: 10px;
}

.criteria_box p {
    font-size: 14px;
    color: #333;
    flex-grow: 1; /* ADDED: For equal height */
}


/*---------------------------- layout3 Youtube ---------------------------------*/
.layout3 {
    width: 100%;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    margin: 3% 0 3% 0;
}

.layout3 .content {
    font-size: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* กล่องวิดีโอ */
.video_container {
    margin: 3%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 5%;
    border: 1px solid #ccc;
    border-radius: 10px;
    background-color: white;
    transition: 0.3s;
}

.video_container:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.video_frame iframe {
    width: 100%;
    border-radius: 8px;
    aspect-ratio: 16 / 9;
}

/*---------------------------- layout4 ---------------------------------*/
.layout4 {
    width: 100%;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
}

.layout4 .content {
    width: 80%;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10%;
}

.accordion {
    background-color: #ffffff;
    color: #333;
    cursor: pointer;
    width: 100%;
    border: none;
    text-align: left;
    font-size: 14px;
    font-weight: bold;
    transition: 0.3s;
    padding: 3%;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.accordion.active,
.accordion:hover {
    background-color: #ffffff;
}

.panel {
    padding: 0px 20px 20px 20px;
    background-color: white;
    display: none;
    overflow: hidden;
    text-align: left;
    border-radius: 10px;
}

.panel a {
    display: inline-block;
    color: #0077cc;
    text-decoration: underline;
}

.question_card {
    background-color: #ffffff;
    color: #000000;
    text-align: left;
    transition: 0.3s;
    width: 100%;
    margin: 3% 0;
    border-radius: 10px;
    padding: 4px;
    border: 1px solid #ccc;
}

/*---------------------------- scroll up ---------------------------------*/
#scrollTopBtn {
    position: fixed;
    bottom: 20px;
    right: 25px;
    display: none;
    font-size: 14px;
    background-color: #000;
    color: white;
    border: none;
    border-radius: 100%;
    cursor: pointer;
    height: 40px;
    width: 40px;
}

#scrollTopBtn:hover {
    background-color: #444;
}

/*---------------------------- Website ---------------------------------*/
@media screen and (min-width: 768px) {
    header {
        height: 500px;
    }

    .container-fluid {
        padding: 20% 5%;
        font-size: 20px;
    }

    #title_header {
        font-weight: bold;
        font-size: 36px;
    }

    main {
        display: flex;
        justify-content: center;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .title {
        font-size: 20px;
        font-weight: bold;
        margin: 3% 0 3% 0;
    }

    .more_button {
        margin: 3% 0 3% 0;
        font-size: 16px;
    }

    /*---------------------------- layout1 ---------------------------------*/
    .layout1 {
        width: 70%;
        padding: 2% 0 5% 0;
        margin-bottom: 0%;
    }

    .card {
        width: 30%;
    }

    .details {
        font-size: 16px;
    }

    #icon {
        width: 40px;
        height: 40px;
    }

    /*---------------------------- layout2 ---------------------------------*/
    .layout2,
    .layout2_2 {
        flex-direction: row;
        padding: 1%;
    }

    .layout2_2 {
        flex-direction: row-reverse;
    }

    .layout2 .content,
    .layout2_2 .content {
        padding: 3%;
    }

    .illustration,
    .illustration img {
        width: 80%;
    }

    .illustration:last-child img {
        margin-bottom: 5%;
        margin-top: 0;
    }

    .content {
        font-size: 16px;
        width: 90%;
    }

    /*---------------------------- layout_criteria (UPDATED) ---------------------------------*/
    .layout_criteria {
        width: 100%; /* UPDATED: Take full width inside container */
        padding: 1%; /* UPDATED: Match layout2 padding */
        margin-bottom: 0%;
        flex-direction: column; /* UPDATED: Stack title and content */
    }

    .all_criteria_boxes {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%; /* ADDED: Ensure it fills the layout */
    }

    .criteria_box {
        width: 45%; /* 2 boxes per row */
        margin: 1.5%;
    }

    .criteria_box h4 {
        font-size: 18px;
    }

    .criteria_box p {
        font-size: 16px;
        /* flex-grow: 1; is inherited from base style */
    }


    /*---------------------------- layout3 ---------------------------------*/
    .layout3 {
        margin: 1% 0 1% 0;
    }

    .layout3 .content {
        font-size: 16px;
        width: 100%;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }

    .video_container {
        width: 30%;
        margin: 1%;
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        text-align: left;
        padding: 1%;
    }

    .video_container:last-child {
        margin-bottom: 1%;
    }

    .video_title {
        font-size: 16px;
        padding: 20px;
    }

    /*---------------------------- layout4 ---------------------------------*/
    .layout4 {
        width: 100%;
        display: flex;
        justify-content: center;
        flex-direction: column;
        align-items: center;
    }

    .layout4 .content {
        width: 90%;
        padding-top: 0;
        margin-bottom: 3%;
    }

    .accordion {
        font-size: 20px;
        padding: 1.5%;
        border-radius: 10px;
    }

    .question_card {
        width: 90%;
        padding: 0;
        margin: 1% 0;
    }
}