/*
Theme Name: AP Nexus Digital Pro
Theme URI: https://anphatproduction.com/
Author: An Phat Team
Description: Theme đa năng động dành cho Agency Marketing, VPS và Công nghệ. Tuỳ biến 100% từ Admin.
Version: 2.0
Text Domain: nexus
*/

/* --- CSS TÙY CHỈNH --- */
[x-cloak] { display: none !important; }

/* Ép toàn bộ khung Slider dùng GPU để trượt mượt hơn */
.nexusNewsSwiper {
    touch-action: pan-y;
    -webkit-user-select: none;
    user-select: none;
}

.nexusNewsSwiper .swiper-slide {
    height: auto; /* Giúp Swiper tính toán chiều cao chuẩn */
    transform: translate3d(0, 0, 0); /* Ép Render Layer riêng */
}

/* Tối ưu Card: Bỏ transition-all, chỉ dùng transition cho các mục cần thiết */
.news-card-premium {
    transition: transform 0.4s cubic-bezier(0.2, 0, 0.2, 1), 
                box-shadow 0.4s ease;
    will-change: transform;
    backface-visibility: hidden;
    transform: translate3d(0, 0, 0);
}

/* Chỉ thực hiện hiệu ứng khi Slider ĐÃ DỪNG (không bị giật khi đang trượt) */
.nexusNewsSwiper:not(.swiper-transitioning) .news-card-premium:hover {
    transform: translate3d(0, -10px, 0);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
}

/* Tối ưu ảnh: Chống răng cưa và lag khi zoom */
.news-card-premium img {
    transition: transform 0.8s cubic-bezier(0.2, 0, 0.2, 1);
    will-change: transform;
    transform: translate3d(0, 0, 0) scale(1);
}

.news-card-premium:hover img {
    transform: translate3d(0, 0, 0) scale(1.05);
}

/* Style cho phân trang số */
.nexus-pagination .page-numbers {
    display: inline-flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    font-weight: 800;
    font-size: 13px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nexus-pagination .current {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.4);
}

.nexus-pagination .page-numbers:hover:not(.current) {
    border-color: #2563eb;
    color: #2563eb;
    transform: translateY(-2px);
}

/* Hiệu ứng Pulse cho Hotline */
.cta-pulse {
    animation: pulse-blue 2s infinite;
}
@keyframes pulse-blue {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(37, 99, 235, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}
.animate-float { animation: float 6s ease-in-out infinite; }
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-30px); }
}
.heroSwiper h2 { text-wrap: balance; }

/* 1. Đưa Hero vào trạng thái đứng im tuyệt đối */
.nexus-fixed-hero {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh; /* Ép cao bằng màn hình */
    z-index: 1;    /* Nằm dưới cùng */
    pointer-events: auto; /* Vẫn cho phép bấm nút trong slide */
}

/* 2. Đẩy nội dung xuống để ban đầu không bị che Hero */
.nexus-moving-content {
    position: relative;
    z-index: 10;      /* Nằm trên Hero */
    margin-top: 100vh; /* Đẩy xuống đúng bằng chiều cao Hero */
    background: #f8f9fb; /* PHẢI CÓ MÀU NỀN ĐỂ CHE ĐƯỢC HERO */
    box-shadow: 0 -20px 80px rgba(0, 0, 0, 0.5); /* Tạo bóng đổ cực mạnh khi nội dung trồi lên */
}

/* 3. Đảm bảo Header luôn ở trên cùng */
header, nav {
    z-index: 1000 !important;
}

/* 4. Fix cho Mobile: Tắt hiệu ứng nếu màn hình nhỏ (tùy chọn) */
@media (max-width: 1024px) {
    .nexus-fixed-hero {
        position: relative;
        height: auto;
    }
    .nexus-moving-content {
        margin-top: 0;
    }
}
/* --- CẤU HÌNH CHO MÁY TÍNH (DESKTOP) --- */
@media (min-width: 1025px) {
    /* Ghim Hero ở nền */
    .nexus-hero-fixed-layer {
        position: fixed !important;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        z-index: -1; /* Nằm dưới nội dung */
    }

    /* Lớp nội dung trồi lên che Hero */
    .nexus-main-content-layer {
        position: relative;
        z-index: 10;
        background-color: #ffffff; /* Bắt buộc có màu nền để che Hero */
        box-shadow: 0 -30px 100px rgba(0,0,0,0.3);
    }
}

