﻿/* ==========================================================================
   FILE CSS RESPONSIVE - TỐI ƯU GIAO DIỆN DI ĐỘNG (FLOATING PANEL MENU)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. ĐIỂM DỪNG CHO MÁY TÍNH BẢNG & MOBILE (Dưới 991.98px)
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    /* --- Cấu trúc nền hệ thống --- */
    body {
        font-size: 13.5px;
    }

    .container-fluid {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    /* --- Biến đổi nút Toggle thành 3 vạch CSS mảnh (Hamburger) --- */
    .custom-toggler {
        border: none !important;
        padding: 4px !important;
        background: transparent !important;
        display: flex;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
    }

        .custom-toggler:focus {
            box-shadow: none !important;
        }

    .toggler-icon-bar {
        display: block;
        width: 22px;
        height: 2px;
        background-color: #ffffff;
        border-radius: 1px;
        transition: all 0.2s ease-in-out;
    }

    /* Hiệu ứng xoay chéo nút 3 vạch thành dấu X khi mở (Kết hợp JS nếu có) */
    .custom-toggler.active .toggler-icon-bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .custom-toggler.active .toggler-icon-bar:nth-child(2) {
        opacity: 0;
    }

    .custom-toggler.active .toggler-icon-bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* --- Khung chứa Menu đổ xuống dạng Thẻ Nổi Kính Mờ (Glassmorphism) --- */
    .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 12px;
        right: 12px;
        z-index: 999;
        background: linear-gradient(165deg, rgba(9, 44, 99, 0.96) 0%, rgba(12, 62, 140, 0.98) 100%) !important;
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        border-radius: 20px !important;
        padding: 24px 20px !important;
        margin-top: 10px;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4) !important;
    }

    /* --- Khối Thông tin Người dùng Phẳng (Mobile User Card) --- */
    .mobile-user-card {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 0 4px 18px 4px;
        margin-bottom: 18px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

        .mobile-user-card .avatar-zone {
            flex-shrink: 0;
        }

        .mobile-user-card .info-zone .user-name {
            color: #ffffff;
            font-size: 15px;
            font-weight: 600;
            line-height: 1.3;
        }

        .mobile-user-card .info-zone .user-role {
            color: rgba(255, 255, 255, 0.55);
            font-size: 12px;
            margin-top: 2px;
        }

    /* --- Danh sách các đường Link điều hướng chính (Menu Items) --- */
    .navbar-custom .custom-main-nav {
        display: flex !important;
        flex-direction: column !important;
        gap: 6px !important;
    }

        .navbar-custom .custom-main-nav .nav-link {
            display: flex !important;
            align-items: center;
            gap: 14px !important;
            padding: 13px 16px !important;
            color: rgba(255, 255, 255, 0.75) !important;
            font-size: 14.5px !important;
            font-weight: 500 !important;
            background-color: transparent !important;
            border-radius: 12px !important;
            border: none !important;
            position: relative;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        }

            .navbar-custom .custom-main-nav .nav-link i {
                font-size: 18px;
                width: 24px;
                text-align: center;
                opacity: 0.8;
            }

            /* Trạng thái Hover / Active phủ khối trắng mờ sang trọng */
            .navbar-custom .custom-main-nav .nav-link:hover,
            .navbar-custom .custom-main-nav .nav-link.active {
                color: #ffffff !important;
                background-color: rgba(255, 255, 255, 0.08) !important;
            }

                /* Vạch kẻ chỉ thị nhỏ tinh tế ở lề trái phần tử đang Active */
                .navbar-custom .custom-main-nav .nav-link.active::before {
                    content: "";
                    position: absolute;
                    left: 0;
                    top: 25%;
                    height: 50%;
                    width: 3.5px;
                    background-color: #ffffff;
                    border-radius: 0 4px 4px 0;
                }

        /* Phẳng hóa cấu trúc Dropdown trên Mobile để trượt dọc mượt mà */
        .navbar-custom .custom-main-nav .dropdown-menu {
            position: relative !important;
            top: 0 !important;
            left: 0 !important;
            width: 100% !important;
            background-color: rgba(0, 0, 0, 0.15) !important;
            border: none !important;
            box-shadow: none !important;
            margin-top: 4px !important;
            padding: 6px !important;
        }

        .navbar-custom .custom-main-nav .dropdown-item {
            color: rgba(255, 255, 255, 0.7) !important;
            font-size: 13.5px;
            padding: 10px 16px !important;
            border-radius: 8px;
        }

            .navbar-custom .custom-main-nav .dropdown-item:hover,
            .navbar-custom .custom-main-nav .dropdown-item.active {
                background-color: rgba(255, 255, 255, 0.06) !important;
                color: #ffffff !important;
            }

    /* --- Khu vực chức năng phụ dưới đáy (Mobile Action Zone) --- */
    .mobile-action-zone {
        margin-top: 14px;
        padding-top: 14px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

        .mobile-action-zone .action-link {
            display: flex;
            align-items: center;
            gap: 14px;
            padding: 12px 16px;
            color: rgba(255, 255, 255, 0.65);
            font-size: 14px;
            text-decoration: none;
            border-radius: 12px;
            transition: all 0.2s ease;
        }

            .mobile-action-zone .action-link i {
                font-size: 18px;
                width: 24px;
                text-align: center;
            }

            .mobile-action-zone .action-link:hover {
                color: #ffffff;
                background-color: rgba(255, 255, 255, 0.05);
            }

            /* Nút đăng xuất chữ đỏ dịu */
            .mobile-action-zone .action-link.text-danger-light {
                color: #ff7675 !important;
            }

                .mobile-action-zone .action-link.text-danger-light:hover {
                    background-color: rgba(255, 118, 117, 0.08) !important;
                }

        /* Nút Đăng nhập hệ thống kéo giãn full màn hình trên Mobile */
        .mobile-action-zone .btn-mobile-login-trigger {
            background-color: #ffffff !important;
            color: #0b3a82 !important;
            font-weight: 600;
            justify-content: center;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }

            .mobile-action-zone .btn-mobile-login-trigger:hover {
                background-color: rgba(255, 255, 255, 0.9) !important;
            }

    /* --- Các thành phần Layout khác trên Tablet --- */
    .modern-stat-card, .stat-card {
        padding: 14px 16px;
    }

    .modern-stat-value {
        font-size: 20px !important;
    }

    /* Thanh tiến trình mũi tên trượt ngang */
    .problem-status-steps-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 6px;
    }

    .chevron-steps-wrapper {
        display: inline-flex;
        width: max-content;
        min-width: 100%;
    }

    .sticky-profile-card {
        position: relative !important;
        top: 0 !important;
        margin-bottom: 20px;
    }
}

