/* ==========================================================================
   1. RESET & STYLE TOÀN CỤC (ĐỒNG BỘ FONT CHỮ TOÀN WEBSITE)
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: #f4f6f3; /* Màu nền sáng sữa/kem nhã nhặn dịu mắt */
    color: #1e293b;           /* Màu chữ đen xám sâu, tối ưu trải nghiệm đọc */
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit; /* Cho phép các liên kết tự động lấy màu từ thẻ cha chứa nó */
}

/* ==========================================================================
   2. HEADER & NAVIGATION (BẢN DYNAMIC SCROLL CHUYỂN MÀU THÔNG MINH)
   ========================================================================== */
header {
    padding: 25px 10%; 
    position: fixed; 
    width: 100%;
    top: 0;
    left: 0;
    z-index: 100;
    
    /* TRẠNG THÁI MẶC ĐỊNH: Trong suốt hoàn toàn khi ở trên cùng */
    background: transparent;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    border-bottom: 1px solid transparent;
    
    /* Tạo hiệu ứng chuyển đổi màu sắc mượt mà trong 0.4 giây khi cuộn chuột */
    transition: background 0.4s ease, backdrop-filter 0.4s ease, border-color 0.4s ease, padding 0.4s ease;
}

/* TRẠNG THÁI KHI CUỘN XUỐNG: JavaScript tự động kích hoạt */
header.scrolled {
    background: rgba(30, 41, 59, 0.95); /* Màu xanh đen sâu đồng bộ với footer */
    backdrop-filter: blur(12px);         /* Hiệu ứng mờ kính cao cấp */
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(2, 132, 199, 0.15) !important;
    padding: 12px 10%; /* Co mỏng nền lại gọn gàng khi lướt chuột */
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 32px;
    font-weight: bold;
    transition: font-size 0.4s ease;
}

/* Sửa lỗi hiển thị: Tạo cấu trúc Flexbox gom cụm icon và text cân bằng */
.logo a {
    display: flex;
    align-items: center;
    gap: 12px; 
    color: #ffffff !important; /* Mặc định chữ "Thanh Quy" màu trắng cực sang */
    transition: opacity 0.3s ease;
}

