/* ==================================================================
    CSS CHO TRANG LỘ TRÌNH (roadmap.html) - PHIÊN BẢN SỬA LỖI HOÀN CHỈNH
    - Sửa triệt để lỗi cuộn ngang và mất menu trên di động.
    - Căn chỉnh lại icon thu nhập cho chính xác.
    - Tối ưu hóa layout cho các kích thước màn hình khác nhau.
    ==================================================================
*/

/* === CÀI ĐẶT NỀN TẢNG & BOX-SIZING === */
:root {
    /* === MÀU SẮC ĐỒNG BỘ VỚI WEBSITE === */
    --primary-color: #00A86B;      /* Main Green */
    --secondary-color: #FFC107;   /* Main Yellow */
    --accent-color-dark: #00796b; /* Darker Green */
    --page-background: #f4f6f8;
    --card-background: #FFFFFF;
    --text-color: #2C3E50;
    --text-light: #FFFFFF;
    --text-muted: #7F8C8D;
    --border-color: #e5e7eb;
    --light-gray: #F9FAFB;
    --dark-gray: #34495E;
    --medium-gray: #9ca3af;

    /* Trạng thái */
    --success-color: #27AE60;
    --warning-color: #F39C12;
    --info-color: #3498DB;

    /* Cấp bậc */
    --rank-color: #8E44AD;
    --income-text-color: #D35400;
    --world-team-color: #16A085;
    --get-team-color: #27AE60;
    --mill-team-color: #E67E22;
    --pres-team-color: #C0392B;
    
    /* Sơ đồ */
    --ban-node-color: #d84a4a;
    --f1-gsv-node-color: #d84a4a;
    --f1-nktc-node-color: #1ABC9C;
    --f1-tv-new-node-color: #FCD34D;
    --f2-nktc-node-color: #34D399;
    --f2-tv-node-color: #FDE047;
    --f3-tv-node-color: #FDE047;
}
}

html {
  box-sizing: border-box;
}
*, *:before, *:after {
  box-sizing: inherit;
}

body { 
    background-color: var(--page-background); 
    color: var(--text-color); 
    line-height: 1.6; 
    font-size: 16px;
}

/* === HEADER CỦA TRANG LỘ TRÌNH === */
header.page-header {
    text-align: center; 
    padding: 40px 20px; 
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color-dark));
    color: var(--text-light); 
    position: relative; 
    overflow: hidden;
}
header.page-header h1 { 
    font-size: 2.5rem; 
    font-weight: 800; 
    margin-bottom: 15px;
}
header.page-header p { 
    font-size: 1rem; 
    max-width: 830px; 
    margin: 0 auto; 
    opacity: 0.9; 
}

/* === THANH ĐIỀU HƯỚNG CÁC THÁNG === */
.timeline-navigation-bar {
    background-color: var(--accent-color-dark); 
    padding: 5px 0; 
    position: sticky; 
    top: 80px;
    z-index: 49;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    transition: transform 0.4s ease-in-out, visibility 0.4s; /* Thêm transition */
}
/* Lớp CSS mới để ẩn thanh điều hướng */
.timeline-navigation-bar.is-hidden {
    visibility: hidden;
    transform: translateY(-100%);
}

.timeline-nav-container { 
    display: flex; justify-content: flex-start; 
    overflow-x: auto; padding: 0 10px; 
    scrollbar-width: thin; 
    scrollbar-color: var(--secondary-color) var(--accent-color-dark); 
}
.timeline-nav-container::-webkit-scrollbar { height: 6px; } 
.timeline-nav-container::-webkit-scrollbar-thumb { background-color: var(--secondary-color); border-radius: 7px; }
.timeline-nav-container::-webkit-scrollbar-track { background-color: var(--accent-color-dark); }
.timeline-navigation-bar ol { list-style-type: none; display: inline-flex; padding: 0; margin: 0; position: relative; }
.timeline-navigation-bar li { margin: 0 4px; } 
.timeline-navigation-bar a {
    display: block; padding: 8px 18px; 
    color: var(--text-light); text-decoration: none; border-radius: 22px; 
    font-size: 0.9rem; 
    font-weight: 500; 
    transition: all 0.2s ease; white-space: nowrap;
    background: rgba(255, 255, 255, 0.12); 
}
.timeline-navigation-bar a:hover, 
.timeline-navigation-bar a.selected-month-nav {
    background-color: var(--secondary-color); 
    color: #1f2937; 
    font-weight: 600;
}


/* === BỐ CỤC CHUNG === */
.main-content { padding: 30px 0; } 
.section-title {
    text-align: center; margin-bottom: 30px; 
    color: var(--primary-color); font-size: 1.9rem; 
    font-weight: 700; position: relative; padding-bottom: 15px;
}
.section-title i.fas {
     margin-right: 10px; 
     color: var(--secondary-color);
}
.section-title::after {
    content: ""; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 80px; height: 4px; background: var(--secondary-color); border-radius: 2px; 
}

