﻿/* Base styles remain the same */
body {
    font-family: "Segoe UI" !important;
}
.h6{
    font-weight: bold;
    font-size: 18px;
}
.sections button {
    background-color: #337845;
    border: 1px solid #fff;
    color: #fff;
}

.section-btn:hover {
    background-color: #777;
}

.first .intro-item {
    width: 170px;
}

.popup-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s, opacity 0.5s ease;
}

.popup-buttons {
    margin-top: 30px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    background-color: #294563;
    color: #fff;
}

    .popup-buttons:hover {
        background-color: #777;
    }


.custom-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%; /* Set a maximum width for larger screens */
    height: 100%; /* Allow the height to adjust dynamically */
    max-height: 80%; /* Prevent the popup from becoming too tall */
    padding: 20px; /* Add padding for content spacing */
    border-radius: 10px; /* Rounded corners for aesthetics */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    visibility: hidden; /* Hidden by default */
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.popup-txt {
    background-color: #fff;
    width: 60%;
    padding: 20px;
    border-radius: 10px;
    box-sizing: border-box;
}

.popup-title {
    font-size: 22px;
    margin: 0;
    text-align: center;
    color: #444;
}

.popup-txt h3 {
    font-size: 24px;
    font-weight: bold;
    margin-top: 10px;
    text-align: left;
    color: #000;
}

.popup-txt p {
    font-size: 16px;
    color: #666;
    text-align: left;
    margin: 15px 0;
    line-height: 1,2rem;
}

.popup-footer {
    display: inline-block;
    justify-content: space-around;
    align-content: center;
    align-items: center;
    margin-top: 20px;
    width: 100%;
}

.popup-link {
    font-size: 14px;
    color: blue;
    text-decoration: none;
    text-align: center;
}

.popup-close,
.popup-open {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    color:#fff;
}

.popup-close {
    background-color: #4675a8;
}

.popup-open {
    background-color: #007BFF;
    color: white;
}

.popup-advertise img {
    width: fit-content; /* Make the image fit the popup width */
    height: auto; /* Maintain the aspect ratio */
    margin: 0; /* Remove any default margin */
    border-radius: 8px; /* Optional: Add rounded corners */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); /* Optional: Add shadow for aesthetics */
}

.popup-advertise p {
    color: white;
    text-align: center;
}
@media (max-width: 578px) {
    .popup{
        margin-top: 20px;
        max-width: 90%;
    }
    .popup-txt {
        padding: 12px;
    }

    .popup-footer p {
        font-size: 0.9rem;
    }

    .popup-close {
        font-size: 0.9rem;
        padding: 6px 12px;
        width: auto;
    }
}
.close-btn {
    position: absolute;
    top: 0; /* Position above the popup */
    right: 0; /* Slightly outside the right edge */
    background-color: transparent; /* Eye-catching red background */
    border: none; /* Remove border */
    color: #fff; /* White text color for contrast */
    font-size: 20px; /* Adjust font size */
    width: 5px; /* Circle button dimensions */
    height: 5px; /* Circle button dimensions */
    cursor: pointer; /* Change cursor on hover */
    display: flex; /* Center align icon inside the button */
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease, transform 0.2s ease; /* Smooth hover effects */
}

    /* Hover Effects */
    .close-btn:hover {
        background-color: transparent; /* Eye-catching red background */
        color: white;
        transform: scale(2.1); /* Slight zoom effect */
    }


.ad-image {
    max-width: 100%;
    max-height: 200px; /* Limit the size of the image */
    object-fit: contain; /* Ensure the image fits within the container without distortion */
    margin-bottom: 15px;
}

.popup-content {
    background-color: transparent;
    align-content: center;
    align-items: center;
    padding: 20px;
    border-radius: 5px;
    text-align: center;
    max-width: 100%; /* Adjust the width of the popup */
    max-height: 100%; /* Adjust the height of the popup */
    overflow: hidden; /* Prevent overflow if content is too large */
    position: relative; /* To position the close button */
}

