/* ============================================================
    1. CẤU TRÚC CHUNG (LINH HOẠT MOBILE - KHÓA 1200PX DESKTOP)
   ============================================================ */
body {
    font-family: 'Inter', sans-serif, Arial !important;
    background-color: #f4f7f9;
    margin: 0;
    padding: 0;
}

/* Container chính: Chỉ khóa 1200px khi màn hình đủ lớn */
.pkp_structure_content,
.footer-container,
.pkp_navigation_primary_row {
    width: 100% !important; /* Mặc định đầy màn hình trên mobile */
    max-width: 1200px !important; /* Không bao giờ vượt quá 1200px */
    margin: 0 auto !important;
    display: flex !important;
    flex-wrap: wrap !important; /* Cho phép rớt dòng trên mobile */
}

/* Cột chính và Sidebar tự động dàn hàng ngang hoặc dọc */
.pkp_structure_main { 
    width: 75% !important; 
    padding: 3px !important; 
}
.pkp_structure_sidebar { 
    width: 25% !important; 
    padding: 2px !important; 
}

/* Trên điện thoại: Ép cột chính và cột phải xếp chồng lên nhau */
@media (max-width: 992px) {
    .pkp_structure_main, 
    .pkp_structure_sidebar {
        width: 100% !important;
        float: none !important;
    }
}
/* ============================================================
    2. ĐẦU TRANG & MENU TÀI KHOẢN (USER MENU)
   ============================================================ */
header.pkp_structure_head, .pkp_head_wrapper {
    background-color: #ffffff !important;
    border: none !important; 
    margin: 0 !important; 
    padding: 0 !important;
    position: relative !important; /* Làm mốc cho các phần tử absolute bên trong */
}

.pkp_site_name_wrapper { display: none !important; }

/* Cụm tài khoản trên Banner */
#navigationUserWrapper {
    position: absolute !important;
    top: 15px !important;
    left: 490px !important;
    display: flex !important;
    justify-content: flex-end !important;
    padding-right: 5px !important;
    /* QUAN TRỌNG: z-index cao để nổi lên trên cùng */
    z-index: 9999 !important; 
}

#navigationUserWrapper .pkp_navigation_user {
    display: flex !important;
    flex-direction: row !important;
    gap: 10px !important;
    list-style: none !important;
    margin: 0 !important; 
    padding: 0 !important;
}

#navigationUserWrapper .pkp_navigation_user > li > a {
    color: #ffcc00 !important;
    font-weight: bold !important;
    font-size: 13px !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
    padding: 5px 8px !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

#navigationUserWrapper .pkp_navigation_user > li > a:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border-radius: 4px;
}

#navigationUserWrapper .pkp_navigation_user .task_count { display: none !important; }

/* ============================================================
    3. THANH MENU CHÍNH (MÀU XANH - CÓ GẠCH TRẮNG PHÂN CÁCH)
   ============================================================ */
nav.pkp_site_nav_menu {
    background-color: transparent !important;
    border: none !important; 
    box-shadow: none !important;
    width: 100% !important; 
    margin: 0 !important; 
    padding: 0 !important;
    position: relative !important;
    z-index: 100 !important; /* Thấp hơn menu tài khoản */
}

.pkp_navigation_primary_row {
    width: 1200px !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    background-color: #0451b5 !important;
    border-bottom: 1px solid #e2e7ed !important;
    box-shadow: 0 2px 3px rgba(0,0,0,0.1) !important;
}

.pkp_navigation_primary_wrapper {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    height: 45px !important;
    padding: 0 !important; 
    margin: 0 !important;
}