/* === BỐ CỤC (DESKTOP - NẰM NGANG) === */
.horizontal-timeline-wrapper {
    overflow-x: auto;
    padding: 24px 0 30px; 
    -webkit-overflow-scrolling: touch;
}
.horizontal-timeline { 
    display: flex; 
    flex-wrap: nowrap; 
    padding: 0 20px 24px; 
    min-width: max-content; 
}
.month-card {
    background-color: var(--card-background); 
    border-radius: 12px; 
    padding: 24px; 
    margin-right: 20px; 
    width: 480px; 
    min-width: 480px; 
    flex-shrink: 0; 
    box-shadow: 0 6px 18px rgba(50, 50, 93, 0.08); 
    transition: all 0.25s ease; 
    border: 1px solid var(--border-color);
    border-top: 5px solid var(--primary-color);
    display: flex;
    flex-direction: column;
}
.month-card:hover {
     transform: translateY(-5px);
     box-shadow: 0 10px 25px rgba(50, 50, 93, 0.1);
}
.month-card-header { 
    text-align: center; 
    margin-bottom: 18px; 
    padding-bottom: 15px; 
    border-bottom: 1px dashed #cbd5e1;
}
.month-card-header h3 {
    font-size: 1.35rem; 
    font-weight: 700; 
    color: var(--accent-color-dark);
    display: flex; 
    align-items: center; 
    justify-content: center;
}
.month-card-header h3 i.fa-calendar-alt {
    margin-right: 10px; 
    color: var(--primary-color);
}

/* === SƠ ĐỒ HỆ THỐNG (ORG CHART) === */
.org-structure-wrapper {
    width: 100%; overflow-x: auto; padding: 15px 3px; margin-bottom: 15px;
    border-radius: 7px; background: #fff; border: 1px solid var(--border-color); text-align: center;
}
.org-structure {
    display: inline-flex; flex-direction: column; align-items: center;
    padding: 7px; min-width: fit-content;
}
.org-structure ul {
    list-style: none; padding: 0; margin: 0; display: flex;
    justify-content: center; position: relative;
}
.org-structure ul ul { margin-top: 22px; } 
.org-structure li {
    display: flex; flex-direction: column; align-items: center;
    position: relative; padding: 15px 7px 0 7px; 
}
.org-structure li::before, .org-structure li::after {
    content: ''; position: absolute; top: 0; border-top: 1.5px solid var(--medium-gray);
    width: 50%; height: 15px; 
}
.org-structure li::before { right: 50%; }
.org-structure li::after { left: 50%; }
.org-structure li:only-child::before, .org-structure li:only-child::after { display: none; }
.org-structure li:only-child { padding-top: 0; }
.org-structure li:first-child::before, .org-structure li:last-child::after { display: none; }
.org-structure li:first-child:not(:only-child)::after,
.org-structure li:last-child:not(:only-child)::before { width: 50%; }
.org-structure ul > li > ul::before {
    content: ''; position: absolute; top: -15px; 
    left: 50%; transform: translateX(-50%); border-left: 1.5px solid var(--medium-gray);
    height: 15px; 
}
.org-structure.org-icons-only .member-node {
    background-color: transparent !important; border: none !important; box-shadow: none !important;
    padding: 0 !important; min-width: auto !important; min-height: auto !important;
    width: 28px !important; height: 28px !important; 
    display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; 
    transition: transform 0.15s ease; 
}
.org-structure.org-icons-only .member-node:hover { transform: scale(1.18); } 
.org-structure.org-icons-only .member-node .name,
.org-structure.org-icons-only .member-node .rank-info { display: none !important; }
.org-structure.org-icons-only .member-node i.member-icon {
    font-size: 1.4rem; 
    margin: 0; padding: 0; width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background-color: transparent !important; 
}
.org-structure.org-icons-only .ban-node i.member-icon { color: var(--ban-node-color) !important; } 
.org-structure.org-icons-only .f1-gsv-node i.member-icon { color: var(--f1-gsv-node-color) !important; } 
.org-structure.org-icons-only .f1-nktc-node i.member-icon { color: var(--f1-nktc-node-color) !important; } 
.org-structure.org-icons-only .f1-tv-new-node i.member-icon { color: var(--f1-tv-new-node-color) !important; } 
.org-structure.org-icons-only .f2-nktc-node i.member-icon { color: var(--f2-nktc-node-color) !important; } 
.org-structure.org-icons-only .f2-tv-node i.member-icon { color: var(--f2-tv-node-color) !important; } 
.org-structure.org-icons-only .f3-tv-node i.member-icon { color: var(--f3-tv-node-color) !important; } 