.instruction-header {
    display: block;
    justify-content: center;
    align-items: center;
    background-color: #f0f0f0;
    border-radius: 8px 8px 0 0;
    border-bottom: 2px solid #ddd;
    padding-bottom: 20px;
}

    .instruction-header h3 {
        margin: 0;
        font-size: 18px;
        color: #2c3e50;
    }

.start-button {
    background-color: #d9534f;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

    .start-button i {
        margin-left: 5px;
    }

    .start-button:hover {
        background-color: #c9302c;
    }

.instruction-body {
    text-align: center;
    padding: 20px;
}

.instruction-title {
    font-size: 20px;
    color: #d9534f;
    margin-bottom: 5px;
}

.instruction-body p {
    margin: 5px 0;
    font-size: 16px;
    color: #34495e;
}

.question {
    margin: 0.5rem;
    color: #294563;
}

    .question span {
        color: red;
    }

.formatted-heading {
    font-size: 1.8em;
    font-weight: bold;
    margin-bottom: 1em;
    line-height: 1.4;
    text-align: justify;
    color: red;
}

.formatted-paragraph {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 1em;
    text-align: left;
}

.simple-line{
    margin:0px;
}

#responseDisplay {
    padding: 10px;
    text-align: left;
    line-height: 1.6;
}

    #responseDisplay p {
        font-weight: 500;
    }

    #responseDisplay span {
        font-weight: bold;
    }

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9;
    min-height: 100vh;
}

header {
    width: 90%;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ccc;
}


.logo a {
    text-decoration: none;
    display: flex;
    align-content: center;
    align-items: center;
}

    .logo a h1:hover {
        color: #4675a8;
    }

.logo-timer {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 1rem; /* Add gap between logo and menu */
}

.logo img {
    width: 40px;
    height: 40px;
    margin-right: 0.5rem;
}

.logo h1 {
    font-size: 24px;
    font-weight: bold;
    color: #294563;
}

.timer {
    position: absolute;
    left: 50%;
    transform: translateX(-50%); /* Center the timer */
    font-size: 1.5rem;
    color: #d9534f;
}

    .timer span {
        color: #d9534f;
        font-weight: bold;
        font-size: 24px;
        margin-left: 1rem;
    }

/* Menu icon styling */
.menu-icon span {
    font-size: 16px;
    align-items: center;
}

main {
    width: 100%;
    max-width: 100%;
    margin: 3rem auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.app {
    margin: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 8px;
    text-align: center;
}

    .app select, .app button:hover {
        background-color: #ddd;
        color: #000;
    }

    button, .app a, .app audio {
        margin: 0.5rem 0;
    }

select {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

audio {
    width: 100%;
}

button:hover {
    background-color: #ddd;
    color: #000;
}
#stop-intruction{
    display:none;
}

button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

    button:hover {
        background-color: #ddd;
        color: #000;
    }

    button#record {
        background-color: #d9534f;
        color: #fff;
    }

        button#record:hover {
            background-color: #e7908e;
        }

    button#stop {
        background-color: #333;
        color: #fff;
        display: none;
    }

        button#stop:hover {
            background-color: #777;
        }

    button:hover {
        background-color: #777;
        color: #000;
    }

    button#submitBtn {
        background-color: #337845;
        border: 1px solid #fff;
        color: #fff;
    }

        button#submitBtn:hover {
            background-color: #777;
        }

#nextBtn {
    background-color: #294563;
    color: #fff;
}

    #nextBtn:hover {
        background-color: #4675a8; /* Change to any color you want on hover */
        transition: color 0.3s ease; /* Optional: smooth transition */
    }

#prevBtn {
    background-color: #c76478;
    color: #fff;
}

    #prevBtn:hover {
        background-color: #db9ca9; /* Change to any color you want on hover */
        transition: color 0.3s ease; /* Optional: smooth transition */
    }

#download {
    display: inline-block;
    margin-top: 1rem;
    color: #d9534f;
    text-decoration: none;
}

#msg {
    color: #c76378;
    margin-top: 1rem;
}

canvas {
    display: block;
    margin: 0 auto;
    border: 1px solid #ccc;
    border-radius: 8px;
    width: 100%;
    max-width: 600px; /* Adjust based on your design */
    height: auto; /* Maintain aspect ratio */

}

