@import url('css/file-attachments.css');

/* ==========================================
   CSS VARIABLES - Z-INDEX (giống MVC)
   ========================================== */
:root {
    --z-sidebar: 1001;
    --z-header: 1000;
    --z-popup: 10002;
    --z-toast: 1050;
    --z-error: 1000;
}

html,
body {
    font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #f5f7fa;
}

/* Exception cho exam pages - cho phép overflow-x visible để sticky hoạt động */
html.practice-exam-page-html,
body.practice-exam-page-body {
    overflow-x: visible !important;
}

a,
.btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* ==========================================
   EXAM ADMIN SIDEBAR NAVIGATION
   Scoped to .admin-layout to prevent conflicts with Home AdminLayout
   ========================================== */
.admin-layout .sidebar {
    transform: translateZ(0);
    will-change: width;
}

.admin-layout .sidebar.transitioning {
    will-change: width;
}

.admin-layout .sidebar .nav-link,
.admin-layout .sidebar a.nav-link {
    color: rgba(0, 0, 0, 0.87) !important;
    text-decoration: none !important;
    display: flex !important;
    align-items: center !important;
    padding: 12px 16px !important;
    margin: 4px 8px !important;
    min-height: 48px !important;
    border-radius: 8px;
    transform: translate3d(0, 0, 0);
    position: relative;
}

.admin-layout .sidebar .nav-link.active,
.admin-layout .sidebar a.nav-link.active {
    color: #214CA6 !important;
    font-weight: 600;
    background-color: rgba(33, 76, 166, 0.08) !important;
    position: relative;
}

/* Blue bar indicator for active tab */
.admin-layout .sidebar .nav-link.active::before,
.admin-layout .sidebar a.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background-color: #214CA6;
    border-radius: 0 2px 2px 0;
    z-index: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.admin-layout .sidebar .nav-link:hover,
.admin-layout .sidebar a.nav-link:hover {
    color: rgba(0, 0, 0, 0.87) !important;
    background-color: rgba(0, 0, 0, 0.04) !important;
}

.admin-layout .sidebar .nav-link i {
    color: rgba(0, 0, 0, 0.6) !important;
    width: 24px;
    height: 24px;
    margin-right: 12px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px;
    flex-shrink: 0;
    transition: margin 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        color 0.2s ease;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
}

.admin-layout .sidebar .nav-link.active i,
.admin-layout .sidebar .nav-link:hover i {
    color: #214CA6 !important;
}

.admin-layout .sidebar .nav-link span {
    color: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    display: flex;
    align-items: center;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
}

.admin-layout .sidebar .nav-link.active span {
    color: #214CA6 !important;
    font-weight: 600;
}

/* Nav Item spacing */
.admin-layout .sidebar .nav-item {
    margin-bottom: 2px;
}

.admin-layout .sidebar .nav-item:last-child {
    margin-bottom: 0;
}

/* Sidebar list styling */
.admin-layout .sidebar .nav.flex-column {
    padding: 0;
    margin: 0;
    list-style: none;
}

/* ==========================================
   COLLAPSED SIDEBAR - Icon Only
   ========================================== */
.admin-layout .sidebar.collapsed {
    width: 64px;
}