/* --------------------------------------------------------------------------
   2. ĐIỂM DỪNG CHO THIẾT BỊ DI ĐỘNG NHỎ (Dưới 767.98px)
   -------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
    h1, .fs-10 {
        font-size: 15px !important;
    }

    /* --- GIỮ NGUYÊN ĐỊNH DẠNG BẢNG THƯỜNG (DÒNG & CỘT TRUYỀN THỐNG) --- */
    .table-modern {
        display: table !important;
        width: 100% !important;
        min-width: 720px; /* Độ rộng tối thiểu để các cột không bị ép chặt dữ liệu */
    }

        .table-modern thead {
            display: table-header-group !important;
        }

        .table-modern tbody {
            display: table-row-group !important;
        }

        .table-modern tr {
            display: table-row !important;
        }

        .table-modern th,
        .table-modern td {
            display: table-cell !important;
            padding: 12px 14px !important;
            font-size: 13px !important;
            text-align: left !important;
            white-space: nowrap; /* Ngăn chặn việc ngắt dòng vô tội vạ */
        }

        /* Xóa bỏ hoàn toàn quy tắc chèn nhãn card cũ */
        .table-modern tbody td::before {
            display: none !important;
        }

    /* Hệ thống các thanh Tabs danh mục hỗ trợ vuốt ngang mượt */
    .profile-tabs, .custom-nav-tabs {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

        .profile-tabs .nav-link, .custom-nav-tabs .nav-link {
            white-space: nowrap;
            padding: 10px 14px !important;
            flex: 0 0 auto;
        }
}