.month-card-summary strong { margin-left: 4px; margin-right: 2px; } 
.month-summary-text  strong.income-value-large { color: var(--income-text-color); }
.month-summary-text strong { font-weight: 600; color: var(--text-color); margin-left: 1px; margin-right: 2px;} 

.f1-status-list {
    list-style-type: none;
    padding-left: 0; 
    margin-top: 6px;
    margin-bottom: 6px;
}
.f1-status-list li {
    display: flex;
    align-items: center;
    margin-bottom: 7px; 
    font-size: 0.92rem; 
}
.f1-status-list li i {
    margin-right: 6px; 
    min-width: 20px;
    text-align: center;
    color: var(--primary-color); 
}
.f1-status-list li span {
    flex: 1;
}

.month-summary-text, .month-card-summary {
    margin-top: 15px; 
    flex-grow: 1;
}
.month-summary-text {
    padding: 18px; 
    background: var(--light-gray); 
    border-radius: 8px; 
    border-left: 4px solid var(--primary-color); 
}
.month-summary-text p, .month-card-summary p {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    font-size: 0.95rem;
}
.month-summary-text p i, .month-card-summary p i {
    margin-right: 6px;
    min-width: 20px;
    text-align: center;
    color: var(--primary-color);
    margin-top: 4px;
}
.month-summary-text p span, .month-card-summary p span {
    flex: 1;
}

.income-text {
    display: flex; /* Sử dụng flexbox để căn chỉnh icon và chữ theo chiều ngang */
    align-items: center; /* Căn giữa icon và chữ theo chiều dọc */
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #cbd5e1;
}

.income-text i {
    margin-right: 8px; /* Khoảng cách giữa icon và chữ */
    font-size: 1.2em; /* Điều chỉnh kích thước icon */
    position: relative; /* Dùng position để điều chỉnh vị trí */
    top: 7px; /* Đưa icon xuống thêm một chút nữa */
}

.income-value-large {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--income-text-color);
}

.milestone {
    margin-top: 12px;
    padding: 12px 15px;
    border-radius: 8px;
    border-left-width: 4px;
    border-left-style: solid;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.92rem;
}
.milestone i {
    margin-top: 3px;
    font-size: 1.1em;
}
.milestone > div {
    flex: 1;
}
.milestone.completed {
    background-color: #e8f5e9; 
    border-left-color: var(--success-color);
}
.milestone.completed i {
    color: var(--success-color);
}
.milestone.progress {
    background-color: #e3f2fd; 
    border-left-color: var(--info-color);
}
.milestone.progress i {
    color: var(--info-color);
}
.milestone.waiting {
    background-color: #fff8e1; 
    border-left-color: var(--warning-color);
}
.milestone.waiting i {
    color: var(--warning-color);
}