.intro-container {
    text-align: center;
    border-radius: 8px;
}

.intro-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    transform: scale(0.8);
}

.intro-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 95px;
}

    .intro-item p {
        font-size: 17px;
        margin-top: 5px;
    }

.icon-btn {
    border: none;
    background: none;
    font-size: 16px;
    cursor: pointer;
    display: inline-block;
}

.note {
    color: #dc3545;
    margin: 0 !important;
}

/* Modal quảng cáo */
.cannel {
    background-color: #f0f0f0;
    color: black;
}

.custom-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1050;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .custom-modal.show {
        display: block; /* Show the modal */
    }

    .custom-modal .custom-dialog {
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0;
        height: 100%;
    }

    .custom-modal .custom-content {
        width: 40%;
        max-width: 100%;
        height: 20%;
        max-height: 80%;
        background: #294563;
        border-radius: 20px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
        overflow: auto;
        padding: 20px;
        color: white;
        text-align: center;
        align-content: center;
    }

    .custom-modal.show .custom-content {
        transform: scale(1);
        opacity: 1;
    }

    .custom-modal .custom-body {
        padding: 1.5rem;
        text-align: center;
        font-size: 1.2rem;
    }

    .custom-modal .custom-btn {
        background-color: #007bff;
        border: none;
        border-radius: 5px;
        padding: 0.5rem 1rem;
        transition: background-color 0.3s ease;
        background-color: #FAA859;
        text-decoration: none;
        display: inline-block;
        width: auto;
    }

        .custom-modal .custom-btn:hover {
            background-color: #BB7F44;
        }

        .custom-modal .custom-btn .custom-btn-txt {
            color: black;
            font-weight: bold;
        }


/* Meta Data */

.question-guidance-wrapper {
    display: flex;
    justify-content: center; /* Căn giữa theo chiều ngang */
    text-align: left;
}

.question-guidance {
    max-width: 600px; /* Giới hạn độ rộng tối đa */
    width: 100%; /* Chiếm toàn bộ chiều rộng cho mobile */
    padding: 16px 24px; /* Khoảng cách trong khung */
    border: 1px solid #333; /* Viền */
    border-radius: 8px; /* Bo góc nhẹ */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); /* Đổ bóng nhẹ */
}


.question-details {
    list-style-position: inside; 
    padding-left: 0;
    margin: 0;
}

.question-item {
    margin-bottom: 8px;
    font-size: 20px;
}

.question {
    display: none;
    color: orangered;
}

    .question:first-child {
        display: block;
    }

    .question span {
        color: #294563;
    }

.section-btn.active {
    font-weight: bold;
    color: green;
    background-color: lightgray;
}

/* Responsive Styles */
@media (max-width: 760px) {
    header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: center;
    }

    .logo-timer {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        gap: 1rem;
        flex-grow: 1;
    }

    .logo img {
        width: 40px;
        height: 40px;
    }

    .logo h1 {
        display: none;
    }

    .timer {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        font-size: 1.2rem;
        color: #d9534f;
    }

    .menu-icon {
        display: block;
        font-size: 2rem;
        cursor: pointer;
    }



    .group-title {
        font-size: 20px;
    }

    .question {
        font-size: 18px;
    }

    .popup-content {
        width: 90%;
        padding: 15px;
    }

    button:hover {
        background-color: #ddd;
        color: #000;
    }

    button {
        padding: 0.5rem 0.5rem;
        font-size: 0.9rem;
    }

    .instruction-header h3 {
        font-size: 16px;
    }


    .intro-item p {
        font-size: 14px;
    }

    .question-item {
        margin-bottom: 8px;
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .question-item {
        font-size: 15px !important;
    }

    .logo h1 {
        font-size: 18px;
    }

    .timer {
        font-size: 1rem;
    }

    .menu-icon span {
        font-size: 2.5rem;
    }

    .intro-item {
        width: 70px;
    }

        .intro-item p,
        .note {
            font-size: 12px;
        }
}