/* =========================================
   1. HERO SECTION & SEARCH
   ========================================= */
.res-hero-section {
    padding: 50px 0 60px;
    background: #fff;
    text-align: center;
}

.res-hero-content {
    max-width: 1000px;
    margin: 0 auto;
}

.res-title {
    font-size: 36px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 16px;
}

.res-subtitle {
    font-size: 27px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 40px;
}

/* Search Bar */
.res-search-box {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 4px 4px 4px 15px;
    max-width: 600px;
    margin: 0 auto 30px auto;
    transition: all 0.3s;
}

.res-search-box:focus-within {
    border-color: #1a1a1a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.search-icon {
    color: #999;
    display: flex;
    align-items: center;
    margin-right: 10px;
}
.search-icon svg { width: 20px; height: 20px; }

.search-input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    outline: none;
    padding: 10px 0;
    font-size: 15px;
    color: #333;
}

.btn-search {
    background: #2d3138;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 24px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    flex-shrink: 0;
}
.btn-search:hover { background: #000; }

/* Filter Tags */
.res-tags {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-btn {
    background: #f3f4f6;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    cursor: pointer;
    transition: all 0.2s;
}

.tag-btn:hover,
.tag-btn.active {
    background: #faff00;
    color: #000;
}

/* =========================================
   2. FEATURED RESOURCES GRID
   ========================================= */
.res-featured-section {
    padding: 5px 60px 100px;
    background: #fff;
}

.section-heading {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 40px;
}

.res-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 50px;
    margin-bottom: 40px;
}

/* RESOURCE CARD */
.res-card {
    background: #f5f5f5;
    border: none;
    border-radius: 24px;
    padding: 24px 30px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}
.res-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.06);
}

.res-img-box {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: #fff;
    border-radius: 16px;
    width: 100%;
}
.res-img-box img { width: 100%; height: 100%; object-fit: cover; }

.res-tag {
    position: absolute; top: 15px; left: 15px;
    background: #faff00; color: #000;
    font-size: 11px; font-weight: 700;
    padding: 5px 12px; border-radius: 20px;
}
.res-type {
    position: absolute; top: 15px; right: 15px;
    background: #fff; color: #1a1a1a;
    font-size: 11px; font-weight: 600;
    padding: 5px 12px; border-radius: 20px;
}

/* Card Body */
.res-body { display: flex; flex-direction: column; flex: 1; }

.res-card-title {
    font-size: 18px; font-weight: 600; margin-bottom: 5px; color: #1a1a1a;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; text-overflow: ellipsis;
}

.res-card-desc {
    font-size: 11px; color: #666; line-height: 1.6; flex: 1;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; text-overflow: ellipsis; margin-block-end: 15px !important;
}

/* Card Footer */
.res-footer {
    display: flex; align-items: center; justify-content: space-between;
    border-top: 1px solid #e0e0e0; padding-top: 15px; margin-top: auto;
}

