/* =========================================================
   1. CẤU HÌNH CHUNG & LAYOUT CƠ BẢN
   ========================================================= */
html, body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    overflow-x: hidden;
    /* Hiệu ứng chuyển màu mượt mà khi bấm nút đổi giao diện */
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* =========================================================
   2. BANNER & CAROUSEL (SLIDER ĐẦU TRANG)
   ========================================================= */
#hrMainCarousel, .carousel-inner, .carousel-item {
    width: 100vw !important;
    max-width: 100% !important;
}

.banner-img {
    width: 100%;
    height: 600px;
    object-fit: cover;
    filter: brightness(0.7); /* Làm tối ảnh để nổi chữ trắng */
    background-color: #1b263b;
}

.banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
}

.brand-yellow {
    color: #ffeb3b;
}

/* Ô thống kê trên banner */
.stat-box {
    width: 220px;
    margin: 10px;
    padding: 20px;
    color: white;
    backdrop-filter: blur(5px);
    border-left: 5px solid rgba(255,255,255,0.5);
}

.bg-cyan {
    background: rgba(0, 188, 212, 0.7);
}

.bg-green {
    background: rgba(76, 175, 80, 0.7);
}

.stat-num {
    font-size: 2rem;
    font-weight: bold;
    display: block;
}

.stat-text {
    font-size: 0.9rem;
    text-transform: uppercase;
}

