﻿body {
    background-color: #f8f9fa;
}

.admin-wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

#sidebar {
    min-width: 250px;
    max-width: 250px;
    min-height: 100vh;
    color: #fff;
    transition: all 0.3s;
}

    #sidebar .sidebar-header {
        padding: 20px;
        background: #4e555b;
    }

    #sidebar ul.components {
        padding: 20px 0;
        border-bottom: 1px solid #47748b;
    }

    #sidebar ul p {
        color: #fff;
        padding: 10px;
    }

    #sidebar ul li a {
        padding: 15px 20px;
        font-size: 1.1em;
        display: block;
        color: rgba(255,255,255,0.8);
        text-decoration: none;
    }

        #sidebar ul li a:hover {
            color: #fff;
            background: #5a6268;
        }

    #sidebar ul li.active > a, a[aria-expanded="true"] {
        color: #fff;
        background: #3e4449;
    }

#content {
    width: 100%;
    min-height: 100vh;
    transition: all 0.3s;
}


.group-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

    .group-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
    }

    .group-card img {
        width: 60px;
        height: 60px;
        object-fit: cover;
    }

/* Style cho submenu */
#sidebar ul ul {
    padding-left: 1.5rem; /* Thụt vào so với menu cha */
    background-color: #343a40; /* Màu nền hơi khác một chút */
}

    #sidebar ul ul a {
        font-size: 0.9em !important;
        padding-left: 20px !important;
    }

        #sidebar ul ul a:hover {
            background-color: #495057;
        }

/* Style cho dropdown toggle */
a[data-bs-toggle="collapse"] {
    position: relative;
}

.dropdown-toggle::after {
    display: block;
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    content: '\f282'; /* Mã Unicode của icon chevron-down trong Bootstrap Icons */
    font-family: 'bootstrap-icons';
    font-size: 0.8em;
    transition: transform 0.3s ease;
}

/* Hiệu ứng xoay mũi tên khi menu mở */
a[aria-expanded="true"].dropdown-toggle::after {
    transform: translateY(-50%) rotate(180deg);
}


/* === CSS CƠ BẢN === */
#sidebar {
    min-width: 250px;
    max-width: 250px;
    min-height: 100vh;
    transition: all 0.3s;
    z-index: 999; /* Đảm bảo luôn nằm trên cùng */
}

    #sidebar.active {
        margin-left: -250px; /* Ẩn sidebar trên Desktop khi cần (nếu muốn toggle) */
    }

/* Overlay (Lớp phủ mờ) */
.overlay {
    display: none;
    position: fixed;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5); /* Màu đen mờ */
    z-index: 998; /* Nằm dưới sidebar nhưng trên content */
    opacity: 0;
    transition: all 0.5s ease-in-out;
    top: 0;
    left: 0;
}

    .overlay.active {
        display: block;
        opacity: 1;
    }

/* === RESPONSIVE (MOBILE/TABLET) === */
@media (max-width: 768px) {
    /* Mặc định ẩn Sidebar trên mobile */
    #sidebar {
        margin-left: -250px;
        position: fixed; /* Cố định vị trí để trượt ra */
        height: 100vh;
        overflow-y: auto; /* Cho phép cuộn nếu menu dài */
    }

        /* Khi thêm class 'active', Sidebar sẽ trượt ra */
        #sidebar.active {
            margin-left: 0;
        }

    /* Content chiếm full màn hình */
    #content {
        width: 100%;
    }

        /* Khi sidebar mở, content không bị đẩy mà bị đè lên (do sidebar fixed) */
        #content.active {
            width: 100%;
        }

    /* Ẩn nút đóng trên Desktop, hiện trên Mobile */
    #dismiss {
        cursor: pointer;
    }
}