ul.pkp_navigation_primary {
    display: flex !important;
    flex-grow: 1 !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Tạo gạch trắng phân cách */
ul.pkp_navigation_primary > li {
    border-right: 1px solid #ffffff !important;
    margin: 0 !important;
}

ul.pkp_navigation_primary > li:last-child {
    border-right: none !important;
}

/* Mục TRANG CHỦ đầu tiên có màu đỏ */
ul.pkp_navigation_primary > li:first-child {
    background-color: #e32028 !important;
}

ul.pkp_navigation_primary > li > a {
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    padding: 0 15px !important; /* Tăng padding để chữ không dính vào vạch ngăn */
    text-transform: uppercase !important;
    white-space: nowrap !important;
    display: flex !important;
    align-items: center !important;
    height: 45px !important;
    text-decoration: none !important;
    transition: all 0.2s;
}

ul.pkp_navigation_primary > li > a:hover {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: #ffcc00 !important;
}

/* Icon Home màu trắng */
.pkp_navigation_primary > li:first-child > a::before {
    content: "";
    display: inline-block;
    width: 18px; 
    height: 18px;
    margin-right: 5px;
    margin-left: 5px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat;
    background-size: contain;
}

/* Nút tìm kiếm trên Menu */
.pkp_navigation_search_wrapper {
    margin-left: auto !important;
    padding-right: 15px !important;
}

.pkp_navigation_search_wrapper a {
    color: #ffffff !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
}
/* Đảm bảo khối ảnh quảng cáo luôn nằm dưới */
.banner-ads-wrapper {
    position: relative !important;
    z-index: 1 !important;
}

/* Đảm bảo menu chính và menu con phải nằm trên cùng */
nav.pkp_site_nav_menu, .pkp_navigation_primary_row {
    position: relative !important;
    z-index: 999 !important; /* Số lớn hơn z-index của banner */
}

/* Ép các menu con (dropdown) hiển thị trên mọi thứ */
ul.pkp_navigation_primary li ul {
    z-index: 1000 !important;
}
/* ============================================================
    4. BREADCRUMBS (TRANG CHỦ / GIỚI THIỆU)
   ============================================================ */
@media (min-width: 1200px) { .pkp_structure_content { padding-top: 0 !important; } }

.cmp_breadcrumbs {
    background: transparent !important;
    border: none !important; box-shadow: none !important;
    padding: 1px 0 !important; margin: -29px 0 0 0 !important;;
}

.cmp_breadcrumbs ol li a, .cmp_breadcrumbs ol li {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #333 !important;
    text-decoration: none !important;
}

.cmp_breadcrumbs ol li.current { color: #0451b5 !important; }

/* Ẩn tiêu đề trang lặp lại */
.page_about h1.page_title, 
body[class*="pkp_page_"] h1.page_title { display: none !important; }

/* ============================================================
    5. FOOTER (SỬA LỖI ICON KHỔNG LỒ)
   ============================================================ */
.footer-wrapper {
    background: #001a33 !important;
    color: #ffffff !important;
    padding: 40px 0 30px 0 !important;
    border-top: 4px solid #ffcc00 !important;
    width: 100% !important;
}

.footer-container {
    width: 1200px !important;
    margin: 0 auto !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 30px !important;
}

.footer-column { flex: 1 !important; min-width: 0 !important; }

.footer-title {
    color: #ffcc00 !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    border-left: 3px solid #ffcc00;
    padding-left: 10px; margin-bottom: 20px !important;
}

.footer-svg-icon {
    display: inline-flex !important;
    width: 20px !important; height: 20px !important;
    margin-right: 10px !important;
    color: #ffcc00 !important;
    flex-shrink: 0 !important;
}

.footer-svg-icon svg {
    width: 18px !important; height: 18px !important;
    display: block !important;
}

.footer-info {
    display: flex !important;
    align-items: flex-start !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    margin-bottom: 12px !important;
}

.footer-text { font-size: 14px !important; color: #cccccc !important; }
.footer-divider { height: 1px; background: rgba(255,255,255,0.1); margin: 15px 0; width: 100% !important; }
.uppercase { text-transform: uppercase !important; font-weight: bold; }

/* ============================================================
    6. SIDEBAR & NÚT GỬI BÀI
   ============================================================ */
.pkp_structure_sidebar .pkp_block {
    background: #ffffff !important;
    border: 1px solid #f0f0f0 !important;
    border-radius: 8px !important;
    padding: 20px !important;
    margin-bottom: 20px !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05) !important;
}

.pkp_structure_sidebar .pkp_block .title {
    color: #e32028 !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    position: relative !important;
    padding: 0 0 15px 15px !important;
}

.pkp_structure_sidebar .pkp_block .title::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 15px;
    width: 4px; background: #e32028; border-radius: 2px;
}

/* Nút gửi bài cố định */
.floating-submission-btn {
    display: flex !important;
    position: fixed; bottom: 40px; right: 40px; z-index: 3;
    padding: 15px 30px;
    background: linear-gradient(135deg, #e32028 0%, #a30000 100%);
    color: #ffffff !important;
    font-size: 16px; font-weight: 800;
    text-transform: uppercase; border-radius: 50px;
    box-shadow: 0 10px 30px rgba(227, 32, 40, 0.4);
    transition: all 0.3s;
    text-decoration: none !important;
}
.floating-submission-btn:hover { transform: translateY(-5px); filter: brightness(1.1); }

@media (min-width: 1200px) {
    .pkp_navigation_primary > li:first-child a {
        margin-left: 0 !important;
    }
}

/* ============================================================
    TRANG TRÍ NÚT CHUYỂN NGÔN NGỮ
   ============================================================ */
.language-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    justify-content: flex-end; /* Đẩy sang phải theo cụm tài khoản */
}

.lang-item {
    text-decoration: none !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    padding: 3px 8px !important;
    border-radius: 4px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    line-height: 1;
    text-transform: uppercase;
}

/* Nút tiếng Anh (Màu vàng giống nút tài khoản) */
.lang-item.en {
    color: #ffcc00 !important;
    border-color: #ffcc00 !important;
}

/* Nút tiếng Việt (Màu trắng) */
.lang-item.vi {
    color: #ffffff !important;
    border-color: #ffffff !important;
}

/* Hiệu ứng khi di chuột vào */
.lang-item:hover {
    background-color: #ffcc00 !important;
    color: #001a33 !important; /* Chữ tối trên nền vàng */
    border-color: #ffcc00 !important;
}

/* Vạch ngăn cách */
.lang-divider {
    width: 1px;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.5);
}

