/* ==============================
   🌐 GLOBAL
============================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: #f8f9fa;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ==============================
   🎠 BANNER
============================== */
.carousel {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.carousel-item img {
    height: 650px;
    object-fit: cover;
    transition: transform .5s;
}

.carousel-item:hover img {
    transform: scale(1.05);
}

.carousel-caption {
    background: rgba(0,0,0,0.6);
    padding: 25px;
    border-radius: 10px;
    max-width: 700px;
    margin: 0 auto;
}

    .carousel-caption h5 {
        font-size: 2.2rem;
        font-weight: 700;
        color: #fff;
    }

    .carousel-caption p {
        font-size: 1.1rem;
        color: #ddd;
    }

    .carousel-caption .btn-primary {
        background: #007bff;
        border: none;
        padding: 12px 24px;
    }

        .carousel-caption .btn-primary:hover {
            background: #0056b3;
        }

/* ==============================
   🏷️ SECTION HEADING
============================== */
h2 {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: #222;
    margin: 50px 0 30px;
    position: relative;
}

    h2::after {
        content: '';
        width: 60px;
        height: 3px;
        background: #007bff;
        position: absolute;
        bottom: -10px;
        left: 50%;
        transform: translateX(-50%);
    }

/* ==============================
   🌟 SCROLL WRAPPER (Common)
============================== */
.scroll-wrapper {
    position: relative;
}

.horizontal-scroll {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 30px;
    padding-bottom: 20px;
    scrollbar-width: none;
}

    .horizontal-scroll::-webkit-scrollbar {
        display: none;
    }

.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 50%;
    background: #a17f2d;
    color: #fff;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: background .3s ease;
}

    .scroll-btn:hover {
        background: #c49c3a;
    }

    .scroll-btn.left {
        left: 60px;
    }

    .scroll-btn.right {
        right: 60px;
    }

/* ==============================
   🏢 FEATURED COMPANIES
============================== */
.company-page, .job-page {
    flex: 0 0 100%;
    scroll-snap-align: start;
    display: flex;
    justify-content: center;
}

.company-grid, .job-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, auto);
    gap: 25px;
    width: 100%;
    max-width: 1050px;
}

.company-card, .job-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    border: 1.5px solid #eee;
    padding: 20px;
    text-align: center;
    transition: .25s;
}

    .company-card:hover, .job-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 6px 18px rgba(0,123,255,0.15);
        border-color: #007bff;
    }

.logo-box img, .job-logo img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 10px;
}

.company-name, .job-title {
    font-size: 1rem;
    font-weight: 700;
    color: #007bff;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.company-field, .job-company {
    font-size: .9rem;
    color: #333;
}

.job-count, .job-location, .job-salary {
    font-size: .85rem;
    color: #555;
}

.follow-btn {
    display: inline-block;
    margin-top: 6px;
    padding: 6px 16px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: #f8f9fa;
    color: #007bff;
    font-size: .85rem;
    transition: .25s;
}

    .follow-btn:hover {
        background: #007bff;
        color: #fff;
    }

/* ==============================
   💼 JOB CARD WITH LOGO
============================== */
.job-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.job-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

    .job-body i {
        color: #007bff;
        margin-right: 6px;
    }

/* ==============================
   🎉 EVENTS / STATS
============================== */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: .3s;
}

    .card:hover {
        transform: translateY(-5px);
    }

.event-banner img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.card-body p i {
    color: #007bff;
    margin-right: 6px;
}

.stats-section .col-md-4 {
    flex: 1;
    min-width: 250px;
    max-width: 300px;
    padding: 30px;
    color: #fff;
    border-radius: 15px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    text-align: center;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    transition: .3s;
}

    .stats-section .col-md-4:hover {
        transform: translateY(-8px);
        box-shadow: 0 8px 25px rgba(0,0,0,0.25);
    }

.stats-section h3 {
    font-size: 2.3rem;
    font-weight: 700;
}

.stats-section p {
    font-size: 1.1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ==============================
   📱 RESPONSIVE
============================== */
@media (max-width: 992px) {
    .carousel-item img {
        height: 500px;
    }

    .company-grid, .job-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .carousel-item img {
        height: 400px;
    }

    .carousel-caption h5 {
        font-size: 1.5rem;
    }

    .desktop-page {
        display: none;
    }

    .mobile-page {
        display: flex;
    }

    .mobile-grid {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: repeat(5, auto);
        gap: 15px;
        max-width: 400px;
    }

    .company-card, .job-card {
        flex-direction: row;
        align-items: center;
        text-align: left;
        gap: 10px;
        padding: 10px 12px;
    }

    .logo-box img, .job-logo img {
        width: 60px;
        height: 60px;
    }

    .job-body, .company-info {
        flex: 1;
        gap: 4px;
    }

    .scroll-btn {
        width: 35px;
        height: 35px;
        font-size: .8rem;
    }

        .scroll-btn.left {
            left: 0;
        }

        .scroll-btn.right {
            right: 0;
        }
}

@media (max-width: 576px) {
    .carousel-item img {
        height: 280px;
    }

    .carousel-caption {
        padding: 10px;
        font-size: .9rem;
    }
}

/* === FIX: Căn đều khi số doanh nghiệp ít hơn 9 === */
.company-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    grid-auto-rows: 1fr;
    justify-content: center;
    align-items: stretch;
}