.file-info { font-size: 11px; color: #777; font-weight: 600; text-transform: uppercase; }

.btn-download {
    display: flex; align-items: center;
    background: #2d3138; color: #fff;
    font-size: 12px; font-weight: 600;
    padding: 8px 16px 8px 8px; border-radius: 6px;
    text-decoration: none; transition: background 0.3s;
}
.btn-download:hover { background: #000; }

.icon-box-dark-sm {
    background: #fff; color: #2d3138;
    width: 20px; height: 20px; border-radius: 4px;
    display: flex; align-items: center; justify-content: center; margin-right: 8px;
}
.icon-box-dark-sm svg { width: 12px; height: 12px; }

/* Button View News */
.res-view-news-wrap { text-align: left; }
.btn-view-news {
    display: inline-flex; align-items: center;
    background: #2d3138; color: #fff;
    padding: 10px 20px 10px 10px; border-radius: 8px; text-decoration: none;
}
.icon-box-square-white {
    background: #fff; color: #2d3138;
    width: 28px; height: 28px; border-radius: 4px;
    display: flex; align-items: center; justify-content: center; margin-right: 10px;
}
.icon-box-square-white svg { width: 14px; height: 14px; }


/* =========================================
   3. WEBINARS & NEWS
   ========================================= */
.res-webinar-section {
    background: linear-gradient(90deg, #171F31 0%, #3D4453 50%, #696E7A 100%);
    padding: 20px 0; color: #fff;
}
.res-webinar-section .section-title-center {
    text-align: center; width: 100%; margin-bottom: 50px;
    font-size: 32px; font-weight: 700;
}

.webinar-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 30px; margin-bottom: 50px; max-width: 1200px; margin: 0 auto 50px auto;
}

.webinar-card {
    background: #fff; border-radius: 20px; padding: 20px 30px;
    color: #1a1a1a; display: flex; flex-direction: column;
}

.webinar-tag {
    background: #faff00; color: #000; font-size: 10px;
    padding: 4px 10px; border-radius: 12px; width: fit-content; margin-bottom: 15px;
}
.webinar-card:nth-child(2) .webinar-tag,
.webinar-card:nth-child(3) .webinar-tag { background: #ffeb3b; }

.webinar-title {
    font-size: 18px; font-weight: 700; margin-bottom: 15px;
    line-height: 1.4; flex: 1;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; text-overflow: ellipsis;
}

.webinar-meta { margin-bottom: 25px; }
.webinar-meta p {
    font-size: 12px; color: #666; margin: 0 0 5px 0; margin-block-end: 5px !important;
}

.btn-webinar {
    display: block; width: 100%; text-align: center; padding: 12px 0;
    background: #2d3138; color: #fff; border-radius: 8px;
    font-size: 13px; font-weight: 600; text-decoration: none; transition: background 0.2s;
}
.btn-webinar:hover { background: #000; }
.btn-webinar.dark { background: #4a505e; }
.btn-webinar.dark:hover { background: #2d3138; }

.webinar-read-more-wrap { text-align: center; }
.btn-read-more-white {
    background: #fff; color: #1a1a1a; padding: 17px 40px;
    border-radius: 10px; font-weight: 500; text-decoration: none; display: inline-block;
}

/* =========================================
   4. FAQ SECTION
   ========================================= */
.res-faq-section { padding: 20px 0 80px 0; background: #fff; }
.res-faq-section .section-title-center {
    text-align: center; font-size: 35px; font-weight: 700;
    color: #1a1a1a; margin-bottom: 50px;
}

.faq-list {
    max-width: 1200px; margin: 0 auto;
    display: flex; flex-direction: column; gap: 30px;
}

.faq-item {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 16px;
    padding: 40px; display: grid; grid-template-columns: 30% 1fr auto;
    align-items: center; gap: 40px; transition: all 0.3s;
}
.faq-item:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08); border-color: #1a1a1a;
}

.faq-question {
    font-size: 16px; color: #1a1a1a; flex-shrink: 0; margin: 0;
    line-height: 1.4; margin-block-end: 0 !important; text-transform: uppercase;
}

.faq-answer {
    font-size: 16px; color: #1a1a1a; margin: 0; line-height: 1.4;
    margin-block-end: 0 !important;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; text-overflow: ellipsis;
}

.faq-icon {
    width: 24px; height: 24px; color: #1a1a1a;
    display: flex; align-items: center; justify-content: center;
}
.faq-icon svg { width: 30px; height: 30px; }


/* =========================================
   5. CONTACT FORM SECTION (ĐÃ FIX LỖI)
   ========================================= */
.res-contact-section {
    background: linear-gradient(90deg, #171F31 0%, #3D4453 50%, #696E7A 100%);
    padding: 30px 0 80px 0;
    color: #fff;
    text-align: center;
}

.contact-title {
    text-align: center;
    font-size: 44px; font-weight: 400; color: #fff;
    margin-bottom: 30px;
}

/* --- FORM FIX --- */
.form-wrapper-custom {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px !important; 
}

.form-wrapper-custom p {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
}

/* Ẩn thẻ xuống dòng thừa thãi */
.form-wrapper-custom br {
    display: none !important;
}

/* Dòng 1: Grid (Name - Email) */
.form-row-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    align-items: start;
}

/* Dòng 2: Flex (Question - Button) */
.form-row-flex {
    display: flex;
    gap: 20px;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    align-items: stretch;
}

/* Style Input */
.form-input {
    width: 100%;
    height: 54px;
    background: #fff;
    border: none;
    border-radius: 8px;
    padding: 0 20px;
    font-size: 15px;
    color: #333;
    outline: none;
    box-sizing: border-box;
    /* Xóa margin mặc định của theme để input không đẩy nhau */
    margin-bottom: 0 !important;
    line-height: normal !important; /* Đảm bảo chữ nhập vào hiển thị đúng */
}
.form-input::placeholder { color: #9ca3af; }

/* Reset các thẻ bao của plugin */
.form-item, .form-item-grow, .wpcf7-form-control-wrap {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.form-item-grow { flex-grow: 1; }

/* Nút Submit */
.btn-submit {
    width: 60px; height: 54px;
    background: #2d3138;
    border: none; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0;
    margin: 0 !important;
}
.btn-submit:hover { background: #000; }
.btn-submit svg { width: 24px; height: 24px; color: #faff00; transform: rotate(45deg); }

/* Thông báo gửi thành công/thất bại */
div.wpcf7-response-output {
    border: none !important; background: transparent; color: #27ae60;
    padding: 10px 0; margin: 10px auto 0 auto !important;
    font-size: 16px; font-weight: bold; text-align: center;
    border-bottom: 2px solid #27ae60 !important;
}
div.wpcf7-response-output.wpcf7-validation-errors {
    background-color: transparent; color: #ffeb3b; border-bottom-color: #ffeb3b !important;
}

/* =========================================
   6. RESPONSIVE
   ========================================= */
@media (max-width: 991px) {
    /* Padding chung */
    .res-hero-section, .res-featured-section, .res-webinar-section, 
    .res-faq-section, .res-contact-section {
        padding-left: 20px !important; padding-right: 20px !important;
        padding-top: 40px; padding-bottom: 40px;
    }

    /* Hero */
    .res-title { font-size: 28px; }
    .res-search-wrapper { flex-direction: column; width: 100%; }
    .res-input-container { width: 100%; }
    .btn-search { justify-content: center; margin-top: 0; }

    /* Grid */
    .res-grid, .webinar-grid { grid-template-columns: 1fr; gap: 30px; }

    /* FAQ */
    .faq-item {
        grid-template-columns: 1fr; grid-template-rows: auto auto auto;
        gap: 15px; padding: 25px;
    }
    .faq-question { order: 1; font-weight: 700; font-size: 18px; }
    .faq-answer { order: 2; }
    .faq-icon { justify-self: start; order: 3; color: #1a1a1a; margin-bottom: 5px; }

    /* FORM MOBILE */
    .contact-title { font-size: 26px; }
    .form-wrapper-custom { max-width: 100%; }
    
    /* Chuyển dòng 1 thành dọc */
    .form-row-grid {
        grid-template-columns: 1fr;
        gap: 10px; /* Khoảng cách giữa Name và Email trên mobile */
    }
}

/* =========================================
   7. ANIMATIONS & EFFECTS (CẬP NHẬT CHO JS)
   ========================================= */

/* Định nghĩa chuyển động */
@keyframes fadeInUpCustom {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 1. Trạng thái khởi tạo (Khi chưa lướt tới) */
/* Chỉ áp dụng khi KHÔNG PHẢI trong Elementor Editor */
body:not(.elementor-editor-active) .onyx-animate-init {
    opacity: 0; /* Ẩn đi */
    will-change: transform, opacity; /* Tối ưu hiệu năng */
}

/* 2. Trạng thái kích hoạt (Khi JS thêm class này vào) */
body:not(.elementor-editor-active) .onyx-animate-active {
    animation: fadeInUpCustom 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* 3. Độ trễ (Stagger) cho các thẻ nằm cạnh nhau để nó bay lên lần lượt */
/* Card tài nguyên */
.res-card.onyx-animate-active:nth-child(1) { animation-delay: 0.1s; }
.res-card.onyx-animate-active:nth-child(2) { animation-delay: 0.2s; }
.res-card.onyx-animate-active:nth-child(3) { animation-delay: 0.3s; }

/* Card Webinar */
.webinar-card.onyx-animate-active:nth-child(1) { animation-delay: 0.1s; }
.webinar-card.onyx-animate-active:nth-child(2) { animation-delay: 0.2s; }
.webinar-card.onyx-animate-active:nth-child(3) { animation-delay: 0.3s; }

/* --- CÁC HIỆU ỨNG HOVER & KHÁC GIỮ NGUYÊN --- */
.res-card, .webinar-card, .faq-item {
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), 
                box-shadow 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.res-card:hover .res-img-box img {
    transform: scale(1.08);
    transition: transform 0.6s ease;
}

/* --- BẢO VỆ TRONG ELEMENTOR EDITOR (GIỮ NGUYÊN) --- */
.elementor-editor-active .onyx-animate-init {
    opacity: 1 !important;
    animation: none !important;
    transform: none !important;
}

/* Style chung cho thông báo Contact Form 7 */
.wpcf7 form .wpcf7-response-output {
    border: none !important; /* Bỏ viền xanh mặc định */
    background: transparent !important; /* Bỏ nền */
    padding: 10px 0 !important; /* Căn chỉnh khoảng cách */
    margin: 20px 0 0 0 !important;
    text-align: center; /* Căn giữa chữ */
    font-size: 16px;
    font-weight: 500;
}

/* Style riêng cho thông báo Thành công (Gửi được) */
.wpcf7 form .wpcf7-mail-sent-ok {
    color: #4cd964 !important; /* Màu xanh lá sáng (hoặc đổi thành #fff nếu muốn trắng) */
}

/* Style riêng cho thông báo Lỗi (Gửi thất bại) */
.wpcf7 form .wpcf7-validation-errors,
.wpcf7 form .wpcf7-spam-blocked {
    color: #ff3b30 !important; /* Màu đỏ báo lỗi */
}