/* ========================================= */
/*        CÁC STYLE CƠ BẢN & CHUNG           */
/* ========================================= */

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    background-color: #f4f4f4;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: #ffffff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

a {
    color: #007bff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

/* ========================================= */
/*            HEADER, FOOTER                 */
/* ========================================= */

.header {
    text-align: center;
    margin-bottom: 20px;
}

.header img {
    border: none;
}

.footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.footer-nav {
    margin-bottom: 20px;
}

.footer-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-nav li {
    display: inline-block;
    margin: 0 10px;
}

.footer-nav li:not(:last-child)::after {
    content: "|";
    margin-left: 20px;
    color: #999;
}

.resources, .copyright {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 15px;
}

/* ========================================= */
/*       LAYOUT & CÁC TRANG NỘI DUNG         */
/* ========================================= */

/* --- Layout 2 Cột (Nội dung chính + Sidebar) --- */
.page-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.main-content-area {
    flex: 3; /* Chiếm nhiều không gian hơn */
    min-width: 0; /* Quan trọng để flexbox co lại đúng cách */
}

.sidebar {
    flex: 1; /* Chiếm ít không gian hơn */
    background-color: #bc0000;
    padding: 20px;
    border-radius: 5px;
}

.main-content-area h2 {
    text-align: center;
    margin-top: 0;
}

/* --- Sidebar Navigation --- */
.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin-bottom: 12px;
}

.sidebar-nav a {
    color: #ffffff;
    font-weight: bold;
}

.sidebar-nav a::before {
    content: '➤ ';
    margin-right: 8px;
    font-size: 0.8em;
}

/* --- Trang Hướng dẫn chi tiết (Tying Steps) --- */
.main-diagram {
    text-align: center;
    margin: 20px 0 30px 0;
}

.main-diagram img {
    border: 1px solid #ddd;
    border-radius: 4px;
}

.tying-steps {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tying-steps li {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #f0f0f0;
}

.tying-steps li:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.tying-steps img {
    flex-shrink: 0;
    width: 100px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.tying-steps p {
    margin: 0;
}

.back-to-home {
    display: block;
    text-align: center;
    margin-top: 30px;
    font-weight: bold;
}


/* =================================================================== */
/*   !!! QUAN TRỌNG: CÁC QUY TẮC RESPONSIVE PHẢI LUÔN Ở CUỐI CÙNG !!!   */
/* =================================================================== */

/* Áp dụng cho MÁY TÍNH BẢNG & nhỏ hơn (max-width: 840px) */
@media (max-width: 840px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
    }

    /* CHUYỂN LAYOUT 2 CỘT THÀNH 1 CỘT */
    .page-layout {
        flex-direction: column; /* Xếp sidebar xuống dưới nội dung chính */
    }

    /* CHUYỂN MENU FOOTER THÀNH DẠNG DỌC */
    .footer-nav li {
        display: block;
        margin: 10px 0;
    }
    .footer-nav li:not(:last-child)::after {
        content: ""; /* Xóa dấu | */
    }
}


/* Áp dụng cho ĐIỆN THOẠI (max-width: 600px) */
@media (max-width: 600px) {
    h2 {
        font-size: 1.5em;
    }
    
    .main-content-area p {
        font-size: 0.95em; /* Giảm cỡ chữ một chút cho dễ đọc */
    }

    /* CHUYỂN CÁC BƯỚC HƯỚNG DẪN THÀNH DẠNG DỌC */
    .tying-steps li {
        flex-direction: column; /* Xếp ảnh ở trên, text ở dưới */
        align-items: center;    /* Căn giữa ảnh và text */
        text-align: center;     /* Căn giữa luôn cả chữ */
        gap: 15px;
    }

    .tying-steps img {
        width: 150px; /* Cho ảnh to hơn một chút cho dễ nhìn */
    }
}