/* Fix lỗi menu tài khoản bị che (Tổng hợp lại cho chắc chắn) */
#navigationUserWrapper {
    z-index: 99999 !important;
}
.pkp_navigation_primary_row {
    z-index: 5 !important;
}
#navigationUserWrapper ul {
    overflow: visible !important;
}

/* ============================================================
    8. KHUNG TIN TỨC CHẠY NGANG (NEWS TICKER)
   ============================================================ */
.news-ticker-container {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e7ed;
    border-left: 4px solid #e32028; /* Viền đỏ đồng bộ với menu */
    border-radius: 4px;
    overflow: hidden;
    margin: 3px auto !important; /* Căn giữa */
    width: 100% !important;
    max-width: 1200px !important; /* Khóa độ rộng bằng chuẩn website */
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.news-ticker-title {
    background: #e32028;
    color: #fff;
    padding: 5px 5px;
    font-weight: bold;
    font-size: 14px;
    white-space: nowrap;
    text-transform: uppercase;
    z-index: 2;
}

.news-ticker-content {
    flex-grow: 1;
    overflow: hidden;
    padding-left: 15px;
    white-space: nowrap;
}

.news-ticker-list {
    display: inline-block;
    padding-left: 100%; /* Bắt đầu chạy từ mép phải màn hình */
    animation: ticker 30s linear infinite; /* Tốc độ chạy (tăng giảm 30s để chỉnh tốc độ) */
}

/* Dừng chạy khi người dùng di chuột vào để dễ click */
.news-ticker-container:hover .news-ticker-list {
    animation-play-state: paused;
}

.news-ticker-list a {
    color: #0451b5;
    text-decoration: none;
    font-weight: 600;
    margin-right: 50px; /* Khoảng cách giữa các tin */
    font-size: 14px;
}

.news-ticker-list a:hover {
    color: #e32028;
    text-decoration: underline;
}

/* Hiệu ứng chuyển động */
@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* Ghi đè khoảng cách lề trên bị dư của nội dung chính */
@media (min-width: 992px) {
    .pkp_structure_content {
        padding-top: 0 !important; /* Đổi 0 thành con số khác nếu bạn muốn lề hẹp lại thay vì xóa hẳn */
    }
}

/* Bỏ padding trên/dưới và viền ngang, GIỮ LẠI padding trái/phải của hệ thống */
.pkp_page_index .additional_content {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-top: none !important;
}

/* Xóa hoàn toàn khoảng hở phía dưới của danh sách breadcrumbs */
.cmp_breadcrumbs ol {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}