/* =========================================
   Proper LD Layout Inside CSUK
========================================= */

.csuk-main {
    position: relative;
    height: 100%;
}

.csuk-main:has(.ld-focus) {
    transform: translateZ(0);
}

.csuk-main .ld-focus {
    position: absolute;
    inset: 0;
}

.ld-focus-main{
    display:block !important;
}

.nt-note-tab {
	margin-bottom: 20px;
    margin-right: 125px;
}

body.ld-in-focus-mode.admin-bar {
    padding-top: 0 !important;
}

@media only screen and (min-width: 783px) {
    body.admin-bar .learndash-wrapper .ld-focus-header {
        top: 0px !important;
    }
}

body.admin-bar .learndash-wrapper .ld-focus-sidebar {
    top: 0px !important;
}

.learndash-wrapper .ld-focus .ld-focus-main .ld-focus-content {
	padding-top: 100px !important;
}

/* =========================================
   Disable CSUK scroll when LD is present
========================================= */

.csuk-main:has(.ld-focus) {
    overflow: hidden !important;
}

.learndash-wrapper .ld-focus .ld-focus-sidebar {
	z-index: 1 !important;
}

/* Rebuild Focus layout INSIDE csuk container */
.csuk-main .ld-focus {
    display: flex;
    flex-direction: column;
}

/* Header natural height */
.csuk-main .ld-focus-header {
    flex-shrink: 0;
}

/* Main row fills remaining space */
.csuk-main .ld-focus-main {
    flex: 1;
    display: flex;
    min-height: 0; /* critical */
}

/* Sidebar fixed width */
.csuk-main .ld-focus-sidebar {
    flex-shrink: 0;
}

/* Make ld-focus fill container */
.csuk-main .ld-focus {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Header natural height */
.csuk-main .ld-focus-header {
    flex-shrink: 0;
}

/* Main area scrolls (like native) */
.csuk-main .ld-focus-main {
    flex: 1;
    display: flex;
    overflow-y: auto;
    min-height: 0; /* critical */
}

/* Sidebar fixed width */
.csuk-main .ld-focus-sidebar {
    flex-shrink: 0;
}

/* Content just fills space */
.csuk-main .ld-focus-content {
    flex: 1;
    min-height: 0;
}

/* Prevent tiny overflow */
.csuk-main .ld-focus-main {
    overflow-y: auto;
    overflow-x: hidden;
}

/* Ensure sidebar never exceeds height */
.csuk-main .ld-focus-sidebar {
    max-height: 100%;
}

/* =========================================
   CORE LAYOUT
========================================= */

.csuk-app {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* TOP BAR */
.csuk-topbar {
    height: 64px;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
	border-bottom: 3px solid var(--csuk-accent);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    flex-shrink: 0;
}

/* BODY AREA */
.csuk-body {
    flex: 1;
    display: flex;
    position: relative;
    overflow: hidden;
}

.csuk-left-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.csuk-interface-logo {
    height: 36px !important;
    width: auto !important;
    object-fit: contain !important;
}

.csuk-logo-text {
    font-weight: 600;
    font-size: 16px;
    color: #1e293b;
}

/* =============================
   USER INFO (Top Right)
============================= */

.csuk-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.csuk-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 2px solid var(--csuk-accent);
}

.csuk-user-name {
    font-weight: 600;
    font-size: 14px;
}


/* =============================
   PLATFORM ICON LINKS (Center)
============================= */

.csuk-platform-links {
    display: flex;
    align-items: center;
    gap: 18px;
}

.csuk-platform-icon img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    border-radius: 50%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.csuk-platform-icon:hover img {
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.15);
}

/* =========================================
   SIDEBAR BASE
========================================= */

.csuk-sidebar::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 2px;
    height: 100%;
    background: var(--csuk-accent);
    opacity: 0.1;
}

.csuk-sidebar {
    width: 72px;
    background: #f1f5f9;
    display: flex;
    flex-direction: column;
    padding-top: 20px;
    transition: width 0.25s ease;
    overflow: hidden;
	align-items: stretch;
    position: relative;
    z-index: 30;
}

/* EXPANDED (hover) OR DOCKED */
.csuk-app.expanded .csuk-sidebar,
.csuk-app.docked .csuk-sidebar {
    width: 240px;
}

.csuk-nav-area {
    position: relative;
    display: flex;
    z-index: 20;
}