/* === BẢNG VÀ BIỂU ĐỒ === */
.summary-section { padding: 35px 0; }
.summary-table-container { padding: 0 15px; max-width: 1150px; margin: 0 auto; }
.table-responsive { width: 100%; overflow-x: auto; margin-bottom: 30px; border-radius: 10px; box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); }
table.overall-summary { width: 100%; border-collapse: collapse; font-size: 0.9rem; background-color: #fff; min-width: 850px; }
table.overall-summary th, table.overall-summary td { border: 1px solid var(--border-color); padding: 12px 15px; text-align: center; vertical-align: middle; }
table.overall-summary th { background-color: var(--accent-color-dark); color: #fff; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
table.overall-summary tbody tr:nth-child(even) { background-color: var(--light-gray); } 
table.overall-summary tbody tr:hover { background: #e0f2f1; }

/* === DIỄN GIẢI THU NHẬP === */
.income-explanation {
    background-color: var(--card-background);
    padding: 25px;
    border-radius: 12px;
    margin-top: 22px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.income-explanation h4 {
    color: var(--accent-color-dark);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}
.income-explanation h4 i {
    margin-right: 0.75rem;
    color: var(--primary-color);
}
.income-explanation > p.intro-text {
    font-size: 0.95rem;
    margin-bottom: 2rem;
    color: #4b5563;
}
.income-explanation ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.income-explanation ul li {
    background-color: transparent;
    border: none;
    padding: 0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.25rem;
}
.income-explanation ul li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.income-label {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-weight: 700;
    font-size: 1rem;
    color: var(--accent-color-dark);
    margin-bottom: 0.5rem;
}
.income-label i {
    color: var(--primary-color);
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}
.income-details {
     padding-left: calc(20px + 0.85rem); 
}
.income-details .description {
    font-size: 0.925rem;
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
}
.income-details .note {
    display: block; 
    font-size: 0.85rem;
    color: var(--text-muted);
    background-color: #fffbeb;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    border-left: 3px solid var(--warning-color);
    margin-top: 0.75rem;
}
.income-details .note strong {
    color: var(--accent-color-dark);
}
.income-explanation p.note-pb {
    font-size: 0.9rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    color: var(--text-muted);
    background-color: transparent;
    border-top: 1px dashed var(--border-color);
}
.income-explanation p.note-pb strong {
    color: var(--accent-color-dark);
}

.income-chart-container { padding: 22px; background-color: #fff; border-radius: 10px; margin-bottom: 30px; box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); }
.income-chart-title { text-align: center; font-size: 1.4rem; font-weight: 700; color: var(--accent-color-dark); margin-bottom: 22px; }

.income-chart { 
    display: flex; 
    align-items: flex-end; 
    height: 230px; 
    margin: 22px 0; 
    padding: 0 10px 15px; 
    gap: 10px; 
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto; 
    -webkit-overflow-scrolling: touch; 
    scrollbar-width: thin; 
    scrollbar-color: var(--secondary-color) var(--light-gray);
}
.income-chart::-webkit-scrollbar { height: 8px; }
.income-chart::-webkit-scrollbar-track { background: var(--light-gray); border-radius: 4px; }
.income-chart::-webkit-scrollbar-thumb { background-color: var(--medium-gray); border-radius: 4px; }
.income-chart::-webkit-scrollbar-thumb:hover { background-color: var(--secondary-color); }

.chart-bar { flex: 1; min-width: 50px; display: flex; flex-direction: column; align-items: center; position: relative; } 
.bar-value { 
    width: 70%; 
    border-radius: 5px 5px 0 0; 
    position: relative; 
    transition: height 0.6s cubic-bezier(0.25,0.1,0.25,1), background-color 0.2s ease;
    cursor: pointer;
    background-color: var(--primary-color);
}
.bar-value:hover { background-color: var(--secondary-color); } 
.bar-label { margin-top: 10px; font-size: 0.8rem; text-align: center; font-weight: 500; color: var(--dark-gray); white-space: nowrap; }
.bar-amount {
    position: absolute; top: -28px; left: 50%; transform: translateX(-50%); 
    background: rgba(44,62,80,0.88); 
    color: var(--text-light); padding: 5px 10px; border-radius: 5px; 
    font-size: 0.8rem; font-weight: 600;
    opacity: 0; visibility: hidden; transition: opacity 0.2s, visibility 0.2s, transform 0.2s; 
    white-space: nowrap; pointer-events: none; box-shadow: 0 1px 5px rgba(0,0,0,0.18);
}
.chart-bar:hover .bar-amount { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(-4px); } 
.note-container {
    margin-top: 30px;
}
.note { 
    font-size: 0.875rem; 
    color: var(--text-muted); 
    padding: 1rem; 
    background-color: #fff; 
    border-left: 4px solid var(--secondary-color); 
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}
.note i {
    color: var(--secondary-color);
    margin-top: 3px;
    font-size: 1.1rem;
}
.note strong { color: var(--text-color); }


/* === Phần tối ưu cho di động (Mobile - Xếp Dọc) === */
@media screen and (max-width: 768px) {
  /*
    KHỐI GÂY LỖI `html, body { overflow-x: hidden; }` ĐÃ ĐƯỢC XÓA BỎ
  */
	
	html {
		box-sizing: border-box;
	}
	
	
  .timeline-navigation-bar {
    position: sticky;
    top: 63px; /* Điều chỉnh giá trị này cho phù hợp với chiều cao header */
    z-index: 49; 
    transition: top 0.4s ease;
  }

  /* Cải thiện tiêu đề section cho mobile */
  .section-title {
    font-size: 1.6rem;
  }

  /* Bố cục dọc cho các thẻ tháng */
  .horizontal-timeline-wrapper {
    overflow-x: auto; /* Quy tắc này bây giờ sẽ hoạt động đúng */
    -webkit-overflow-scrolling: touch; /* Cải thiện trải nghiệm cuộn trên iOS */
    padding: 20px 15px;
  }

  .horizontal-timeline {
    display: block;
    min-width: 0;
    padding: 0;
  }

  .month-card {
    width: 100%;
    max-width: 100%; /* Đảm bảo không vượt quá chiều rộng của container */
    min-width: 0;
    margin-right: 0;
    margin-bottom: 25px;
  }

  .month-card:last-child {
    margin-bottom: 0;
  }

  /* Điều chỉnh các chi tiết nhỏ khác */
  .income-details {
    padding-left: 0;
  }

  .income-label {
    align-items: flex-start;
  }

  .income-label i {
    margin-top: 3px;
  }
  
  
}