/* Cấu hình kích thước ảnh Logo thương hiệu */
.logo-icon {
    height: 36px;
    width: auto;
    object-fit: contain;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Hiệu ứng xoay nhích nhẹ công nghệ khi di chuột vào khối logo */
.logo a:hover .logo-icon {
    transform: rotate(6deg) scale(1.08);
}

/* Đóng chuẩn màu thương hiệu: Chữ Digital màu xanh dương ngọc */
.logo a span {
    color: #0ea5e9 !important; 
    font-weight: 600;
    transition: color 0.3s ease;
}

.logo a:hover span {
    color: #38bdf8 !important; /* Sáng rực lên nhẹ khi hover */
}

/* KHI CUỘN XUỐNG: Tự động thu nhỏ tinh tế kích thước logo */
header.scrolled .logo {
    font-size: 26px;
}
header.scrolled .logo-icon {
    height: 30px;
}

/* Định dạng lại màu chữ của các nút Menu trên thanh Header */
.nav-links-wrapper {
    display: flex;
    align-items: center;
}

.nav-links-wrapper a {
    color: #94a3b8; /* Màu xám sáng thanh lịch (giống màu chữ ở Footer) */
    text-decoration: none;
    margin-left: 25px;
    font-weight: 600;
    transition: color 0.3s ease, font-size 0.4s ease;
}

.nav-links-wrapper a:hover {
    color: #ffffff; /* Khi di chuột vào nút menu thì sáng rực lên màu trắng */
}

/* Trạng thái nút Menu đang được chọn (Active) */
.nav-active {
    color: #0ea5e9 !important;
    font-weight: 700 !important;
}

/* ==========================================================================
   3. HERO SECTION (CÂN BẰNG TỶ LỆ TRANG CHỦ)
   ========================================================================== */
.hero {
    min-height: 95vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 100px 10% 60px 10%;
    gap: 60px;
}

.hero-text {
    width: 55%;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-welcome {
    font-size: 20px;
    color: #475569;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.hero-name {
    font-size: 48px;
    color: #0284c7;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 15px;
}

.hero h2 {
    margin: 0 0 25px 0;
    color: #334155;
    font-size: 22px;
    font-weight: 600;
}

.hero-desc {
    color: #475569;
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 35px;
    max-width: 95%;
}

.avatar {
    width: 40%;
    display: flex;
    justify-content: flex-end;
}

.avatar img {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 24px;
    object-fit: cover;
    border: 1px solid rgba(2, 132, 199, 0.15);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.06);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.5s ease, box-shadow 0.5s ease;
}

.avatar img:hover {
    transform: translateY(-10px);
    border-color: #0ea5e9;
    box-shadow: 0 20px 40px rgba(2, 132, 199, 0.15);
}

.hero-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.btn-primary {
    display: inline-block;
    min-width: 160px;
    padding: 14px 28px;
    background: #0284c7;
    color: #ffffff !important;
    text-decoration: none;
    font-weight: bold;
    font-size: 15px;
    text-align: center;
    border-radius: 12px;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.2);
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.btn-primary:hover {
    background: #0ea5e9;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.3);
}

/* ==========================================================================
   4. SECTION CORE STYLES & ABOUT (KHỐI GIỚI THIỆU VỀ TÔI)
   ========================================================================== */
section {
    padding: 100px 10% 60px 10%;
    scroll-margin-top: 80px;
}

section h1, section h2 {
    font-size: 32px;
    margin-bottom: 30px;
    color: #0f172a;
    font-weight: 700;
}

.about-container {
    max-width: 850px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.about-text {
    font-size: 16px;
    color: #475569;
    line-height: 1.8;
    text-align: left;
}

.about-text strong {
    color: #0284c7;
}

/* ==========================================================================
   5. KHỐI TÍCH HỢP TƯƠNG TÁC TAB NĂNG LỰC & ICON CÔNG CỤ
   ========================================================================== */
#skill {
    background: linear-gradient(180deg, #f4f6f3 0%, #e9ece6 100%);
}

.marketing-container {
    display: flex;
    gap: 40px;
    width: 100%;
    margin-top: 20px;
}

.marketing-tabs {
    width: 30%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tab-btn {
    width: 100%;
    padding: 18px 24px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    text-align: left;
    font-size: 15px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-btn i {
    font-size: 16px;
}

.tab-btn:hover {
    border-color: #0ea5e9;
    color: #0ea5e9;
    transform: translateX(4px);
}

.tab-btn.active {
    background: #0ea5e9;
    color: #ffffff !important;
    border-color: #0ea5e9;
    box-shadow: 0 8px 16px rgba(14, 165, 233, 0.2);
}

.marketing-content-wrapper {
    width: 70%;
    background: #ffffff;
    padding: 40px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.02);
    min-height: 320px;
}

.tab-content {
    display: none;
    width: 100%;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease-in-out;
}

.tab-content h3 {
    font-size: 22px;
    color: #0f172a;
    margin-bottom: 12px;
    font-weight: 700;
}

.tab-desc {
    color: #64748b;
    font-size: 15px;
    margin-bottom: 30px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.tool-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
}

.tool-icon {
    font-size: 22px;
    margin-top: 2px;
}

.tool-item h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.tool-item p {
    font-size: 13.5px;
    color: #64748b;
    line-height: 1.4;
}

.text-blue { color: #0ea5e9; }
.text-orange { color: #f97316; }
.text-green { color: #22c55e; }
.text-red { color: #ef4444; }
.text-purple { color: #a855f7; }

/* ==========================================================================
   6. DỰ ÁN TIÊU BIỂU (LAYOUT LƯỚI CARD ĐỒNG BỘ TRANG CHỦ)
   ========================================================================== */
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    width: 100%;
}

.card {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.01);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-8px);
    border-color: #0ea5e9;
    box-shadow: 0 15px 30px rgba(14, 165, 233, 0.1);
}

.project-card {
    padding: 35px 30px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 320px;
}

.project-tag {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #0ea5e9;
    background: rgba(14, 165, 233, 0.08);
    padding: 6px 14px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 700;
}

.project-card h3 {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 12px;
}

.project-desc {
    color: #475569;
    font-size: 14.5px;
    line-height: 1.6;
}

/* ==========================================================================
   7. LAYOUT LƯỚI CARD ĐỨNG (TỐI ƯU ĐỀU NHAU TĂM TẮP CHO BLOG.HTML)
   ========================================================================== */
.blog-page-container {
    padding: 120px 10% 60px 10%;
    min-height: 80vh;
}

.blog-page-header {
    text-align: center;
    margin-bottom: 50px;
}

.blog-subtitle {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #0ea5e9;
    font-weight: 700;
    display: block;
    margin-bottom: 10px;
}

.blog-page-header h2 {
    font-size: 36px;
    color: #0f172a;
    font-weight: 700;
}

.blog-page-header p {
    color: #475569;
    font-size: 16px;
    max-width: 600px;
    margin: 15px auto 0 auto;
}

/* Khống chế lưới hiển thị: Dàn stretch đồng bộ chiều cao hàng */
.blog-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    width: 100%;
    align-items: stretch;
}

/* Khống chế card dọc cố định độ rộng tối đa */
.blog-vertical-card {
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.3s ease, box-shadow 0.3s ease;
}

.blog-vertical-card:hover {
    transform: translateY(-8px);
    border-color: #0ea5e9;
    box-shadow: 0 15px 30px rgba(14, 165, 233, 0.1);
}

/* Khung chứa ảnh tỉ lệ 16:9 ổn định */
.blog-card-thumbnail {
    width: 100%;
    height: 210px;
    position: relative;
    overflow: hidden;
    background: #f8fafc;
}

.blog-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-vertical-card:hover .blog-card-thumbnail img {
    transform: scale(1.04);
}

/* Khu vực content bọc trong hộp Flexbox để đẩy nút Đọc bài xuống đáy */
.blog-card-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog-card-meta {
    margin-bottom: 10px;
}

.blog-date {
    font-size: 12.5px;
    color: #64748b;
    font-weight: 600;
}

/* Đồng bộ diện tích hiển thị của Tiêu đề */
.blog-vertical-card h3 {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 12px;
    min-height: 3.6rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-vertical-card h3 a {
    color: #0f172a;
    transition: color 0.3s;
}

.blog-vertical-card:hover h3 a {
    color: #0ea5e9;
}

/* Đồng bộ diện tích hiển thị của Mô tả ngắn */
.blog-card-desc {
    color: #475569;
    font-size: 14.5px;
    line-height: 1.6;
    margin-bottom: 20px;
    min-height: 4.56rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.blog-read-more {
    color: #0ea5e9;
    font-weight: 700;
    font-size: 14px;
    margin-top: auto;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    transition: transform 0.2s ease;
}

.blog-read-more:hover {
    transform: translateX(4px);
}

/* Giao diện nút Quay lại Blog mới */
.back-to-blog {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #2c3e50;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    padding: 6px 0;
    transition: color 0.25s ease;
}

.back-to-blog svg {
    transition: transform 0.25s ease;
}

.back-to-blog:hover {
    color: #0084ff;
}

.back-to-blog:hover svg {
    transform: translateX(-4px); 
}

/* ==========================================================================
   8. FOOTER MODERN UPGRADE (BẢN TỐI ƯU CHIA CỘT SANG TRỌNG)
   ========================================================================== */
footer {
    background-color: #1e293b; 
    color: #94a3b8;           
    padding: 60px 10% 0 10%;
    border-top: 1px solid rgba(2, 132, 199, 0.1);
}

.footer-container {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr; 
    gap: 50px;
    width: 100%;
    padding-bottom: 40px; 
}

.footer-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: left;
}

.footer-logo a {
    display: flex;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
    color: #ffffff !important;
}

.footer-logo span {
    color: #0ea5e9 !important;
    font-weight: 600;
    margin-left: 6px;
}

.footer-about {
    font-size: 14px;
    line-height: 1.6;
    color: #94a3b8;
    max-width: 85%;
}

.footer-column h4 {
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.footer-links, .footer-contact {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 14px;
}

.footer-links a, .footer-contact a {
    color: #94a3b8;
    transition: color 0.3s ease, transform 0.2s ease;
    display: inline-block;
}

.footer-links a:hover {
    color: #0ea5e9;
    transform: translateX(4px); 
}

.footer-contact a:hover {
    color: #0ea5e9;
}

.footer-socials {
    display: flex;
    gap: 12px;
    margin-top: 5px;
}

.footer-socials a {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.04);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.3s ease;
}

.footer-socials a:hover {
    background: #0ea5e9;
    border-color: #0ea5e9;
    transform: translateY(-3px);
}

/* ĐÃ CHỈNH SỬA: Dòng bản quyền suốt đồng bộ tuyệt đối màu chữ trắng sáng */

/* ==========================================================================
   BẢN CHỈNH SỬA: TẠO NỀN BIỆT LẬP KÉO DÀI FULL 2 BÊN CHO COPYRIGHT
   ========================================================================== */
/* ==========================================================================
   BẢN CHỈNH SỬA: ÉP TRÀN VIỀN TUYỆT ĐỐI 100% THEO CHIỀU RỘNG MÀN HÌNH
   ========================================================================== */
.footer-bottom {
    background-color: #0f172a !important; 
    background: #0f172a !important;
    border-top: 1px solid rgba(255, 255, 255, 0.04) !important; 
    
    /* TUYỆT CHIÊU ÉP TRÀN VIỀN BẤT CHẤP THẺ CHA */
    width: 100vw !important;      /* Ép chiều rộng bằng đúng 100% màn hình */
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw !important; /* Đẩy ngược tâm về lề trái màn hình */
    margin-right: -50vw !important;/* Đẩy ngược tâm về lề phải màn hình */

    /* CÂN ĐỐI LẠI KHOẢNG CÁCH */
    padding: 22px 0 25px 0; 
    margin-top: 40px;       
    text-align: center;
    font-size: 13.5px;
}

/* Các thuộc tính chữ bên dưới giữ nguyên vẹn */
.footer-bottom p {
    color: #64748b !important; 
}

.footer-bottom .footer-brand {
    color: #ffffff !important;
    font-weight: 700;
}

.footer-bottom .footer-brand span {
    color: #0ea5e9 !important;
    font-weight: 600;
    margin-left: 2px;
}

/* ==========================================================================
   9. RESPONSIVE MEDIA QUERIES (BẢN TỐI ƯU DI ĐỘNG CAO CẤP)
   ========================================================================== */
@media (max-width: 1024px) {
    header { padding: 20px 5%; }
    header.scrolled { padding: 12px 5%; }
    section { padding: 80px 5% 40px 5%; }
    .hero { padding: 100px 5% 40px 5%; gap: 40px; }
    .marketing-container { gap: 25px; }
    .blog-page-container { padding: 100px 5% 40px 5%; }
}

@media (max-width: 768px) {
    header { background: rgba(30, 41, 59, 0.98); border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
    
    .nav-links-wrapper {
        position: fixed;
        top: 70px; 
        left: 0;
        width: 100%;
        background: #1e293b;
        flex-direction: column;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 10px 20px rgba(0,0,0,0.15);
    }

    .nav-links-wrapper.mobile-active {
        max-height: 320px; 
    }

    .nav-links-wrapper a {
        margin-left: 0 !important;
        font-size: 16px !important;
        color: #cbd5e1 !important;
        width: 100%;
        text-align: left;
        padding: 16px 25px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    }

    .menu-toggle {
        display: block !important;
        font-size: 22px;
        color: #ffffff !important;
    }

    .hero {
        flex-direction: column-reverse; 
        text-align: center;
        padding: 100px 5% 40px 5%;
        gap: 30px;
    }

    .hero-text { width: 100%; align-items: center; }
    .hero-name { font-size: 32px; }
    .hero h2 { font-size: 18px; }
    .hero-desc { font-size: 14.5px; max-width: 100%; margin-bottom: 30px; }
    .hero-buttons { width: 100%; justify-content: center; }
    .btn-primary { width: 100%; max-width: 280px; border-radius: 10px; }

    .avatar { width: 100%; justify-content: center; }
    .avatar img { max-width: 260px; border-radius: 18px; }

    section h1, section h2, .blog-page-header h2 { font-size: 26px !important; }

    .marketing-container { flex-direction: column; gap: 20px; padding: 15px; }
    .marketing-tabs { width: 100%; gap: 8px; }
    .tab-btn { padding: 14px 18px; font-size: 14px; border-radius: 10px; }
    .marketing-content-wrapper { width: 100%; padding: 20px; min-height: auto; }
    .tab-content h3 { font-size: 18px; }
    .tools-grid { grid-template-columns: 1fr; } 

    .cards-container, .blog-grid-container { grid-template-columns: 1fr !important; gap: 20px; }
    .footer-container { grid-template-columns: 1fr !important; gap: 30px; }
}

/* ==========================================================================
   10. PREMIUM REVEAL EFFECT (HIỆU ỨNG TRƯỢT MỞ CHUẨN ĐỒNG BỘ)
   ========================================================================== */
.card, .blog-vertical-card {
    position: relative;
}

.card::before, .blog-vertical-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.25) 50%, rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg);
    transition: 0.75s;
    z-index: 1;
    pointer-events: none;
}

.card:hover::before, .blog-vertical-card:hover::before {
    left: 150%;
}

.reveal {
    opacity: 0;
    filter: blur(8px); 
    transition: opacity 0.6s ease-out, filter 0.6s ease-out;
    will-change: opacity, filter;
}

.reveal.active {
    opacity: 1;
    filter: blur(0);
}