/* assets/css/style.css */

/* --- 1. Base Styles --- */
html {
    scroll-behavior: smooth; /* Hiệu ứng cuộn mượt */
}

body {
    background-color: var(--color-bg-primary);
    color: var(--color-text-main);
    font-family: var(--font-family-main);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    -webkit-font-smoothing: antialiased;
    padding-top: var(--header-height); /* Đừa ra ngoài để không bị che bởi sticky header */
}

/* Helper Class: Container */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Helper Class: Section Title with Red Bar */
.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text-main);
    display: flex;
    align-items: center;
    margin-bottom: 25px;
}

.section-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 20px;
    background-color: var(--color-accent-red);
    margin-right: 12px;
}


/* --- 2. Header (Sticky) --- */
.header {
    height: var(--header-height);
    background-color: var(--color-bg-primary);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000; /* Luôn trên cùng */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: background-color 0.3s ease;
}

/* JS sẽ thêm class này khi scroll */
.header-scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
}

.header__inner {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-text {
    font-size: 22px;
    font-weight: 800;
    color: var(--color-text-main);
    letter-spacing: 1px;
}

.logo-text img {
    max-height: 80px; /* Phóng to logo lên 80px */
    width: auto;
}

.nav__list {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav__link {
    font-size: 15px;
    color: var(--color-text-main);
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav__link:hover {
    color: var(--color-accent-red);
}

.nav__link--active {
    color: var(--color-accent-red);
    font-weight: 600;
}

.nav__btn-consult {
    background-color: var(--color-accent-red);
    color: #ffffff !important;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.nav__btn-consult:hover {
    background-color: var(--color-accent-red-hover);
    transform: translateY(-2px);
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 18px;
    cursor: pointer;
    z-index: 1001;
}

.mobile-menu-btn span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: var(--color-text-main);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* --- 3. Top Banner --- */
.hero-banner {
    width: 100%;
    background-image: url('https://placehold.co/1920x400/eeeeee/666666?text=BANNER+NGANG'); /* Giả lập ảnh banner */
    background-size: cover;
    background-position: center;
    min-height: 400px; /* Chiều cao tiêu chuẩn 400px */
    display: flex;
    align-items: center; /* Canh giữa nội dung theo chiều dọc */
    color: var(--color-text-main);
    margin-bottom: 50px;
}

.hero-banner__inner {
    text-align: center;
    width: 100%;
}

.hero-banner__title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 15px;
}


/* --- 4. Section 1: VIDEO NỔI BẬT --- */
.featured-videos {
    margin-bottom: 70px;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 cột đều nhau cho desktop */
    gap: 20px;
    margin-bottom: 30px;
}

.video-card {
    background-color: var(--color-bg-primary);
}

.video-thumbnail {
    position: relative;
    aspect-ratio: 16 / 9; /* Giữ tỷ lệ video */
    overflow: hidden;
    margin-bottom: 15px;
    border-radius: 8px;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.play-icon {
    position: absolute;
    bottom: 10px;
    left: 10px;
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    font-size: 18px;
    border: 2px solid #ffffff;
    transition: all 0.3s ease;
}

.video-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-main);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Giới hạn 2 dòng */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-card:hover .video-thumbnail img {
    transform: scale(1.05);
}

.video-card:hover .play-icon {
    background-color: var(--color-accent-red);
    border-color: var(--color-accent-red);
}

/* Pagination Dots */
.pagination-dots {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--color-dot-inactive);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.dot--active {
    background-color: var(--color-accent-red);
}


/* --- 5. Section 2: Tin tức / Bài viết --- */
.main-content {
    display: flex;
    gap: 40px; /* Khoảng cách 2 cột */
    margin-bottom: 100px;
}

.article-main {
    flex: 7; /* Cột trái chiếm 70% */
}

.article-main__title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--color-text-main);
}

.article-main__sapo {
    font-size: 16px;
    color: var(--color-text-sub);
    margin-bottom: 25px;
    line-height: 1.8;
}

.article-main__image {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    margin-bottom: 30px;
}

.article-main__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


.sidebar-news {
    flex: 3; /* Cột phải chiếm 30% */
}

.related-news-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.news-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.news-item__thumb {
    width: 120px;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    flex-shrink: 0; /* Không cho thu nhỏ ảnh */
}

.news-item__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-item__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-main);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Giới hạn 3 dòng */
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.news-item:hover .news-item__title {
    color: var(--color-accent-red);
}