/* Nút điều hướng Slide */
.custom-nav-btn {
    background-color: rgba(220, 53, 69, 0.85);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

    .custom-nav-btn:hover {
        background-color: #ff0000;
        transform: scale(1.1);
    }

/* =========================================================
   3. SUB-MENU (THANH NỔI GIỮA TRANG)
   ========================================================= */
.sub-menu-card {
    background-color: #ffffff;
    border-radius: 16px;
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
    position: relative;
    z-index: 20;
}

/* Trạng thái bình thường */
.menu-item {
    text-decoration: none;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 10px;
    border-radius: 12px;
    color: #555;
    background-color: transparent;
    transition: all 0.3s ease;
    margin: 0 5px;
    cursor: pointer; /* Thêm con trỏ tay để biết là nút bấm */
}

.icon-size {
    font-size: 1.5rem;
    margin-bottom: 5px;
    transition: color 0.3s ease;
}

.menu-text {
    font-weight: 600;
    font-size: 0.95rem;
}

/* Hiệu ứng Hover khi chưa chọn */
.menu-item:not(.active):hover {
    background-color: #f1f3f5;
    color: #0d6efd;
    transform: translateY(-2px);
}

/* --- TRẠNG THÁI ACTIVE (ĐANG CHỌN) --- */
.menu-item.active {
    background-color: #0d6efd;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(13, 110, 253, 0.3);
}

    .menu-item.active .icon-size {
        color: #ffffff !important;
    }

/* =========================================================
   4. DASHBOARD (GIAO DIỆN SÁNG MẶC ĐỊNH)
   ========================================================= */
.dashboard-wrapper {
    background-color: #eff6ff; /* Nền xanh nhạt */
    min-height: 100vh;
    transition: background-color 0.3s ease;
}

.bg-purple-subtle {
    background-color: #f3e8ff;
}

.text-purple {
    color: #9333ea;
}

.text-warning-dark {
    color: #b45309;
}

.icon-square {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Card Job & News */
.news-img-placeholder {
    height: 140px;
    width: 100%;
}

.job-card, .news-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

    .job-card:hover, .news-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 20px rgba(0,0,0,0.08) !important;
    }

/* Gradients */
.bg-gradient-1 {
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
}

.bg-gradient-2 {
    background: linear-gradient(135deg, #96fbc4 0%, #f9f586 100%);
}

.bg-gradient-3 {
    background: linear-gradient(315deg, #e6b980 0%, #eacda3 74%);
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =========================================================
   5. DARK MODE (ĐỒNG BỘ VỚI LAYOUT)
   ========================================================= */
/* Bắt cả data-bs-theme và data-theme để tương thích 100% */
[data-bs-theme="dark"] body,
[data-theme="dark"] body,
body.dark-mode {
    background-color: #0f172a !important;
    color: #e2e8f0 !important;
}

    /* 1. XỬ LÝ NỀN DASHBOARD */
    [data-bs-theme="dark"] .dashboard-wrapper,
    [data-theme="dark"] .dashboard-wrapper,
    body.dark-mode .dashboard-wrapper {
        background-color: #0f172a !important;
    }

    /* 2. XỬ LÝ CARD (Ghi đè .bg-white) */
    [data-bs-theme="dark"] .card,
    [data-theme="dark"] .card,
    body.dark-mode .card {
        background-color: #1e293b !important;
        border: 1px solid #334155 !important;
        box-shadow: none !important;
        color: #e2e8f0 !important;
    }

    /* 3. XỬ LÝ BG-WHITE CỨNG ĐẦU */
    [data-bs-theme="dark"] .bg-white,
    [data-theme="dark"] .bg-white,
    body.dark-mode .bg-white,
    [data-bs-theme="dark"] .card-header.bg-white,
    [data-theme="dark"] .card-header.bg-white {
        background-color: transparent !important;
        color: #ffffff !important;
        border-color: #334155 !important;
    }

    /* Xử lý Text Dark -> White */
    [data-bs-theme="dark"] .text-dark,
    [data-theme="dark"] .text-dark,
    body.dark-mode .text-dark {
        color: #ffffff !important;
    }

    /* 4. XỬ LÝ SUB-MENU TRONG DARK MODE */
    [data-bs-theme="dark"] .sub-menu-card,
    [data-theme="dark"] .sub-menu-card,
    body.dark-mode .sub-menu-card {
        background-color: #1e293b !important;
        border: 1px solid #334155 !important;
        box-shadow: 0 4px 15px rgba(0,0,0,0.5) !important;
    }

    /* Item Menu chưa chọn trong Dark Mode */
    [data-bs-theme="dark"] .menu-item:not(.active),
    [data-theme="dark"] .menu-item:not(.active),
    body.dark-mode .menu-item:not(.active) {
        color: #cbd5e1 !important;
    }

        /* Hover Menu chưa chọn trong Dark Mode */
        [data-bs-theme="dark"] .menu-item:not(.active):hover,
        [data-theme="dark"] .menu-item:not(.active):hover,
        body.dark-mode .menu-item:not(.active):hover {
            background-color: #334155 !important;
            color: #60a5fa !important;
        }

    /* Item Menu ĐANG CHỌN (ACTIVE) trong Dark Mode */
    [data-bs-theme="dark"] .menu-item.active,
    [data-theme="dark"] .menu-item.active,
    body.dark-mode .menu-item.active {
        background-color: #3b82f6 !important; /* Xanh sáng hơn */
        color: #ffffff !important;
        box-shadow: 0 0 15px rgba(59, 130, 246, 0.4); /* Glow effect */
    }

    /* 5. CÁC THÀNH PHẦN KHÁC */
    [data-bs-theme="dark"] .list-group-item,
    [data-theme="dark"] .list-group-item,
    body.dark-mode .list-group-item {
        background-color: transparent !important;
        border-color: #334155 !important;
        color: #e2e8f0 !important;
    }

    [data-bs-theme="dark"] h1, [data-bs-theme="dark"] h2,
    [data-bs-theme="dark"] h3, [data-bs-theme="dark"] h4,
    [data-bs-theme="dark"] h5, [data-bs-theme="dark"] h6,
    [data-theme="dark"] h5, [data-theme="dark"] strong,
    body.dark-mode strong {
        color: #ffffff !important;
    }

    [data-bs-theme="dark"] .text-muted,
    [data-theme="dark"] .text-muted,
    body.dark-mode .text-muted {
        color: #94a3b8 !important;
    }

    [data-bs-theme="dark"] .btn-light,
    [data-theme="dark"] .btn-light,
    body.dark-mode .btn-light {
        background-color: #334155 !important;
        color: #ffffff !important;
        border: 1px solid #475569 !important;
    }

    [data-bs-theme="dark"] .bg-primary-subtle,
    [data-theme="dark"] .bg-primary-subtle,
    body.dark-mode .bg-primary-subtle {
        background-color: #1e3a8a !important;
        color: #dbeafe !important;
    }

[data-bs-theme="dark"] .btn-outline-light,
[data-theme="dark"] .btn-outline-light {
    border-color: #475569 !important;
    color: #fff !important;
}

/* =========================================================
   MEDIA QUERIES - RESPONSIVE HOME PAGE
   ========================================================= */

@media (max-width: 991.98px) {
    /* Responsive Banner - Giảm nhẹ chiều cao */
    .banner-img {
        height: 500px;
    }
    
    .display-3 {
        font-size: 3.5rem; /* Cỡ chữ LTA Tech Solution */
    }
}

@media (max-width: 767.98px) {
    .banner-img {
        height: 450px;
    }

    .display-3 {
        font-size: 2.5rem;
    }
    
    .h2.fw-light {
        font-size: 1.5rem;
    }

    /* Thu nhỏ các box thống kê trên Banner */
    .stat-box {
        width: 140px;
        padding: 10px;
        margin: 5px;
        border-left: 3px solid rgba(255,255,255,0.5);
    }
    
    .stat-num {
        font-size: 1.5rem;
    }
    
    .stat-text {
        font-size: 0.75rem;
    }
    
    /* Responsive Sub-menu Nổi */
    .sub-menu-card .d-flex {
        flex-wrap: wrap;
    }
    
    .menu-item {
        flex: 1 1 40%; /* Chiếm khoảng 1 nửa để thành 2 cột */
        margin-bottom: 10px;
    }
}

@media (max-width: 575.98px) {
    .banner-img {
        height: 400px;
    }
    
    .display-3 {
        font-size: 2rem;
    }
    
    .stat-box {
        width: 120px;
    }
    
    .dashboard-wrapper {
        padding-top: 1.5rem !important; /* Giảm padding py-5 -> py-3 (gần đúng) */
        padding-bottom: 1.5rem !important;
    }
}