/* ==========================================================================
   FILE CSS RESPONSIVE - ÉP GIAO DIỆN TABLET HIỂN THỊ DẠNG MOBILE PANEL
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. ĐIỂM DỪNG CHO MÁY TÍNH BẢNG & MOBILE (Dưới 1199.98px)
   -------------------------------------------------------------------------- */
@media (max-width: 1199.98px) {
    /* Ẩn vùng dropdown tài khoản mặc định của Desktop và hiện nút toggle */
    .navbar-expand-lg .navbar-toggler {
        display: flex !important;
    }

    .navbar-expand-lg .navbar-collapse {
        display: none !important;
    }

        .navbar-expand-lg .navbar-collapse.show {
            display: block !important;
        }

    body {
        font-size: 13.5px;
    }

    .container-fluid {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    /* Biến đổi nút Toggle thành 3 vạch CSS mảnh (Hamburger) */
    .custom-toggler {
        border: none !important;
        padding: 4px !important;
        background: transparent !important;
        display: flex;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
    }

        .custom-toggler:focus {
            box-shadow: none !important;
        }

    .toggler-icon-bar {
        display: block;
        width: 22px;
        height: 2px;
        background-color: #ffffff;
        border-radius: 1px;
        transition: all 0.2s ease-in-out;
    }

    /* Khung chứa Menu đổ xuống dạng Thẻ Nổi Kính Mờ (Glassmorphism) */
    .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 12px;
        right: 12px;
        z-index: 999;
        background: linear-gradient(165deg, rgba(9, 44, 99, 0.97) 0%, rgba(12, 62, 140, 0.99) 100%) !important;
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        border-radius: 20px !important;
        padding: 24px 20px !important;
        margin-top: 10px;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4) !important;
    }

    /* Tắt tính năng ẩn/hiện của các thẻ d-lg-none và d-none d-lg-block cũ để tương thích breakpoint mới */
    .d-lg-none {
        display: flex !important;
    }

    .d-none.d-lg-block {
        display: none !important;
    }

    .navbar-nav.mx-auto {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* Khối thông tin User trên Mobile */
    .mobile-user-card {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 0 4px 18px 4px;
        margin-bottom: 18px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

        .mobile-user-card .avatar-zone {
            flex-shrink: 0;
        }

        .mobile-user-card .info-zone .user-name {
            color: #ffffff;
            font-size: 15px;
            font-weight: 600;
            line-height: 1.3;
        }

        .mobile-user-card .info-zone .user-role {
            color: rgba(255, 255, 255, 0.55);
            font-size: 12px;
            margin-top: 2px;
        }

    /* Ép menu xếp dọc thẳng hàng */
    .navbar-custom .custom-main-nav {
        display: flex !important;
        flex-direction: column !important;
        gap: 6px !important;
        width: 100% !important;
    }

        .navbar-custom .custom-main-nav .nav-link {
            display: flex !important;
            align-items: center;
            gap: 14px !important;
            padding: 13px 16px !important;
            color: rgba(255, 255, 255, 0.8) !important;
            font-size: 14.5px !important;
            font-weight: 500 !important;
            background-color: transparent !important;
            border-radius: 12px !important;
            border: none !important;
            position: relative;
            transition: all 0.2s ease;
        }

            .navbar-custom .custom-main-nav .nav-link i {
                font-size: 18px;
                width: 24px;
                text-align: center;
                opacity: 0.8;
            }

            .navbar-custom .custom-main-nav .nav-link:hover,
            .navbar-custom .custom-main-nav .nav-link.active {
                color: #ffffff !important;
                background-color: rgba(255, 255, 255, 0.08) !important;
            }

                .navbar-custom .custom-main-nav .nav-link.active::before {
                    content: "";
                    position: absolute;
                    left: 0;
                    top: 25%;
                    height: 50%;
                    width: 3.5px;
                    background-color: #ffffff;
                    border-radius: 0 4px 4px 0;
                }

        /* Trải phẳng danh mục con (Dropdown) */
        .navbar-custom .custom-main-nav .dropdown-menu {
            position: relative !important;
            top: 0 !important;
            left: 0 !important;
            width: 100% !important;
            background-color: rgba(0, 0, 0, 0.15) !important;
            border: none !important;
            box-shadow: none !important;
            margin-top: 4px !important;
            padding: 6px !important;
            display: none;
        }

            .navbar-custom .custom-main-nav .dropdown-menu.show {
                display: block !important;
            }

        .navbar-custom .custom-main-nav .dropdown-item {
            color: rgba(255, 255, 255, 0.7) !important;
            font-size: 13.5px;
            padding: 10px 16px !important;
            border-radius: 8px;
            display: flex;
            align-items: center;
            gap: 12px;
        }

    /* Khu vực nút chức năng phụ/đăng nhập dưới đáy */
    .mobile-action-zone {
        margin-top: 14px;
        padding-top: 14px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        display: flex;
        flex-direction: column;
        gap: 4px;
        width: 100%;
    }

        .mobile-action-zone .action-link {
            display: flex;
            align-items: center;
            gap: 14px;
            padding: 12px 16px;
            color: rgba(255, 255, 255, 0.65);
            font-size: 14px;
            text-decoration: none;
            border-radius: 12px;
            transition: all 0.2s ease;
        }

            .mobile-action-zone .action-link i {
                font-size: 18px;
                width: 24px;
                text-align: center;
            }

            .mobile-action-zone .action-link.text-danger-light {
                color: #ff7675 !important;
            }

        .mobile-action-zone .btn-mobile-login-trigger {
            background-color: #ffffff !important;
            color: #0b3a82 !important;
            font-weight: 600;
            justify-content: center;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }

    /* --- Đồng bộ các khối giao diện nội dung phía dưới --- */
    .modern-stat-card, .stat-card {
        padding: 14px 16px;
    }

    .modern-stat-value {
        font-size: 20px !important;
    }

    .problem-status-steps-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 6px;
    }

    .chevron-steps-wrapper {
        display: inline-flex;
        width: max-content;
        min-width: 100%;
    }

    .sticky-profile-card {
        position: relative !important;
        top: 0 !important;
        margin-bottom: 20px;
    }
}

/* --------------------------------------------------------------------------
   2. ĐIỂM DỪNG CHO THIẾT BỊ DI ĐỘNG NHỎ (Dưới 767.98px)
   -------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
    h1, .fs-10 {
        font-size: 15px !important;
    }

    /* Trả cấu trúc dòng / cột nguyên bản cho bảng dữ liệu */
    .table-modern {
        display: table !important;
        width: 100% !important;
        min-width: 750px;
    }

        .table-modern thead {
            display: table-header-group !important;
        }

        .table-modern tbody {
            display: table-row-group !important;
        }

        .table-modern tr {
            display: table-row !important;
        }

        .table-modern th, .table-modern td {
            display: table-cell !important;
            padding: 12px 14px !important;
            font-size: 13px !important;
            text-align: left !important;
            white-space: nowrap;
        }

        .table-modern tbody td::before {
            display: none !important;
        }

    .profile-tabs, .custom-nav-tabs {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

        .profile-tabs .nav-link, .custom-nav-tabs .nav-link {
            white-space: nowrap;
            padding: 10px 14px !important;
            flex: 0 0 auto;
        }
}