/* --- CẤU HÌNH CHO DI ĐỘNG (MOBILE & TABLET) --- */
@media (max-width: 1024px) {
    /* Trả Hero về bình thường để không hỏng layout */
    .nexus-hero-fixed-layer {
        position: relative !important;
        height: auto !important; /* Để tự nhận chiều cao nội dung */
        min-height: 600px; /* Hoặc chiều cao mong muốn */
        z-index: 1;
    }

    /* Trả nội dung về bình thường, không có khoảng hở margin-top */
    .nexus-main-content-layer {
        position: relative;
        margin-top: 0 !important; /* Xóa khoảng trắng do PHP tạo ra */
        z-index: 2;
    }
    
    /* Điều chỉnh tiêu đề trên mobile cho đỡ to */
    .nexus-hero-fixed-layer h2 span {
        font-size: 45px !important; /* Ép cỡ chữ mobile */
        line-height: 1.1 !important;
    }
}

/* --- DÙNG CHUNG --- */
html, body {
    overflow-x: hidden;
    background: #ffffff;
}
/* Đảm bảo Footer là phần kết thúc của Curtain */
footer {
    background-color: #ffffff !important;
    position: relative !important;
    z-index: 50 !important; /* Phải cao hơn lớp Hero z-index -1 */
    margin-top: -1px; /* Khử khoảng trắng li ti giữa các section */
}

/* Đảm bảo nội dung luôn đủ dài để đẩy footer hiện ra */
@media (min-width: 1025px) {
    .nexus-main-content-layer {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }
    footer {
        margin-top: auto; /* Đẩy footer xuống dưới cùng của layer nội dung */
    }
}
/* Tùy chỉnh chấm phân trang Slider Khách hàng */
.testi-pagination .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: #cbd5e1;
    opacity: 1;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.testi-pagination .swiper-pagination-bullet-active {
    width: 30px;
    background: #2563eb;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}
/* Chỉ áp dụng hiệu ứng fixed cho trang chủ, các trang khác hiện bình thường */
body:not(.home) .nexus-hero-fixed-layer {
    display: none !important;
}

body:not(.home) .nexus-main-content-layer {
    margin-top: 0 !important;
}

/* Đảm bảo Landing Page luôn hiển thị trên cùng */
.nexus-landing-wrapper {
    position: relative;
    z-index: 100;
    min-height: 100vh;
}
/* TỐI ƯU LANDING PAGE PRO */
body:not(.home) .nexus-hero-fixed-layer { display: none !important; }
body:not(.home) .nexus-main-content-layer { margin-top: 0 !important; }

.nexus-landing-pro-content {
    padding-top: 100px;
    background: white;
    min-height: 100vh;
    position: relative;
    z-index: 100;
}

/* Pagination Style cho Landing Page */
.testi-pagination-landing .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: #cbd5e1;
    opacity: 1;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.testi-pagination-landing .swiper-pagination-bullet-active {
    width: 30px !important;
    background: #2563eb !important;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}
/* --- HỆ THỐNG MÀU SẮC ĐỘNG (DYNAMIC COLORS) --- */

/* Ghi đè các class Tailwind bằng Biến CSS */
.bg-primary, 
.bg-blue-600,
.bg-blue-500,
.bg-anphat { 
    background-color: var(--primary-color) !important; 
}

.text-primary, 
.text-blue-600, 
.text-blue-500,
.text-anphat { 
    color: var(--primary-color) !important; 
}

.border-primary, 
.border-blue-600,
.border-anphat { 
    border-color: var(--primary-color) !important; 
}

/* Hiệu ứng Hover động */
.hover\:bg-blue-700:hover, 
.hover\:bg-primary:hover,
.hover\:bg-blue-600:hover { 
    filter: brightness(90%); /* Tự động làm đậm màu bất kỳ khi hover */
}

/* Các thành phần đặc biệt khác */
.decoration-blue-600 { 
    text-decoration-color: var(--primary-color) !important; 
}

/* Chấm phân trang Slider */
.testi-pagination .swiper-pagination-bullet-active,
.news-pagination .swiper-pagination-bullet-active {
    background-color: var(--primary-color) !important;
}
/* --- TỐI ƯU HÓA HỆ THỐNG GIAO DIỆN --- */

body { 
    font-family: 'Be Vietnam Pro', sans-serif; 
    scroll-behavior: smooth; 
}

/* Alpine.js: Ẩn phần tử trước khi script load xong */
[x-cloak] { display: none !important; }

/* Tăng tốc phần cứng GPU cho hiệu ứng mượt mà */
.transform-gpu { 
    backface-visibility: hidden; 
    perspective: 1000px; 
    will-change: transform;
}

/* Hiệu ứng cắt dòng chữ (Tránh lag khi render) */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;  
    overflow: hidden;
}

/* Ép Logo động có kích thước chuẩn */
.custom-logo-link img {
    height: 3rem !important; /* h-12 */
    width: auto !important;
    object-fit: contain;
}

/* ============================================================
   HỆ THỐNG MÀU ĐỘNG CHUẨN PREMIUM - FIX LỖI BACKGROUND TIÊU ĐỀ
   ============================================================ */

/* 1. CHỈ ÁP DỤNG MÀU NỀN (BACKGROUND) CHO CÁC THÀNH PHẦN SAU: */
.bg-primary, 
.bg-blue-600, 
.bg-blue-500,
.pricing-tab-active,
.nexus-pagination .current,
.swiper-pagination-bullet-active,
/* Chỉ chọn các span làm nhiệm vụ gạch chân */
footer h4 span.w-8,
#news div.w-20 { 
    background-color: var(--primary-color) !important; 
}