.csuk-menu-separator{
    height:1px;
    margin:14px 8px;
    background:linear-gradient(
        to right,
        transparent,
        var(--csuk-accent),
        transparent
    );
    opacity:0.5;
}

/* =========================================
   ICON ROW
========================================= */

.csuk-top-icon {
    height: 60px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.25s ease;
}

.csuk-top-icon:hover {
    background: #e2e8f0;
    transform: translateX(2px);
	border-bottom: 3px solid var(--csuk-accent);
}

.csuk-top-icon.active {
    background: color-mix(in srgb, var(--csuk-accent) 15%, white);
    border-right: 3px solid var(--csuk-accent);
}

.csuk-top-icon.active .csuk-icon-text {
    color: #1e3a8a;
    font-weight: 600;
}

/* COLLAPSED STATE (DEFAULT) */
.csuk-app:not(.expanded):not(.docked) .csuk-top-icon {
    justify-content: flex-start;
    padding: 20px;
}

/* EXPANDED OR DOCKED STATE */
.csuk-app.expanded .csuk-top-icon,
.csuk-app.docked .csuk-top-icon {
    justify-content: flex-start;
    padding: 0 20px;
    gap: 15px;
}

/* =========================================
   ICON
========================================= */

.csuk-menu-icon {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}

.csuk-sidebar ul,
.csuk-sidebar ol {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none;
}

/* =========================================
   TEXT
========================================= */

.csuk-icon-text {
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.15s ease;
    color: #334155; /* slate-700 */
    font-size: 14px;
    font-weight: 500;
}

/* SHOW TEXT WHEN EXPANDED OR DOCKED */
.csuk-app.expanded .csuk-icon-text,
.csuk-app.docked .csuk-icon-text {
    opacity: 1;
}

/* =========================================
   LEVEL 1 PUSH PANEL
========================================= */

.csuk-panel-level-1 {
    width: 0;
    background: #1f2937;
    overflow: hidden;
    transition: width 0.25s ease;
    flex-shrink: 0;
}

.csuk-panel-level-1.active {
    width: 240px;
}

.csuk-panel-level-1 .csuk-slide-link {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* =========================================
   MAIN CONTENT
========================================= */

.csuk-main {
    flex: 1;
    overflow-y: auto;
    background: #f8fafc;
}


/* =========================================
   OVERLAY PANELS (LEVEL 2+)
========================================= */

.csuk-overlay-panel {
    position: absolute;
    top: 0;
    left: 240px;
    width: 260px;
    height: 100%;
    background: #ffffff;
    border-left: 1px solid #e2e8f0;
    box-shadow: -4px 0 12px rgba(0,0,0,0.05);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 5;
    border-left: 1px solid #e2e8f0;
    box-shadow: -8px 0 20px rgba(0,0,0,0.04);
}

.csuk-overlay-panel.active {
    transform: translateX(0);
}

.csuk-overlay-panel .csuk-slide-link {
    padding: 12px 16px;
}

/* =========================================
   LINKS
========================================= */

.csuk-slide-link {
    padding: 10px 12px;
    margin-bottom: 6px;
    color: #334155;
    cursor: pointer;
}

.csuk-slide-link:hover {
    background: #f1f5f9;
	border-bottom: 3px solid var(--csuk-accent);
}


.csuk-parent-header {
    font-weight: 600;
    padding: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: #ffffff;
}

.csuk-parent-header.clickable {
    cursor: pointer;
}

.csuk-parent-header.clickable:hover {
    background: rgba(255,255,255,0.08);
    border-radius: 6px;
}

/* =========================================
   DOCK MODE
========================================= */

.csuk-dock-toggle {
    color: var(--csuk-accent);
    cursor: pointer;
}

.csuk-app.docked .csuk-sidebar {
    width: 240px;
    align-items: flex-start;
    padding-left: 15px;
}

.csuk-app.docked .csuk-top-icon {
    justify-content: flex-start;
    gap: 15px;
}

/* =========================================
   GAMIFICATION ICONS
========================================= */

.csuk-user-gamification{
    display:flex;
    align-items:center;
    gap:16px;
    margin-right:20px;
}

.csuk-gamify-item{
    display:flex;
    align-items:center;
    gap:6px;
    font-weight:600;
    font-size:14px;
}

.csuk-gamify-item img{
    height:26px;
    width:auto;
}

.csuk-rank img{
    height:30px;
}

.csuk-gamify-item span{
    color:#000;
}