:root {
    --primary-color: #0284c7;
    --primary-hover: #0369a1;
    --bg-color: #f0f9ff;
    --card-bg: #ffffff;
    --text-color: #334155;
    --border-color: #cbd5e1;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 850px;
}

/* Clearfix */
.container-footer::after,
.header::after,
.chac-info::after {
    clear: both;
    display: block;
    content: "";
}

/* Header/Logo Layout */
.header {
    background: white;
    color: black;
    padding: 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header .logo {
    display: flex;
    align-items: center;
}

.logo img {
    width: 75px;
    height: auto;
}

.title-text {
    font-size: 22px;
    color: #00aeef;
    font-weight: bold;
    margin-left: 10px;
    line-height: 1.3;
}

.contact {
    font-size: 18px;
    margin: 0;
}

.fa-phone-alt {
    color: red;
    font-size: 22px;
}

h1 {
    text-align: center;
    color: var(--primary-color);
    margin: 20px 0;
    font-size: 1.6rem;
    line-height: 1.3;
}

.form-group {
    margin-bottom: 16px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

input[type="text"],
input[type="date"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="date"]:focus {
    border-color: var(--primary-color);
}

/* Button Navigation Group */
.button-group {
    display: flex;
    gap: 10px;
    margin: 24px 0;
}

button {
    flex: 1;
    padding: 12px 16px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

button:active {
    transform: scale(0.98);
}

#btn1 { background-color: var(--primary-color); color: white; }
#btn1:hover { background-color: var(--primary-hover); }

#btn2 { background-color: #64748b; color: white; }
#btn2:hover { background-color: #475569; }

#btn3 { background-color: #0d9488; color: white; }
#btn3:hover { background-color: #0f766e; }

/* Content Boxes & Questions */
.content-box {
    display: none;
    background-color: #f8fafc;
    border: 1px dashed var(--border-color);
    padding: 20px;
    border-radius: 8px;
    margin-top: 15px;
    animation: fadeIn 0.3s ease-in-out;
}

.content-box.active {
    display: block;
}

.question-item {
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.question-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: #1e293b;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
}

/* Tùy chỉnh riêng cho các lựa chọn điểm 0-5 của bài test CAT */
.cat-grid {
    grid-template-columns: repeat(6, 1fr);
}

.option-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    background: #f1f5f9;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.option-label:hover {
    background: #e2e8f0;
}

.section-header {
    font-size: 1.1rem;
    font-weight: bold;
    color: #b91c1c;
    margin: 20px 0 10px 0;
    text-transform: uppercase;
    border-bottom: 2px solid #fee2e2;
    padding-bottom: 5px;
}

.btn-submit-result {
    background-color: #16a34a;
    color: white;
    width: 100%;
    margin-top: 15px;
    padding: 12px;
    font-size: 1.05rem;
}

.btn-submit-result:hover {
    background-color: #15803d;
}

.result-display {
    margin-top: 20px;
    padding: 15px;
    background: #e0f2fe;
    border: 1px solid #7dd3fc;
    border-radius: 8px;
    display: none;
}

.result-display.active {
    display: block;
}

.conclusion-item {
    margin: 5px 0;
    padding: 6px 10px;
    border-radius: 4px;
}

.conclusion-item.highlight {
    background-color: #bae6fd;
    font-weight: bold;
    color: #0369a1;
}

/* Footer Styles */
#colophon {
    margin-top: 30px;
}

.chac-info {
    background: #244e8c;
    border-radius: 8px;
    overflow: hidden;
}

.container-footer {
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.chac-info .adress { flex: 1.2; min-width: 250px; color: white; }
.chac-info .open-hours { flex: 1; min-width: 220px; color: white; }
.chac-info .contact-form { flex: 1; min-width: 200px; color: white; }

.chac-info ul { margin: 0 0 20px 0; line-height: 1.6; padding-left: 0; }
.chac-info ul li { list-style: none; font-size: 15px; }

.fa-clock, .fa-home, .fa-envelope { font-size: 24px; color: #7FB850; }

.medium-title {
    font-size: 18px;
    margin-top: 0;
    margin-bottom: 15px;
}

.open-hours table td {
    line-height: 1.8;
    padding: 0 5px;
}

.copyright {
    padding: 15px 0 0 0;
}

.copyright p {
    font-size: 14px;
    text-align: center;
    color: var(--text-color);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===================================================
   RESPONSIVE BREAKPOINTS (Máy tính bảng & Điện thoại)
   =================================================== */

/* Máy tính bảng (Tablet - 768px đến 1024px) */
@media screen and (max-width: 992px) {
    .button-group {
        flex-direction: column;
        gap: 8px;
    }
    
    button {
        width: 100%;
        text-align: center;
    }

    .cat-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* Điện thoại di động (Mobile - Dưới 768px) */
@media screen and (max-width: 768px) {
    body {
        padding: 10px 5px;
    }

    .container {
        padding: 15px;
        border-radius: 8px;
    }

    .header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .header .logo {
        flex-direction: column;
    }

    .title-text {
        margin-left: 0;
        margin-top: 5px;
        font-size: 20px;
    }

    .contact {
        font-size: 16px;
    }

    h1 {
        font-size: 1.3rem;
    }

    .content-box {
        padding: 12px;
    }

    .options-grid {
        grid-template-columns: 1fr;
    }

    /* Hiển thị câu hỏi CAT dạng 3 cột trên mobile */
    .cat-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .question-title span {
        float: none !important;
        display: block;
        width: 100%;
        font-size: 0.85rem;
        color: #64748b;
        margin-top: 4px;
    }

    .container-footer {
        flex-direction: column;
        gap: 25px;
    }

    .chac-info .adress, 
    .chac-info .open-hours, 
    .chac-info .contact-form {
        width: 100%;
    }
}

/* Điện thoại màn hình nhỏ (Dưới 480px) */
@media screen and (max-width: 480px) {
    .cat-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .option-label {
        font-size: 0.85rem;
        padding: 8px 4px;
    }

    button {
        font-size: 0.85rem;
        padding: 10px;
    }
}