﻿/* =====================================================================
   CSS TICKER - BĂNG CHUYỀN CHẠY LIÊN TỤC & ĐÃ SỬA LỖI LÙI NỘI DUNG
   ===================================================================== */


/* Keyframe chạy cuộn nối đuôi mượt mà từ phải sang trái */
@keyframes marquee-continuous {
    0% {
        transform: translateX(0);         /* Vị trí ban đầu */
    }
    2% {
        transform: translateX(0);         /* Giữ nguyên vị trí ~3 giây đầu cho người dùng kịp nhìn */
    }
    100% {
        transform: translateX(-50%);     /* Bắt đầu trượt hết vòng tuần hoàn */
    }
}

/* 2. KHUNG CHỨA TỔNG THỂ (CONTAINER) - NỀN 100%, CHỮ LÙI VÀO GIỮA 1200PX */
.ticker-container {
    height: 34px;
    width: 100% !important;
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, rgb(255, 251, 235) 0%, rgb(254, 252, 232) 60%, rgb(255, 255, 255) 100%);
    border-top: 2px solid rgb(252, 211, 77);
    border-bottom: 2px solid rgb(252, 211, 77);
    box-shadow: rgba(217, 119, 6, 0.1) 0px 1px 6px;
    box-sizing: border-box;
    display: flex;
    align-items: center;

    /* Lề khớp với .site-container (max-width 1200px, padding 10px) */
    padding-left: max(10px, calc((100% - 1200px) / 2 + 10px)) !important;
    padding-right: max(10px, calc((100% - 1200px) / 2 + 10px)) !important;
}


.ticker-container .ticker-caption {
    height: 100%;
    z-index: 10;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    padding-left: 14px;
    padding-right: 26px;
    background: linear-gradient(135deg, rgb(180, 83, 9) 0%, rgb(217, 119, 6) 100%);
    clip-path: polygon(0px 0px, calc(100% - 12px) 0px, 100% 50%, calc(100% - 12px) 100%, 0px 100%);
}


.ticker-container .ticker-caption::before {
    content: "\ed61";
    font-family: 'tabler-icons';
    font-style: normal;
    display: inline-block;
    font-size: 20px;
    color: #f3dfb8;
    flex-shrink: 0;
}

/* Định dạng chữ TIN VẮN */
.ticker-container .ticker-caption p {
    margin: 0;
    padding: 0;
    color: #ffffff !important;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* 4. KHUNG HIỂN THỊ DANH SÁCH TIN VẮN */
.ticker-container ul {
    list-style: none;
    padding: 0;
    margin: 0;
    height: 100%;
    flex-grow: 1;
    overflow: hidden;
    position: relative;
    white-space: nowrap;
}

/* Thẻ bọc chạy animation (JS tự tạo) */
.ticker-container ul .marquee-wrapper {
    display: inline-flex !important;
    align-items: center;
    height: 100%;
    white-space: nowrap;
    will-change: transform;
    /* Tốc độ 60s đằm mắt, dễ đọc */
    animation: marquee-continuous 60s linear infinite; 
}

/* 5. ĐỊNH DẠNG BÀI TIN VÀ KHẮC PHỤC LỖI TRÙNG ICON */

/* Ép các div/li chứa tin hiển thị dạng hàng ngang */
.ticker-container ul div,
.ticker-container ul li {
    position: static !important;
    top: auto !important;
    left: auto !important;
    display: inline-flex !important;
    align-items: center;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 20px 0 0 !important; /* Khoảng cách giữa các bài tin */
    white-space: nowrap !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Xóa icon thừa trên div và li để tránh bị lặp icon */
.ticker-container ul div::before,
.ticker-container ul li::before {
    display: none !important;
    content: "" !important;
}

/* CHỈ GÁN 1 ICON HÌNH THOI (◆) VÀO DUY NHẤT THẺ A */
.ticker-container ul a::before {
    content: "◆";                     /* Icon hình thoi Unicode */
    color: #d97706;                   /* Màu cam vàng chuẩn */
    font-size: 10px;                  /* Kích thước icon vừa vặn */
    margin-right: 12px;               /* Khoảng cách từ icon đến chữ */
    display: inline-block;
    transform: scaleY(0.9);
}

/* Decor font chữ và màu sắc tiêu đề bài tin */
.ticker-container ul a {
    color: #4a2c11;                   /* Màu chữ nâu sẫm thanh lịch */
    font-family: 'Be Vietnam Pro', Arial, sans-serif;
    font-size: 14.5px;                /* Cỡ chữ dễ nhìn */
    font-weight: 400;
    text-decoration: none;
    white-space: nowrap;
    display: inline-block;
    transition: color 0.2s ease;
}

/* Hiệu ứng khi di chuột vào tiêu đề */
.ticker-container ul a:hover {
    color: #b45309;                   /* Đổi sang màu cam đậm */
    text-decoration: none;            /* Gạch chân nhẹ khi rê chuột */
}

/* 6. TẠM DỪNG CHẠY KHI DI CHUỘT VÀ RESPONSIVE */

/* Hover chuột vào thanh Ticker thì tạm dừng chạy chữ */
.ticker-container:hover ul .marquee-wrapper {
    animation-play-state: paused;
}

/* XỬ LÝ RESPONSIVE MÀN HÌNH NHỎ (Dưới 1200px) */
/*@media (max-width: 1200px) {
    .ticker-container {
        padding-left: 0px !important;
        padding-right: 0px !important;
    }
}*/

/* Tối ưu riêng cho màn hình di động */
@media (max-width: 500px) {
    .ticker-container .ticker-caption {
        padding-left: 10px;
        padding-right: 20px;
    }
    .ticker-container .ticker-caption p {
        font-size: 11px;
    }
    .ticker-container ul a {
        font-size: 13.5px;
    }
}