html, body {
    height: 100vh;
}

body {
    display: flex;
    flex-direction: column;
    background: white;
    font-family: 'Times New Roman', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: medium;
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

body.loaded {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}

.container-fluid.full-height {
    flex: 1;
    display: flex;
    flex-direction: row; /* Sidebar + main */
    height: 100vh;
    overflow-y: auto;
}

/*CONTENT*/
.admin-layout {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    height: 100%;
}
.admin-header {
    flex-shrink: 0;
}

.admin-footer {
    margin-top: auto;
}

.scrollable-content {
    flex-grow: 1;
    overflow-y: auto;
}

.scrollable-content::-webkit-scrollbar {
    width: 6px;
}
.scrollable-content::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 3px;
}
.scrollable-content::-webkit-scrollbar-thumb:hover {
    background-color: #999;
}

/*SIDEBAR*/
.sidebar {
    height: 100vh;
    overflow-y: auto;
    background: white !important;
    color: black !important;
    min-height: 100vh;
    padding-top: 1rem;
    padding-bottom: 1rem;
    font-size: 0.95rem;
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.05);
    border-right: 1px solid #e6e6e66b;
}

/* Logo */
.sidebar .brand img {
    max-width: 100%;
    height: auto;
    display: block;
}

.sidebar .list-group {
    width: 100% !important;
}

/* List group items */
.sidebar .list-group-item {
    background: none;
    border: none;
    transition: background 0.3s ease, color 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

.sidebar .list-group-item i {
    text-align: center;
    font-size: 1.1rem;
}

/* Hover and focus state */
.sidebar .list-group-item:hover,
.sidebar .list-group-item:focus {
    background-color: #343a40;
    color: #ffffff;
}

/* Active or selected item (you can add active logic in controller if needed) */
.sidebar .list-group-item.active {
    background-color: #495057;
    color: #ffffff;
    font-weight: 600;
}

/* Logout button */
.sidebar form button.list-group-item {
    background-color: transparent;
    color: #ff4d4f;
    border: none;
    padding: 0.75rem 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar form button.list-group-item:hover {
    background-color: rgba(255, 77, 79, 0.15);
    color: royalblue;
}

.lesson-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    background-color: #f9f9f9;
}

.error {
    color: red;
    font-size: 14px;
    margin-top: 5px;
    display: none; /* Ẩn thông báo lỗi mặc định */
}

.input-error {
    border: 1px solid red; /* Viền đỏ cho input lỗi */
}

/* Responsive cho mobile */
@media (max-width: 767.98px) {
    .sidebar .list-group-item span {
        display: none;
    }

    .sidebar .list-group-item i {
        margin-right: 0;
    }

    .sidebar {
        font-size: 0.85rem;
    }

    .sidebar {
        display: none;
        position: absolute;
        top: 0;
        left: 0;
        z-index: 1050;
        width: 220px;
        height: 100%;
        background-color: white;
        box-shadow: 2px 0 8px rgba(0,0,0,0.15);
    }

    .sidebar.show {
        display: block !important;
    }

    .admin-layout {
        margin-left: 0 !important;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem;
    }

    .admin-header .greeting {
        font-size: 1rem;
    }

    .admin-header .btn {
        width: 100%;
    }

    .admin-header .user-actions {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
    }

    .admin-header .d-flex.align-items-center.gap-3 {
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .admin-header .d-flex.align-items-center.gap-3 > * {
        flex-shrink: 0;
    }
}

@media (max-width: 991.98px) {
    .sidebar .list-group-item span {
        display: none;
    }

    .sidebar {
        width: 200px;
        transition: transform 0.3s ease;
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }
}

/*Toast container for knowledge toast*/
@keyframes bounceIn {
    0% { opacity: 0; transform: translateY(-15px) scale(0.9); }
    60% { opacity: 1; transform: translateY(3px) scale(1.01); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.ck-editor__editable_inline {
    min-height: 400px !important;
}