/* 2. CHỈ ÁP DỤNG MÀU CHỮ (TEXT COLOR) CHO TIÊU ĐỀ VÀ ICON */
.text-primary, 
.text-blue-600, 
.text-blue-500,
#pricing h3,
#pricing .text-3xl,
#pricing .text-4xl,
#news h2,
#news h3 a,
footer i,
footer span.text-blue-500 { 
    color: var(--primary-color) !important;
    background-color: transparent !important; /* Triệt tiêu màu nền lọt vào */
}

/* 3. KHỬ MÀU NỀN CHO TẤT CẢ TIÊU ĐỀ (ĐẢM BẢO AN TOÀN) */
h1, h2, h3, h4, h5, h6,
h1 span, h2 span, h3 span {
    background-color: transparent !important;
}

/* 4. HIỆU ỨNG HOVER CHO NÚT BẤM (CÓ NỀN) */
/* Chỉ nhắm vào button và thẻ a làm nhiệm vụ nút bấm */
#pricing button[class*="py-"]:hover,
#pricing a[class*="py-"]:hover,
nav a.bg-primary:hover,
.hover\:bg-primary:hover {
    background-color: var(--primary-hover) !important;
    color: #ffffff !important;
    border-color: var(--primary-hover) !important;
    transform: translateY(-3px);
    transition: all 0.3s ease;
}

/* 5. HIỆU ỨNG HOVER CHO LINK VÀ CHỮ (KHÔNG NỀN) */
#pricing button:not([class*="py-"]):hover,
#news h3 a:hover,
footer a:hover,
nav a:not(.bg-primary):hover {
    color: var(--primary-hover) !important;
    background-color: transparent !important;
}

/* 6. BORDER CHỦ ĐẠO */
.border-primary, 
.border-blue-600,
.border-blue-500 { 
    border-color: var(--primary-color) !important; 
}
/* ============================================================
   FIX MÀU ICON & HOVER TRONG KHỐI THANH TOÁN (PAYMENT)
   ============================================================ */

/* 1. Đưa icon về màu chủ đạo ở trạng thái bình thường */
#payment i.fas {
    color: var(--primary-color) !important;
    background-color: transparent !important;
}

/* 2. Ép màu cho vòng tròn bao quanh icon ở trạng thái bình thường (nếu cần) */
#payment .bg-white\/5 {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* 3. HIỆU ỨNG HOVER CHO CẢ KHỐI (GROUP HOVER) */

/* Khi di chuột vào khối: Vòng tròn bao quanh icon chuyển sang màu chủ đạo */
#payment .group:hover div[class*="bg-white/5"] {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

/* Khi di chuột vào khối: Icon fas chuyển sang màu trắng để nổi bật trên nền màu chính */
#payment .group:hover i.fas {
    color: #ffffff !important;
}

/* 4. FIX MÀU CHO SỐ TÀI KHOẢN (TRONG THẺ 3D) */
#payment .text-blue-600 {
    color: var(--primary-color) !important;
}

/* Fix màu cho border đáy của thẻ ngân hàng */
#payment .border-blue-600 {
    border-bottom-color: var(--primary-color) !important;
}

/* ============================================================
   NGHỊCH ĐẢO MÀU HOTLINE - ƯU TIÊN CAO NHẤT
   ============================================================ */

/* 1. TRẠNG THÁI BÌNH THƯỜNG: Ép ra màu PHỤ (Hover Color) */
nav a[href^="tel:"],
.fixed.bottom-10 a[href^="tel:"],
a[href^="tel:"].bg-primary {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    color: #ffffff !important;
    transition: all 0.3s ease-in-out !important;
}

/* 2. TRẠNG THÁI HOVER: Ép quay lại màu CHÍNH (Primary Color) */
nav a[href^="tel:"]:hover,
.fixed.bottom-10 a[href^="tel:"]:hover,
a[href^="tel:"].bg-primary:hover {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #ffffff !important;
    transform: translateY(-2px) scale(1.02) !important;
}

/* Đảm bảo icon bên trong không bị đổi màu lạc quẻ */
a[href^="tel:"] i {
    color: #ffffff !important;
}

/* ============================================================
   TỐI ƯU ĐỐI TÁC: XÓA KHUNG - ẢNH CỰC ĐẠI - ĐỒNG BỘ DOTS
   ============================================================ */

