/* ENT Test — Layout: Sidebar inside standard Moodle chrome */

/* ── Minimal overrides for Moodle content area ── */

/* Hide Moodle chrome: breadcrumbs, page heading, secondary nav, edit mode toggle */
body.enttest-page .breadcrumbs-container,
body.enttest-page .breadcrumb-nav,
body.enttest-page .breadcrumbs,
body.enttest-page .rui-breadcrumbs,
body.enttest-page .page-header,
body.enttest-page .secondary-navigation,
body.enttest-page #page-header,
body.enttest-page .editmode-switch-form {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Strip Moodle wrapper chrome — keep #page padding-top for fixed header */
body.enttest-page #region-main {
    padding: 0 !important;
    border: none !important;
    background: none !important;
    box-shadow: none !important;
}
body.enttest-page #region-main-box {
    padding: 0 !important;
    margin: 0 !important;
}
body.enttest-page #page-content {
    padding: 0 !important;
}
body.enttest-page .rui-main-content {
    max-width: 100% !important;
    padding: 0 !important;
}
body.enttest-page .rui-blocks-wrapper {
    padding: 0 !important;
    margin: 0 !important;
}
body.enttest-page .wrapper-course {
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
}
body.enttest-page .main-content {
    max-width: none !important;
}
body.enttest-page #topofscroll {
    padding: 0 !important;
    margin: 0 !important;
}
body.enttest-page .main-inner {
    padding: 0 !important;
    margin: 0 !important;
}

/* ── App Shell ── */
.enttest-app {
    display: flex;
    min-height: 600px;
    position: relative;
    max-width: 1216px;
    margin: 0 auto;
}

/* ── Sidebar (desktop) ── */
.enttest-sidebar {
    position: sticky;
    top: 65px;
    height: calc(100vh - 65px);
    width: 48px;
    background: #fff;
    border-right: 1px solid #e8eaee;
    display: flex;
    flex-direction: column;
    transition: width 0.25s ease;
    overflow: hidden;
    flex-shrink: 0;
    z-index: 10;
}
.enttest-sidebar-expanded .enttest-sidebar {
    width: 200px;
}

.enttest-sidebar-top {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 12px;
    border-bottom: 1px solid #e8eaee;
    flex-shrink: 0;
    height: 48px;
}

.enttest-sidebar-toggle {
    background: none;
    border: none;
    color: #4a5568;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.enttest-sidebar-toggle:hover {
    background: #f0f2f7;
    color: #4052B5;
}

.enttest-sidebar-title {
    font-size: 13px;
    font-weight: 700;
    color: #4052B5;
    white-space: nowrap;
    overflow: hidden;
    opacity: 0;
    width: 0;
    transition: opacity 0.15s, width 0.25s;
}
.enttest-sidebar-expanded .enttest-sidebar-title {
    opacity: 1;
    width: auto;
}

.enttest-sidebar-menu {
    list-style: none;
    padding: 8px 4px;
    margin: 0;
    flex: 1;
}

.enttest-sidebar-item {
    margin: 2px 0;
}

.enttest-sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: #4a5568;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.enttest-sidebar-link:hover {
    background: #f0f2f7;
    text-decoration: none;
    color: #4052B5;
}

.enttest-sidebar-item.active .enttest-sidebar-link {
    background: #eef0ff;
    color: #4052B5;
}

.enttest-sidebar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.enttest-sidebar-label {
    overflow: hidden;
    opacity: 0;
    width: 0;
    transition: opacity 0.15s, width 0.25s;
}
.enttest-sidebar-expanded .enttest-sidebar-label {
    opacity: 1;
    width: auto;
}

/* ── Sidebar Overlay (mobile) ── */
.enttest-sidebar-overlay {
    display: none;
}

/* ── Horizontal Mobile Nav (hidden on desktop) ── */
.enttest-mobile-nav {
    display: none;
}

/* ── Main Content ── */
.enttest-main {
    flex: 1;
    padding: 24px;
    min-width: 0;
    min-height: 600px;
}