/* Card giữ kích thước ổn định */
.company-card {
    min-height: 260px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Khi chỉ còn 1 hàng (dưới 3 card) thì vẫn căn giữa */
.company-page {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* Responsive */
@media (max-width: 992px) {
    .company-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }
}

@media (max-width: 768px) {
    .company-card {
        min-height: 180px;
    }
}

/* === FIX CHIỀU CAO CARD KHÔNG ĐỔI KHI CHUYỂN SLIDE === */

/* Áp dụng cho tất cả card: doanh nghiệp & việc làm */
.company-card, .job-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    min-height: 340px; /* chiều cao tối thiểu chuẩn */
    max-height: 340px; /* ép đồng nhất giữa các slide */
    overflow: hidden;
}

/* Đảm bảo lưới luôn cùng chiều cao */
.company-grid, .job-grid {
    align-items: stretch;
}

/* Phần hình logo / ảnh công ty */
.logo-box img, .job-logo img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 8px;
}

/* Tên công ty & tiêu đề công việc */
.company-name, .job-title {
    font-size: 1rem;
    font-weight: 700;
    color: #007bff;
    text-transform: uppercase;
    text-align: center;
    height: 40px; /* giữ khoảng đều, tránh nhảy */
    overflow: hidden;
}

/* Phần mô tả / nội dung chính trong thẻ */
.company-info, .job-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Responsive cho mobile */
@media (max-width: 768px) {
    .company-card, .job-card {
        min-height: unset;
        max-height: unset;
        height: auto;
    }


    .logo-box img, .job-logo img {
        width: 60px;
        height: 60px;
    }
}
@media (max-width: 768px) {
    .company-card, .job-card {
        min-height: unset !important;
        max-height: unset !important;
        height: auto !important;
        overflow: visible !important;
    }

    .company-grid.mobile-grid,
    .job-grid.mobile-grid {
        align-items: stretch;
    }
}

/* === SỰ KIỆN NỔI BẬT (2 HÀNG × 4 CỘT) === */
.featured-events {
    margin-top: 60px;
}

.event-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 25px;
    width: 100%;
    max-width: 1200px;
    justify-content: center;
    align-items: stretch;
}

/* Card sự kiện */
.event-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    border: 1px solid #eee;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: .3s;
}

    .event-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 6px 18px rgba(0,123,255,0.15);
        border-color: #007bff;
    }

/* Ảnh banner */
.event-banner img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

/* Thông tin sự kiện */
.event-body {
    padding: 15px;
}

    .event-body h5 {
        font-size: 1rem;
        font-weight: 700;
        color: #007bff;
        margin-bottom: 6px;
    }

    .event-body p {
        font-size: 0.9rem;
        color: #555;
        margin-bottom: 4px;
    }

    .event-body i {
        color: #007bff;
        margin-right: 5px;
    }

    /* Nút */
    .event-body .btn {
        margin-top: 5px;
        width: 100%;
    }

/* Scroll wrapper & buttons dùng chung style với doanh nghiệp */
.scroll-wrapper {
    position: relative;
}

.horizontal-scroll {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 30px;
    padding-bottom: 20px;
    scrollbar-width: none;
}

    .horizontal-scroll::-webkit-scrollbar {
        display: none;
    }

.event-page {
    flex: 0 0 100%;
    scroll-snap-align: start;
    display: flex;
    justify-content: center;
}

/* Nút điều hướng */
.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 50%;
    background: #49505729;
    color: #fff;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: background .3s;
}

    .scroll-btn:hover {
        background: #007bff69;
    }

    .scroll-btn.left {
        left: 60px;
    }

    .scroll-btn.right {
        right: 60px;
    }

/* Mobile chỉ hiển thị 4 sự kiện */
@media (max-width: 768px) {
    .desktop-page {
        display: none;
    }

    .mobile-page {
        display: flex;
    }

    .event-grid.mobile-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
        max-width: 450px;
    }

    .event-card {
        min-height: 240px;
    }

    .event-banner img {
        height: 120px;
    }
}

/* === Mobile layout giống sự kiện: 2x2 card === */
@media (max-width: 768px) {
    /* Ẩn desktop slide */
    .desktop-page {
        display: none;
    }

    .mobile-page {
        display: flex;
    }

    /* Lưới 2 cột x 2 hàng */
    .company-grid.mobile-grid,
    .job-grid.mobile-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: repeat(2, auto);
        gap: 15px;
        max-width: 450px;
        justify-content: center;
        align-items: stretch;
    }

    /* Card nhỏ gọn hơn */
    .company-card,
    .job-card {
        min-height: 240px;
        padding: 12px;
        border-radius: 10px;
    }

    .logo-box img,
    .job-logo img {
        width: 60px;
        height: 60px;
        margin-bottom: 8px;
    }

    .company-name,
    .job-title {
        font-size: 0.9rem;
        font-weight: 700;
        text-transform: uppercase;
        color: #007bff;
        text-align: center;
        white-space: normal;
    }

    .company-field,
    .job-company,
    .job-location,
    .job-salary {
        font-size: 0.8rem;
        text-align: center;
        color: #555;
    }

    .follow-btn,
    .job-btn {
        display: inline-block;
        width: 100%;
        padding: 6px 0;
        font-size: 0.85rem;
        border-radius: 6px;
        text-align: center;
        margin-top: 6px;
    }

    /* Giữ nút điều hướng gọn */
    .scroll-btn {
        width: 35px;
        height: 35px;
        font-size: 0.8rem;
    }

        .scroll-btn.left {
            left: 0;
        }

        .scroll-btn.right {
            right: 0;
        }
}

.scroll-btn.left.event {
    left: 0px;
}

.scroll-btn.right.event {
    right: 0px;
}