/* 1. XÓA BỎ KHUNG VIỀN VÀ NỀN MỜ CỦA THẺ BAO NGOÀI (ÉP SẠCH) */
[class*="partner-card"], 
[class*="aspect-video"], 
[class*="aspect-[3/2]"] {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    backdrop-filter: none !important;
}

/* 2. ÉP ẢNH TO - BO TRÒN - BORDER TRỰC TIẾP LÊN ẢNH */
.partner-img-premium {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    /* Ép tỉ lệ 3:2 trực tiếp vào ảnh để tất cả đều tăm tắp */
    aspect-ratio: 3 / 2 !important; 
    object-fit: contain !important;
    
    /* Bo góc và Viền trực tiếp lên ảnh */
    border-radius: 35px !important;
    border: 1.5px solid rgba(0,0,0,0.1) !important;
    background-color: #ffffff !important;
    
    /* Padding cực nhỏ (15px) để logo dãn to nhất có thể */
    padding: 15px !important; 
    
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    will-change: transform;
}

/* Hiệu ứng Hover ảnh */
.group:hover .partner-img-premium {
    transform: translateY(-10px) !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 25px 50px -15px rgba(0, 0, 0, 0.15) !important;
}

/* 3. ĐỒNG BỘ MÀU CHỮ VÀ DOTS SLIDE (THEO CHẾ ĐỘ) */

/* CHẾ ĐỘ NỀN SÁNG (DARK TEXT) */
.partners-mode-dark .title-dynamic { color: #0f172a !important; }
.partners-mode-dark .subtitle-dynamic { color: #64748b !important; }
.partners-mode-dark .swiper-pagination-bullet { background: #000000 !important; opacity: 0.15; }

/* CHẾ ĐỘ NỀN TỐI (LIGHT TEXT) */
.partners-mode-light .title-dynamic { color: #ffffff !important; }
.partners-mode-light .subtitle-dynamic { color: rgba(255, 255, 255, 0.7) !important; }
.partners-mode-light .partner-img-premium { border-color: rgba(255,255,255,0.1) !important; }
.partners-mode-light .swiper-pagination-bullet { background: #ffffff !important; opacity: 0.3; }

/* Dấu chấm đang hoạt động (Luôn theo màu chủ đạo) */
.swiper-pagination-bullet-active {
    background-color: var(--primary-color) !important;
    width: 10px !important; /* Chỉnh lại bằng chiều cao */
    border-radius: 20% !important; /* Bo tròn tuyệt đối */
    opacity: 1 !important;
}

/* Tối ưu cho Mobile */
@media (max-width: 768px) {
    .partner-img-premium {
        border-radius: 20px !important;
        padding: 10px !important;
    }
}

/* ============================================================
   TEAM V2 PREMIUM - CIRCLE & TOP NAME
   ============================================================ */

.team-card-v2 {
    text-align: center;
    transition: all 0.4s ease;
}

/* ẢNH TRÒN TUYỆT ĐỐI */
.team-img-circle {
    width: 200px;
    height: 200px;
    margin: 0 auto 30px;
    border-radius: 50% !important; /* Ép thành hình tròn */
    overflow: hidden;
    border: 6px solid #ffffff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.4s ease;
}

.team-img-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* HOVER ẢNH */
.team-card-v2:hover .team-img-circle {
    border-color: var(--primary-color);
    transform: scale(1.05) rotate(3deg);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

/* NỘI DUNG CHỮ: Tên trên, Chức danh dưới */
.team-content .team-name {
    font-size: 22px;
    font-weight: 900;
    text-transform: uppercase;
    color: #1e293b;
    margin-bottom: 5px;
    italic: italic;
    letter-spacing: -1px;
}

.team-content .team-rank {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--primary-color);
}

/* NÚT XEM HỒ SƠ */
.team-btn-v2 {
    display: inline-block;
    padding: 10px 25px;
    background: #f8fafc;
    color: #64748b;
    border-radius: 30px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.team-card-v2:hover .team-btn-v2 {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);
}

/* SMART MODE CHO TEAM V2 */
.partners-mode-light .team-name { color: #ffffff !important; }
.partners-mode-light .team-rank { color: var(--primary-color) !important; filter: brightness(1.2); }
.partners-mode-light .team-img-circle { border-color: rgba(255,255,255,0.1); }

/* ============================================================
   PORTFOLIO PREMIUM UI
   ============================================================ */
.portfolio-card-premium {
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    transform: translate3d(0,0,0);
}

.portfolio-card-premium:hover {
    box-shadow: 0 40px 80px -15px var(--primary-color);
}

/* Ép ảnh Portrait trên mobile để ko chiếm quá nhiều diện tích */
@media (max-width: 768px) {
    .portfolio-card-premium {
        aspect-ratio: 1 / 1.2;
        border-radius: 40px;
    }
}