/* ── Dark Theme ── */
body.theme-dark .enttest-sidebar { background: #1a1d2e; border-color: #2a2d44; }
body.theme-dark .enttest-sidebar-top { border-color: #2a2d44; }
body.theme-dark .enttest-sidebar-toggle { color: #a0aec0; }
body.theme-dark .enttest-sidebar-toggle:hover { background: #252840; color: #7b8efc; }
body.theme-dark .enttest-sidebar-title { color: #7b8efc; }
body.theme-dark .enttest-sidebar-link { color: #a0aec0; }
body.theme-dark .enttest-sidebar-link:hover { background: #252840; color: #7b8efc; }
body.theme-dark .enttest-sidebar-item.active .enttest-sidebar-link { background: #252850; color: #7b8efc; }
body.theme-dark .enttest-mobile-nav { background: #1a1d2e; border-color: #2a2d44; }
body.theme-dark .enttest-mobile-nav-item { color: #a0aec0; }
body.theme-dark .enttest-mobile-nav-item:hover { color: #7b8efc; }
body.theme-dark .enttest-mobile-nav-item.active { color: #7b8efc; border-color: #7b8efc; }

/* ── Dark Theme — Footer ── */
body.theme-dark body.enttest-page #s-page-footer,
body.theme-dark body.enttest-page #page-footer {
    background-color: #1a1d2e !important;
    border-color: #2a2d44 !important;
    color: #94a3b8 !important;
}
body.theme-dark body.enttest-page #s-page-footer a,
body.theme-dark body.enttest-page #page-footer a {
    color: #7b8efc !important;
}
body.theme-dark body.enttest-page #s-page-footer a:hover,
body.theme-dark body.enttest-page #page-footer a:hover {
    color: #a0b4fc !important;
}
body.theme-dark body.enttest-page #s-page-footer hr,
body.theme-dark body.enttest-page #page-footer hr {
    border-color: #2a2d44 !important;
}
body.theme-dark body.enttest-page .rui-footer-nav-title {
    color: #e2e8f0 !important;
}
body.theme-dark body.enttest-page .rui-footer-nav-items,
body.theme-dark body.enttest-page .rui-footer-nav-items a {
    color: #94a3b8 !important;
}
body.theme-dark body.enttest-page .rui-footer-nav-items a:hover {
    color: #7b8efc !important;
}
body.theme-dark body.enttest-page .rui-footer-copy,
body.theme-dark body.enttest-page .rui-footer-content {
    color: #64748b !important;
}

/* ── Mobile (<=768px) ── */
@media (max-width: 768px) {
    /* Hide sidebar completely on mobile */
    .enttest-sidebar,
    .enttest-sidebar-overlay {
        display: none !important;
    }

    /* App becomes vertical (nav on top, content below) */
    .enttest-app {
        flex-direction: column;
    }

    /* Show horizontal tab bar */
    .enttest-mobile-nav {
        display: flex;
        gap: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        background: #fff;
        border-bottom: 1px solid #e8eaee;
        position: sticky;
        top: 65px;
        z-index: 10;
        padding: 0 12px;
        scrollbar-width: none;
    }
    .enttest-mobile-nav::-webkit-scrollbar {
        display: none;
    }

    .enttest-mobile-nav-item {
        flex-shrink: 0;
        padding: 12px 16px;
        font-size: 14px;
        font-weight: 500;
        color: #64748b;
        text-decoration: none;
        white-space: nowrap;
        border-bottom: 2px solid transparent;
        transition: color 0.15s, border-color 0.15s;
    }
    .enttest-mobile-nav-item:hover {
        color: #4052B5;
        text-decoration: none;
    }
    .enttest-mobile-nav-item.active {
        color: #4052B5;
        border-bottom-color: #4052B5;
        font-weight: 600;
    }

    .enttest-main {
        padding: 16px;
    }
}

/* ── Tablet (769-1024) ── */
@media (min-width: 769px) and (max-width: 1024px) {
    .enttest-sidebar-expanded .enttest-sidebar { width: 180px; }
}
