/* Global Styles */
* {
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #333;
}

/* Header */
.header {
    width: 100%;
    background-color: #2ecc71;
    color: white;
    text-align: center;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    height: 60px;
    object-fit: contain;
    margin-right: 20px;
}

.header-title {
    font-size: 1.5rem;
    font-weight: bold;
    text-transform: uppercase;
    flex-grow: 1;
}

/* Roadmap Tree Styles */
.roadmap-tree-container {
    max-width: 1200px;
    width: 100%;
    padding: 2rem;
    margin: 2rem auto;
}

.tree-wrapper {
    position: relative;
    padding-top: 20px;
    padding-bottom: 20px;
}

.tree-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: #ccc;
    transform: translateX(-50%);
    z-index: 0;
}

.stage-item {
    display: flex;
    margin-bottom: 40px;
    position: relative;
    align-items: flex-start;
    z-index: 1;
}

.stage-item.left-side {
    justify-content: flex-end;
    padding-right: calc(50% + 20px); /* Khoảng cách từ trục chính */
}

.stage-item.right-side {
    justify-content: flex-start;
    padding-left: calc(50% + 20px); /* Khoảng cách từ trục chính */
}

.stage-header {
    background-color: #2ecc71;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    min-width: 300px;
    position: relative;
}

.stage-header h2 {
    margin: 0;
    font-size: 1.2rem;
    flex-grow: 1;
    text-align: left;
    border-bottom: none;
    padding-bottom: 0;
}

.toggle-icon {
    font-size: 1.5rem;
    font-weight: bold;
    margin-right: 10px;
    transition: transform 0.3s ease;
}

.stage-item.expanded .toggle-icon {
    transform: rotate(45deg); /* Xoay dấu + thành X */
}

.stage-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-top: 10px;
    display: none; /* Mặc định ẩn */
    flex-grow: 1;
    width: 100%; /* Đảm bảo chiếm hết chiều rộng còn lại */
}

.stage-item.expanded .stage-content {
    display: block;
}

.step-item {
    margin-bottom: 15px;
}

.step-item h3 {
    color: #007bff;
    font-size: 1.1rem;
    margin-bottom: 5px;
    text-align: left;
    border-bottom: 1px dashed #eee;
    padding-bottom: 5px;
}

.step-item ul {
    list-style: none;
    padding-left: 20px;
    margin-top: 5px;
}

.step-item ul li {
    margin-bottom: 5px;
    position: relative;
}

.step-item ul li::before {
    content: '✓';
    color: #2ecc71;
    position: absolute;
    left: -20px;
}

/* Connectors to main line */
.stage-item::before {
    content: '';
    position: absolute;
    top: 50%;
    width: 20px; /* Chiều dài đường nối */
    height: 4px;
    background-color: #2ecc71;
    z-index: 1;
    transform: translateY(-50%);
}

.stage-item.left-side::before {
    right: calc(50% - 20px); /* Nối vào trục chính từ bên trái */
}

.stage-item.right-side::before {
    left: calc(50% - 20px); /* Nối vào trục chính từ bên phải */
}

/* Footer */
.footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 20px;
    width: 100%;
    margin-top: 2rem;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    .roadmap-tree-container {
        padding: 1rem;
    }
    .header {
        height: 60px;
    }
    .logo {
        height: 40px;
    }
    .header-title {
        font-size: 1rem;
    }

    .tree-line {
        left: 20px; /* Dịch trục chính sang trái */
    }

    .stage-item {
        flex-direction: column;
        align-items: flex-start;
        padding-left: 40px; /* Khoảng cách cho trục chính mới */
        padding-right: 0;
        margin-bottom: 20px;
    }

    .stage-item.left-side, .stage-item.right-side {
        justify-content: flex-start;
        padding-right: 0;
        padding-left: 40px;
    }

    .stage-item::before {
        left: 0; /* Đường nối từ bên trái của item */
        width: 20px;
    }

    .stage-item.left-side::before, .stage-item.right-side::before {
        left: 20px; /* Vị trí đường nối trên mobile */
        transform: translateY(-50%) translateX(-100%); /* Đảm bảo đường nối ra khỏi item */
    }

    .stage-header {
        width: 100%;
        min-width: unset;
    }
}