.admin-layout .sidebar.collapsed .nav-link {
    width: 48px !important;
    height: 48px !important;
    padding: 12px 0 !important;
    margin: 4px auto !important;
    justify-content: center !important;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-layout .sidebar.collapsed .nav-link span {
    display: none !important;
    opacity: 0;
    width: 0;
    height: 0;
    visibility: hidden;
    pointer-events: none;
}

.admin-layout .sidebar.collapsed .nav-link i {
    margin: 0 !important;
    position: static !important;
    transform: translate3d(0, 0, 0) !important;
    font-size: 20px !important;
    color: rgba(0, 0, 0, 0.6) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-layout .sidebar.collapsed .nav-link.active {
    background-color: rgba(33, 76, 166, 0.12) !important;
}

/* Hide blue bar when collapsed */
.admin-layout .sidebar.collapsed .nav-link.active::before,
.admin-layout .sidebar.collapsed a.nav-link.active::before {
    display: none;
}

.admin-layout .sidebar.collapsed .nav-link.active i {
    color: #214CA6 !important;
}

.admin-layout .sidebar.collapsed .nav-link:hover i {
    color: #214CA6 !important;
}

.admin-layout .sidebar.collapsed .nav-link:hover {
    background-color: rgba(0, 0, 0, 0.08) !important;
}

/* Tooltip hint on hover */
.admin-layout .sidebar.collapsed .nav-link {
    position: relative;
}

.admin-layout .sidebar.collapsed .nav-link:hover::after {
    content: attr(title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    white-space: nowrap;
    margin-left: 12px;
    z-index: 1000;
    opacity: 1;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* ==========================================
   PAGE SIDEBAR NAVIGATION (Components/Layout)
   Giống như .admin-layout .sidebar nhưng scope vào .page
   ========================================== */
.page .sidebar {
    transform: translateZ(0);
    will-change: width;
    z-index: var(--z-sidebar, 1001);
    position: relative;
}

.page .sidebar.transitioning {
    will-change: width;
}

.page .sidebar .nav-link,
.page .sidebar a.nav-link {
    color: rgba(0, 0, 0, 0.87) !important;
    text-decoration: none !important;
    display: flex !important;
    align-items: center !important;
    padding: 12px 16px !important;
    margin: 4px 8px !important;
    min-height: 48px !important;
    border-radius: 8px;
    transform: translate3d(0, 0, 0);
    position: relative;
    width: calc(100% - 16px) !important; /* Trừ margin để không làm tràn */
    box-sizing: border-box !important;
    overflow: visible !important; /* Không ẩn chevron */
    max-width: 100% !important;
}

.page .sidebar .nav-link.active,
.page .sidebar a.nav-link.active {
    color: #214CA6 !important;
    font-weight: 600;
    background-color: rgba(33, 76, 166, 0.08) !important;
    position: relative;
}

/* Blue bar indicator for active tab */
.page .sidebar .nav-link.active::before,
.page .sidebar a.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background-color: #214CA6;
    border-radius: 0 2px 2px 0;
    z-index: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.page .sidebar .nav-link:hover,
.page .sidebar a.nav-link:hover {
    color: rgba(0, 0, 0, 0.87) !important;
    background-color: rgba(0, 0, 0, 0.04) !important;
}

.page .sidebar .nav-link i {
    color: rgba(0, 0, 0, 0.6) !important;
    width: 24px;
    height: 24px;
    margin-right: 12px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px;
    flex-shrink: 0;
    transition: margin 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        color 0.2s ease;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
}

/* Exception: Submenu toggle (chevron) không có margin-right */
.page .sidebar .nav-link i.submenu-toggle {
    margin-right: 0 !important;
    margin-left: auto !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease !important;
    transform-origin: center !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Chevron xoay khi expanded */
.page .sidebar .nav-link i.submenu-toggle.expanded {
    transform: rotate(90deg) !important;
}

/* Exception: Submenu item icons - không áp dụng rule chung */
.page .sidebar .nav-link.submenu-item i {
    width: 16px !important;
    height: 16px !important;
    font-size: 14px !important;
    margin-right: 10px !important;
    margin-left: 0 !important;
    min-width: 16px !important;
}

/* Exception: Submenu item padding - dịch chuyển icon và text sang phải */
.page .sidebar .nav-link.submenu-item,
.page .sidebar a.nav-link.submenu-item {
    padding: 8px 12px 8px 40px !important;
}

/* Cố định sidebar-content, không cho phép scroll */
.page .sidebar .sidebar-content,
.admin-layout .sidebar .sidebar-content {
    overflow: hidden !important;
    overflow-y: hidden !important;
    overflow-x: hidden !important;
}

/* Submenu container - Animation dropdown mượt mà */
.page .sidebar .submenu {
    overflow: hidden !important;
    max-height: 0 !important;
    opacity: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    transition-property: max-height, opacity, margin-top, margin-bottom !important;
    transition-duration: 0.4s !important;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;
    animation: none !important;
}

/* Submenu khi expanded - hiển thị với animation mượt */
.page .sidebar .submenu.expanded {
    max-height: 1000px !important;
    opacity: 1 !important;
    margin-top: 4px !important;
    margin-bottom: 4px !important;
}

.page .sidebar .nav-link.active i,
.page .sidebar .nav-link:hover i {
    color: #214CA6 !important;
}

.page .sidebar .nav-link span {
    color: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    display: flex;
    align-items: center;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
}

.page .sidebar .nav-link.active span {
    color: #214CA6 !important;
    font-weight: 600;
}

/* Nav Item spacing */
.page .sidebar .nav-item {
    margin-bottom: 2px;
}

.page .sidebar .nav-item:last-child {
    margin-bottom: 0;
}

/* Sidebar list styling */
.page .sidebar .nav.flex-column {
    padding: 0;
    margin: 0;
    list-style: none;
}

/* ==========================================
   COLLAPSED SIDEBAR - Icon Only (Page)
   ========================================== */
.page .sidebar.collapsed {
    width: 64px;
}

.page .sidebar.collapsed .nav-link {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    padding: 12px 0 !important;
    margin: 4px auto !important;
    justify-content: center !important;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.page .sidebar.collapsed .nav-link span {
    display: none !important;
    opacity: 0;
    width: 0;
    height: 0;
    visibility: hidden;
    pointer-events: none;
}

.page .sidebar.collapsed .nav-link i {
    margin: 0 !important;
    position: static !important;
    transform: translate3d(0, 0, 0) !important;
    font-size: 20px !important;
    color: rgba(0, 0, 0, 0.6) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.page .sidebar.collapsed .nav-link.active {
    background-color: rgba(33, 76, 166, 0.12) !important;
}

/* Hide blue bar when collapsed */
.page .sidebar.collapsed .nav-link.active::before,
.page .sidebar.collapsed a.nav-link.active::before {
    display: none;
}

.page .sidebar.collapsed .nav-link.active i {
    color: #214CA6 !important;
}

.page .sidebar.collapsed .nav-link:hover i {
    color: #214CA6 !important;
}

.page .sidebar.collapsed .nav-link:hover {
    background-color: rgba(0, 0, 0, 0.08) !important;
}

/* Tooltip hint on hover */
.page .sidebar.collapsed .nav-link {
    position: relative;
}

.page .sidebar.collapsed .nav-link:hover::after {
    content: attr(title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    white-space: nowrap;
    margin-left: 12px;
    z-index: 1000;
    opacity: 1;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* ==========================================
   EXAM ADMIN MAIN CONTENT RESPONSIVE TO SIDEBAR STATE
   ========================================== */
.admin-layout .main-content {
    margin-left: 250px;
    transition: margin-left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Khi sidebar collapsed, main-content sẽ dịch chuyển theo */
.admin-layout .sidebar.collapsed~.main-content {
    margin-left: 64px;
}

/* Responsive cho mobile */
@media (max-width: 768px) {
    .admin-layout .main-content {
        margin-left: 0 !important;
    }
}

/* ==========================================
   PAGE MAIN CONTENT RESPONSIVE TO SIDEBAR STATE
   ========================================== */
.page main {
    margin-left: 250px;
    transition: margin-left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Khi sidebar collapsed, main sẽ dịch chuyển theo */
/* Class collapsed được sync lên div.sidebar bởi JavaScript */
/* Main content điều chỉnh khi sidebar collapsed */
.page .sidebar.collapsed ~ main {
    margin-left: 64px;
}

/* Header điều chỉnh khi sidebar collapsed */
.page .sidebar.collapsed ~ main .app__header {
    left: 64px !important;
    width: calc(100% - 64px) !important;
}

/* Fallback: Nếu có nav.collapsed bên trong, cũng apply */
.page .sidebar:has(nav.collapsed) ~ main {
    margin-left: 64px;
}

.page .sidebar:has(nav.collapsed) ~ main .app__header {
    left: 64px !important;
    width: calc(100% - 64px) !important;
}

/* Responsive cho mobile */
@media (max-width: 768px) {
    .page main {
        margin-left: 0 !important;
        padding-top: 64px !important; /* Vẫn giữ padding-top cho header */
    }
    
    .page .sidebar.collapsed ~ main,
    .page .sidebar:has(nav.collapsed) ~ main {
        margin-left: 0 !important;
    }

    /* Header full width trên mobile */
    .page .app__header {
        left: 0 !important;
        width: 100% !important;
    }

    .page .sidebar.collapsed ~ main .app__header,
    .page .sidebar:has(nav.collapsed) ~ main .app__header {
        left: 0 !important;
        width: 100% !important;
    }
}

/* Home page styles */
.home-container {
    padding: 20px;
}

.notification-wrapper,
.portal-wrapper {
    display: flex;
    align-items: center;
}

.btn-portal {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f5f7fa;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5A6C7D;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-portal:hover {
    background-color: #e8ecf0;
    color: #4A90E2;
    transform: scale(1.05);
}

/* User Profile Dropdown */
.user-profile {
    position: relative;
}

.user-button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #e8ecf0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-button:hover {
    background-color: #f5f7fa;
    border-color: #d0d7de;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.user-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2C3E50;
}

.user-arrow {
    font-size: 0.75rem;
    color: #5A6C7D;
    transition: transform 0.3s ease;
}

.user-button:hover .user-arrow {
    transform: translateY(2px);
}

/* User Dropdown Menu */
.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: white;
    border: 1px solid #e8ecf0;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    min-width: 280px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e8ecf0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar-large {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.user-details {
    flex: 1;
}

.user-details .user-name {
    font-size: 1rem;
    font-weight: 600;
    color: #2C3E50;
    margin-bottom: 0.25rem;
}

.user-email {
    font-size: 0.875rem;
    color: #5A6C7D;
}

.user-dropdown-menu {
    padding: 0.5rem;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    color: #2C3E50;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 0.95rem;
}

.dropdown-item:hover {
    background-color: #f5f7fa;
    color: #4A90E2;
}

.dropdown-item i {
    width: 20px;
    font-size: 1rem;
    color: #5A6C7D;
}

.dropdown-item:hover i {
    color: #4A90E2;
}

.dropdown-divider {
    height: 1px;
    background-color: #e8ecf0;
    margin: 0.5rem 0;
}

.logout-btn {
    color: #dc3545;
}

.logout-btn:hover {
    background-color: rgba(220, 53, 69, 0.08);
    color: #dc3545;
}

.logout-btn i {
    color: #dc3545;
}

/* Roles and permissions styling */
.roles-section,
.permissions-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e8ecf0;
}

.roles-section h4,
.permissions-section h4 {
    color: #2C3E50;
    margin-bottom: 1rem;
    font-size: 1.15rem;
    font-weight: 600;
}

.roles-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.role-badge {
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(74, 144, 226, 0.2);
}

.user-details {
    margin-bottom: 1.5rem;
}

.user-info-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.875rem;
    padding: 0.75rem;
    border-radius: 6px;
    background: #f8f9fa;
}

.user-info-item i {
    margin-right: 0.75rem;
    width: 24px;
    color: #4A90E2;
    font-size: 1.1rem;
}

.user-info-item strong {
    color: #2C3E50;
    margin-right: 0.5rem;
}


/* ===== SIMPLE BUTTON SYSTEM ===== */

/* Base Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: normal;
    text-decoration: none;
    transition: background-color 0.2s ease;
    min-width: 50px;
    background: white;
    color: #333;
}

.btn:focus {
    outline: 2px solid #007bff;
    outline-offset: 1px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Button Sizes */
.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    min-width: 50px;
}

.btn-lg {
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    min-width: 100px;
}

/* Button Variants */
.btn-primary {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.btn-primary:hover:not(:disabled) {
    background: #0056b3;
    border-color: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

.btn-secondary:hover:not(:disabled) {
    background: #545b62;
    border-color: #545b62;
}

.btn-success {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.btn-success:hover:not(:disabled) {
    background: #1e7e34;
    border-color: #1e7e34;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.btn-danger:hover:not(:disabled) {
    background: #c82333;
    border-color: #c82333;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
    border-color: #ffc107;
}

.btn-warning:hover:not(:disabled) {
    background: #e0a800;
    border-color: #e0a800;
}

.btn-info {
    background: #17a2b8;
    color: white;
    border-color: #17a2b8;
}

.btn-info:hover:not(:disabled) {
    background: #138496;
    border-color: #138496;
}

.btn-light {
    background: #f8f9fa;
    color: #212529;
    border-color: #dee2e6;
}

.btn-light:hover:not(:disabled) {
    background: #e2e6ea;
    border-color: #dae0e5;
}

.btn-dark {
    background: #343a40;
    color: white;
    border-color: #343a40;
}

.btn-dark:hover:not(:disabled) {
    background: #23272b;
    border-color: #1d2124;
}

/* Cancel Button */
.btn-cancel {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

.btn-cancel:hover:not(:disabled) {
    background: #545b62;
    border-color: #545b62;
}

/* Loading State */
.btn.loading {
    color: transparent;
    pointer-events: none;
}

.btn.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.btn-primary.loading::after,
.btn-secondary.loading::after,
.btn-success.loading::after,
.btn-danger.loading::after,
.btn-info.loading::after,
.btn-dark.loading::after,
.btn-cancel.loading::after {
    border-top-color: white;
}

.btn-warning.loading::after,
.btn-light.loading::after {
    border-top-color: #212529;
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Icon Buttons - Simple Design */
.btn-icon {
    padding: 0.3rem;
    min-width: auto;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
    font-size: 0.8rem;
}

.btn-icon:hover:not(:disabled) {
    background: #e9ecef;
    border-color: #adb5bd;
}

.btn-icon:active {
    background: #dee2e6;
}

/* Action Button Variants - Simple Colors */
.btn-icon.btn-view {
    background: #f8f9fa;
    color: #495057;
    border-color: #dee2e6;
}

.btn-icon.btn-view:hover:not(:disabled) {
    background: #e9ecef;
    border-color: #adb5bd;
}

.btn-icon.btn-edit {
    background: #f8f9fa;
    color: #495057;
    border-color: #dee2e6;
}

.btn-icon.btn-edit:hover:not(:disabled) {
    background: #e9ecef;
    border-color: #adb5bd;
}

.btn-icon.btn-delete {
    background: #f8f9fa;
    color: #495057;
    border-color: #dee2e6;
}

.btn-icon.btn-delete:hover:not(:disabled) {
    background: #e9ecef;
    border-color: #adb5bd;
}

.btn-icon.btn-permission {
    background: #f8f9fa;
    color: #495057;
    border-color: #dee2e6;
}

.btn-icon.btn-permission:hover:not(:disabled) {
    background: #e9ecef;
    border-color: #adb5bd;
}

/* Pagination Buttons */
.btn-pagination {
    padding: 0.4rem 0.6rem;
    background: white;
    color: #495057;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.2s ease;
    min-width: auto;
}

.btn-pagination:hover:not(:disabled) {
    background: #f8f9fa;
}

.btn-pagination.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.btn-pagination:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Search Button */
.btn-search {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.btn-search:hover:not(:disabled) {
    background: #0056b3;
}

/* Back Button */
.btn-back {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

.btn-back:hover:not(:disabled) {
    background: #545b62;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

/* Action Buttons Container */
.action-buttons {
    display: flex;
    gap: 0.2rem;
    align-items: center;
    justify-content: flex-start;
}

/* Responsive */
@media (max-width: 768px) {
    .form-actions {
        flex-direction: column-reverse;
        gap: 0.5rem;
    }

    .btn {
        width: 100%;
        min-width: auto;
    }

    .action-buttons {
        flex-direction: row;
        gap: 0.15rem;
        justify-content: flex-start;
    }

    .btn-icon {
        width: 1.6rem;
        height: 1.6rem;
        font-size: 0.7rem;
    }
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
}

.card-title {
    color: #000000;
    font-weight: 600;
}

.card-title i {
    margin-right: 8px;
    color: #000000;
}

/* Debug section */
.debug-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
}

.debug-section h4 {
    color: #dc3545;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.debug-list {
    max-height: 200px;
    overflow-y: auto;
}

.debug-item {
    padding: 4px 0;
    font-size: 0.9rem;
    border-bottom: 1px solid #dee2e6;
}

.debug-item:last-child {
    border-bottom: none;
}

/* Table Styles */
th {
    text-align: left;
    font-weight: 600;
    color: #495057;
    padding: 12px;
    border-bottom: 2px solid #e9ecef;
    background: #f8f9fa;
}

td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
}

/* =========================================

/* Ẩn text trong popup items */
.submenu-popup .popup-item span,
.submenu-popup a.popup-item span {
    display: none !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Đảm bảo popup items không có blue bar indicator */
.submenu-popup .popup-item::before,
.submenu-popup a.popup-item::before {
    display: none !important;
    content: none !important;
}

/* Override tất cả CSS global cho popup-item - giống icon sidebar collapsed */
.submenu-popup .popup-item,
.submenu-popup a.popup-item,
.submenu-popup .popup-item.nav-link,
.submenu-popup a.popup-item.nav-link {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    max-width: 48px !important;
    padding: 12px 0 !important;
    margin: 4px auto !important;
    justify-content: center !important;
    align-items: center !important;
    display: flex !important;
    position: relative !important;
    border-radius: 8px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    background-color: transparent !important;
    border: 1px solid transparent !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    text-decoration: none !important;
    color: inherit !important;
}

.submenu-popup .popup-item i,
.submenu-popup a.popup-item i,
.submenu-popup .popup-item.nav-link i,
.submenu-popup a.popup-item.nav-link i {
    margin: 0 !important;
    position: static !important;
    transform: translate3d(0, 0, 0) !important;
    font-size: 20px !important;
    color: rgba(0, 0, 0, 0.6) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.submenu-popup .popup-item.active,
.submenu-popup a.popup-item.active,
.submenu-popup .popup-item.nav-link.active,
.submenu-popup a.popup-item.nav-link.active {
    background-color: rgba(33, 76, 166, 0.12) !important;
    border-color: rgba(33, 76, 166, 0.2) !important;
    color: #214CA6 !important;
    font-weight: 400 !important;
}

.submenu-popup .popup-item.active i,
.submenu-popup a.popup-item.active i,
.submenu-popup .popup-item.nav-link.active i,
.submenu-popup a.popup-item.nav-link.active i {
    color: #214CA6 !important;
}

.submenu-popup .popup-item:hover,
.submenu-popup a.popup-item:hover,
.submenu-popup .popup-item.nav-link:hover,
.submenu-popup a.popup-item.nav-link:hover {
    background-color: rgba(0, 0, 0, 0.08) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
}

.submenu-popup .popup-item:hover i,
.submenu-popup a.popup-item:hover i,
.submenu-popup .popup-item.nav-link:hover i,
.submenu-popup a.popup-item.nav-link:hover i {
    color: #214CA6 !important;
}

/* Các rules .page .sidebar .submenu-popup đã được xóa vì popup không bao giờ nằm trong .page .sidebar */
/* Popup được render bên ngoài <nav> và được di chuyển vào document.body bằng JavaScript */

/* ==========================================
   TOAST NOTIFICATION POSITIONING
   Điều chỉnh vị trí toast để không bị header che
   Header height: 64px, spacing: 16px => top: 80px
   ========================================== */
/* BlazoredToasts container - đảm bảo z-index cao hơn modal "Thêm giảng viên" (999999) và confirmation modal (10000000) */
[class*="blazored-toast"],
[class*="toast-container"],
.blazored-toast-container {
    z-index: 10000002 !important;
}

/* Toast container ở vị trí TopRight - dịch xuống dưới header */
[class*="position-top-right"],
.blazored-toast-container.position-top-right,
.blazored-toast.position-top-right {
    top: 80px !important; /* Header height (64px) + spacing (16px) */
    right: 20px !important;
    bottom: auto !important;
}

/* Toast container ở vị trí TopLeft - dịch xuống dưới header */
[class*="position-top-left"],
.blazored-toast-container.position-top-left,
.blazored-toast.position-top-left {
    top: 80px !important;
    left: 20px !important;
    bottom: auto !important;
}

/* Toast container ở vị trí TopCenter - dịch xuống dưới header */
[class*="position-top-center"],
.blazored-toast-container.position-top-center,
.blazored-toast.position-top-center {
    top: 80px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    bottom: auto !important;
}

/* Fallback: Nếu toast ở top nhưng không có class cụ thể */
[class*="toast"][style*="top: 0"],
[class*="toast"][style*="top:0"] {
    top: 80px !important;
}

/* ==========================================
   EXAM PAGES - Override overflow để sidebar sticky hoạt động
   ========================================== */
/* Sticky positioning cần tất cả parent containers không có overflow: hidden
   Override overflow trên html/body khi trong exam pages */
body:has(.practice-exam-page),
html:has(.practice-exam-page) {
    overflow-x: visible !important;
}

/* Fallback nếu :has() không được support - override trực tiếp */
.practice-exam-page {
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
    width: 100%;
    max-width: 100%;
    position: relative;
}

/* Đảm bảo tất cả containers trong exam pages cho phép sticky hoạt động */
.practice-exam-page > * {
    overflow-x: visible !important;
}

.exam-layout {
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
    align-items: flex-start; /* Đảm bảo sidebar align ở top để sticky hoạt động */
}