/* --- 6. Global Elements (Buttons) --- */

/* Scroll To Top Button */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background-color: var(--color-bg-primary);
    color: var(--color-accent-red);
    border: 2px solid var(--color-border);
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    cursor: pointer;
    z-index: 999;
    opacity: 0; /* Mặc định ẩn */
    visibility: hidden;
    transition: all 0.3s ease;
}

.scroll-top--show {
    opacity: 1; /* JS sẽ thêm class này khi scroll */
    visibility: visible;
}

.scroll-top:hover {
    background-color: var(--color-accent-red);
    color: #ffffff;
    border-color: var(--color-accent-red);
}

/* Fixed CTA Button (Liên hệ / Tư vấn) */
.fixed-cta {
    position: fixed;
    bottom: 90px;
    right: 30px;
    background-color: var(--color-accent-red);
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 10px rgba(165, 0, 0, 0.3);
    z-index: 999;
    transition: background-color 0.3s ease;
}

.fixed-cta:hover {
    background-color: var(--color-accent-red-hover);
}


/* --- 7. Video Modal (Popup) --- */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.video-modal.active {
    opacity: 1;
    visibility: visible;
}

.video-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
}

.video-modal__content {
    position: relative;
    width: 90%;
    max-width: 900px;
    background: #000;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 2001;
}

.video-modal__close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 35px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.3s;
}

.video-modal__close:hover {
    color: var(--color-accent-red);
}

.video-modal__iframe-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* Tỷ lệ 16:9 chuẩn của Youtube */
}

.video-modal__iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

/* --- 8. Consult Modal --- */
.consult-modal__content {
    position: relative;
    width: 90%;
    max-width: 450px;
    background: var(--color-bg-primary);
    border-radius: 12px;
    padding: 40px 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 2001;
}

.consult-modal__close {
    color: var(--color-text-sub);
    top: 15px;
    right: 20px;
}

.consult-modal__close:hover {
    color: var(--color-accent-red);
}

.consult-form .form-group {
    margin-bottom: 15px;
}

.consult-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s ease;
    color: var(--color-text-main);
}

.consult-input:focus {
    border-color: var(--color-accent-red);
}

.consult-btn {
    width: 100%;
    padding: 14px;
    background-color: var(--color-accent-red);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}

.consult-btn:hover {
    background-color: var(--color-accent-red-hover);
}

/* --- 9. Footer --- */
.footer {
    background-color: #000000;
    color: #ffffff;
    padding: 50px 0;
    text-align: center;
}

.footer__logo {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
}

.footer__copy {
    font-size: 13px;
    color: #999999;
}

/* --- 10. Lưới Tin tức (Trang tin_tuc.php) --- */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 50px;
}

.news-card-vertical {
    border: 1px solid #eeeeee;
    border-radius: 8px;
    overflow: hidden;
    background-color: #ffffff;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.news-card-vertical:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.news-card-vertical__thumb {
    display: block;
    width: 100%;
    height: 200px;
}

.news-card-vertical__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-card-vertical__content {
    padding: 15px;
}

.news-card-vertical__title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.4;
}

.news-card-vertical__sapo {
    font-size: 14px;
    color: #666666;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Cắt ngắn nội dung nếu dài quá 2 dòng */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- 11. Floating Contact Buttons --- */
.floating-contact {
    position: fixed;
    bottom: 30px;
    left: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 999;
}

.floating-contact__btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    text-decoration: none;
    font-size: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, background-color 0.3s ease;
    animation: pulse-effect 2s infinite;
}

.floating-contact__btn:hover {
    transform: scale(1.1);
    color: #ffffff;
    animation: none; /* Dừng hiệu ứng toả sóng khi di chuột vào */
}

@keyframes pulse-effect {
    0% {
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(0, 104, 255, 0.6);
    }
    70% {
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2), 0 0 0 15px rgba(0, 104, 255, 0);
    }
    100% {
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(0, 104, 255, 0);
    }
}

.btn-tiktok { background-color: #000000; }
.btn-tiktok:hover { background-color: #333333; }

.btn-facebook { background-color: #1877F2; }
.btn-facebook:hover { background-color: #166FE5; }

.btn-linkedin { background-color: #0A66C2; }
.btn-linkedin:hover { background-color: #08539E; }

.btn-zalo { background-color: #0068FF; font-size: 13px; font-weight: 700; }
.btn-zalo:hover { background-color: #0054cc; }