:root {
    --devvn-primary: #8B0000; /* Đỏ đô */
    --devvn-bg: #f4f1ea;      /* Màu kem */
}

/* --- TIMELINE CONTAINER --- */
.timeline-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    padding-top: 50px;
    padding-bottom: 100px;
    font-family: "Segoe UI", sans-serif;
}

.timeline-line {
    position: absolute;
    top: 65%;
    left: 0;
    width: 100%;
    height: 2px;
    border-top: 3px dashed var(--devvn-primary);
    z-index: 0;
    transform: translateY(-50%);
}

.timeline-items {
    display: flex;
    justify-content: space-between; /* Tự động chia đều khoảng cách */
    position: relative;
    z-index: 1;
}

.timeline-item {
    position: relative;
    top: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    flex: 1;
    transition: transform 0.3s 
ease;
}

.timeline-item:hover {
    transform: translateY(-10px);
}

.image-wrapper {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    overflow: hidden;
    border: 6px solid var(--devvn-primary);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    background: #fff;
    position: relative;
    z-index: 2;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.timeline-item:hover .image-wrapper img {
    transform: scale(1.1);
}

.connector {
    height: 40px;
    width: 3px;
    background-color: var(--devvn-primary);
    margin-bottom: -2px;
}

.dot {
    width: 20px;
    height: 20px;
    background-color: #fff;
    border: 4px solid var(--devvn-primary);
    border-radius: 50%;
    position: relative;
    z-index: 2;
}



.year {
    font-size: 22px;
    font-weight: bold;
    color: #000;
    margin-bottom: 5px;
}

.desc {
    font-size: 14px;
    color: #555;
    line-height: 1.4;
}

/* --- POPUP MODAL --- */
.th-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden;
    transition: all 0.3s ease;
    z-index: 99999; /* Cao hơn menu Flatsome */
    backdrop-filter: blur(3px);
}

.th-modal-overlay.active {
    opacity: 1; visibility: visible;
}

.th-modal-box {
    background: var(--devvn-bg);
    width: 1000px;
    max-width: 90%;
    display: flex;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--devvn-primary);
    transform: scale(0.7);
    transition: transform 0.3s;
    position: relative;
    align-items: center;
}

.th-modal-overlay.active .th-modal-box {
    transform: scale(1);
}

.th-modal-img {
    width: 50%;
    height: 400px;
}

.th-modal-img img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}

.th-modal-content {
    width: 50%;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
}

.th-modal-year {
    color: var(--devvn-primary);
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 10px;
    border-bottom: 2px dashed var(--devvn-primary);
    padding-bottom: 10px;
    display: inline-block;
}

.th-modal-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
}

.th-modal-desc {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
    text-align: justify;
    max-height: 300px;
    overflow-y: auto;
}

.th-close-btn {
    position: absolute;
    top: 15px; right: 20px;
    font-size: 30px;
    color: var(--devvn-primary);
    cursor: pointer;
    background: none; border: none;
    font-weight: bold;
    z-index: 10;
    line-height: 1;
}

.th-close-btn:hover {
    color: #d32f2f;
}

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 768px) {
    .timeline-container {
        padding: 20px;
        box-sizing: border-box;
    }

    /* Chuyển đường kẻ sang trái */
    .timeline-line {
        width: 4px;
        height: 100%;
        top: 0;
        left: 25px;
        border-top: none;
        border-left: 4px dashed var(--devvn-primary);
        transform: none;
    }

    .timeline-items {
        flex-direction: column;
        gap: 30px;
        padding-left: 30px;
    }

    .timeline-item {
        width: 100%;
        flex-direction: row;
        align-items: flex-start;
        text-align: left;
    }

    .connector { display: none; }
    
    .dot {
        position: absolute;
        left: -30px;
        top: 30px;
        width: 16px; height: 16px;
        background: var(--devvn-bg);
        box-shadow: 0 0 0 4px var(--devvn-bg);
    }

    .image-wrapper {
        width: 80px; height: 80px;
        min-width: 80px;
        margin-right: 15px;
        border-width: 4px;
    }

    .content {
        margin-top: 0;
        flex: 1;
        padding-left: 0;
    }

    .year {
        font-size: 20px;
        margin-top: 5px;
        color: var(--devvn-primary);
    }

    /* Popup Mobile */
    .th-modal-box {
        flex-direction: column;
        height: auto;
        max-height: 85vh;
        overflow-y: auto;
    }
    .th-modal-img { width: 100%; height: 200px; }
    .th-modal-content { width: 100%; padding: 20px; }
    .th-modal-year { font-size: 24px; }
    .th-modal-title { font-size: 18px; }
    
    .th-close-btn {
        background: rgba(255,255,255,0.8);
        border-radius: 50%;
        width: 35px; height: 35px;
        top: 10px; right: 10px;
    }
}