/* ==========================================================
 * Genealogic App Shell
 * Top bar + Sidebar layout for all pages
 * ======================================================== */

:root {
    --glp-topbar-height: 60px;
    --glp-sidebar-width: 260px;
    --glp-sidebar-collapsed: 64px;
    --glp-shell-font: 'Plus Jakarta Sans', sans-serif;
    --glp-shell-bg: #fafbfc;
    --glp-shell-border: #f0f0f0;
    --glp-shell-text: #1a1a2e;
    --glp-shell-text-muted: #8492a6;
    --glp-shell-brand: #D74709;
    --glp-shell-white: #ffffff;
    --glp-shell-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================
 * BODY LAYOUT
 * ======================================================== */

body.glp-has-shell.glp-logged-in {
    padding-top: var(--glp-topbar-height);
    padding-left: var(--glp-sidebar-width);
    transition: padding-left var(--glp-shell-transition);
    min-height: 100vh;
}

body.glp-has-shell.glp-logged-out {
    padding-top: var(--glp-topbar-height);
}

body.glp-has-shell.glp-sidebar-closed {
    padding-left: var(--glp-sidebar-collapsed);
}

/* ==========================================================
 * TOP BAR — starts after sidebar
 * ======================================================== */

.glp-topbar {
    position: fixed;
    top: 0;
    left: var(--glp-sidebar-width);
    right: 0;
    height: var(--glp-topbar-height);
    display: flex;
    align-items: center;
    padding: 0 20px 0 10px;
    background: var(--glp-shell-white);
    border-bottom: 1px solid var(--glp-shell-border);
    z-index: 1000;
    font-family: var(--glp-shell-font);
    box-sizing: border-box;
    gap: 16px;
    transition: left var(--glp-shell-transition);
}

/* Topbar shifts when sidebar collapses */
body.glp-sidebar-closed .glp-topbar {
    left: var(--glp-sidebar-collapsed);
}

/* Guest topbar: full width */
.glp-shell-guest .glp-topbar {
    left: 0;
}

/* Hide topbar search on homepage for guests (page has its own hero search) */
body.glp-logged-out.glp-is-home .glp-topbar-search {
    display: none;
}
/* On homepage without search, push actions to the right */
body.glp-logged-out.glp-is-home .glp-topbar-left {
    flex: 1;
}

/* Guest topbar logo — same sizes as logged-in sidebar */
.glp-shell-guest .glp-topbar-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.glp-shell-guest .glp-topbar-logo img {
    display: none;
}
.glp-shell-guest .glp-topbar-logo .glp-topbar-logo-full {
    display: block;
    height: 26px;
    width: auto;
    max-height: 26px;
}
.glp-shell-guest .glp-topbar-logo .glp-topbar-logo-icon {
    display: none !important;
    height: 18px;
    width: auto;
    max-height: 18px;
}

/* Mobile hamburger in topbar (hidden on desktop) */
.glp-topbar-hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--glp-shell-text-muted);
    font-size: 18px;
    cursor: pointer;
    border-radius: 8px;
    padding: 0;
    flex-shrink: 0;
}
.glp-topbar-hamburger:hover {
    color: var(--glp-shell-text);
}

/* Search — full width, equal spacing all around */
.glp-topbar-search {
    flex: 1;
    min-width: 100px;
    display: flex;
    align-items: center;
    padding: 10px 0;
}
.glp-topbar-search .dog-search-container {
    width: 100%;
    margin: 0;
    display: block;
}
.glp-topbar-search .dog-search-container input {
    width: 100%;
    box-sizing: border-box;
    height: 40px;
    padding: 0 18px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    font-family: var(--glp-shell-font);
    font-size: 15px;
    outline: none;
    background: var(--glp-shell-white);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.glp-topbar-search .dog-search-container input:focus {
    border-color: var(--glp-shell-brand);
    box-shadow: 0 0 0 3px rgba(215, 71, 9, 0.08);
}

/* Right actions */
.glp-topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Bell */
.glp-topbar-bell {
    position: relative;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #f9f9f9;
    border: 1px solid var(--glp-shell-border);
    color: #666;
    font-size: 17px;
    cursor: pointer;
    transition: background 0.2s;
}
.glp-topbar-bell:hover {
    background: #f0f0f0;
}

/* Badge */
.glp-topbar-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #E74C3C;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    line-height: 1;
    padding: 4px;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Avatar */
.glp-topbar-avatar {
    display: flex;
    text-decoration: none;
}
.glp-topbar-avatar img {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    object-fit: cover;
    display: block;
    background: #eee;
}

/* Guest buttons */
.glp-topbar-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    border-radius: 8px;
    font-family: var(--glp-shell-font);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    white-space: nowrap;
    cursor: pointer;
    line-height: 1.4;
}
.glp-topbar-btn-outline {
    color: var(--glp-shell-text);
    background: transparent;
    border: 1px solid #ddd;
}
.glp-topbar-btn-outline:hover {
    background: #f5f5f5;
    border-color: #ccc;
    color: var(--glp-shell-text);
    text-decoration: none;
}
.glp-topbar-btn-primary {
    color: #fff;
    background: var(--glp-shell-brand);
    border: 1px solid var(--glp-shell-brand);
}
.glp-topbar-btn-primary:hover {
    background: #c03f07;
    border-color: #c03f07;
    color: #fff;
    text-decoration: none;
}

/* ==========================================================
 * SIDEBAR
 * ======================================================== */

.glp-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--glp-sidebar-width);
    background: var(--glp-shell-bg);
    border-right: 1px solid var(--glp-shell-border);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1001;
    transition: width var(--glp-shell-transition);
    font-family: var(--glp-shell-font);
    display: flex;
    flex-direction: column;
}

/* Scrollbar */
.glp-sidebar::-webkit-scrollbar {
    width: 4px;
}
.glp-sidebar::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 4px;
}

/* --- Sidebar Header: Logo + Toggle --- */
.glp-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    height: var(--glp-topbar-height);
    flex-shrink: 0;
    border-bottom: 1px solid var(--glp-shell-border);
}
.glp-sidebar-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
    overflow: hidden;
}
.glp-sidebar-logo .glp-logo-full {
    height: 26px;
    width: auto;
    display: block;
}
.glp-sidebar-logo .glp-logo-icon {
    height: 18px;
    width: auto;
    display: none;
}
/* (toggle button is now .glp-nav-toggle-item inside nav) */

/* Nav container */
.glp-sidebar .glp-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 10px;
    flex: 1;
    overflow-y: auto;
}

/* --- Menu item --- */
.glp-sidebar-nav .glp-menu-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    text-decoration: none;
    color: var(--glp-shell-text-muted);
    font-size: 14px;
    font-weight: 500;
    border-radius: 10px;
    transition: background 0.15s ease, color 0.15s ease;
    cursor: pointer;
    user-select: none;
    line-height: 1.4;
    background: transparent;
    border: none;
    box-shadow: none;
    width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
}
.glp-sidebar-nav .glp-menu-item:hover {
    background: var(--glp-shell-white);
    color: var(--glp-shell-text);
    text-decoration: none;
}
.glp-sidebar-nav .glp-menu-item.active {
    background: var(--glp-shell-white);
    color: var(--glp-shell-text);
    font-weight: 600;
}

/* Nav toggle: always visible, right-aligned when open, centered when collapsed */
.glp-nav-toggle-item {
    display: flex;
    justify-content: flex-end;
}
.glp-nav-toggle-item:hover,
.glp-nav-toggle-item:focus,
.glp-nav-toggle-item:active {
    background: transparent !important;
}
.glp-nav-toggle-item .glp-menu-icon {
    margin-right: 0;
}
body.glp-sidebar-closed .glp-nav-toggle-item {
    justify-content: center;
}

/* --- Icon --- */
.glp-sidebar-nav .glp-menu-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
    font-size: 15px;
    color: inherit;
}
.glp-sidebar-nav .glp-menu-item.active .glp-menu-icon {
    color: var(--glp-shell-brand);
}

/* --- Text --- */
.glp-sidebar-nav .glp-menu-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.25s ease, width 0.25s ease;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
}

/* --- Arrow for submenus --- */
.glp-sidebar-nav .glp-menu-arrow {
    margin-left: auto;
    font-size: 10px;
    color: var(--glp-shell-text-muted);
    transition: transform 0.2s ease, opacity 0.25s ease;
    display: flex;
    align-items: center;
}
.glp-menu-group.is-open > .glp-menu-toggle .glp-menu-arrow {
    transform: rotate(180deg);
}

/* --- Submenu --- */
.glp-sidebar-nav .glp-submenu {
    display: none;
    flex-direction: column;
    gap: 1px;
    padding: 4px 0;
}
.glp-menu-group.is-open > .glp-submenu {
    display: flex;
}

.glp-sidebar-nav .glp-submenu-item {
    display: flex;
    align-items: center;
    padding: 8px 14px 8px 46px;
    text-decoration: none;
    color: var(--glp-shell-text-muted);
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    transition: background 0.15s ease, color 0.15s ease;
    position: relative;
    background: transparent;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
}
.glp-sidebar-nav .glp-submenu-item::before {
    content: '';
    position: absolute;
    left: 23px;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #e0e0e0;
    transition: background 0.15s ease;
}
.glp-sidebar-nav .glp-submenu-item:hover {
    background: var(--glp-shell-white);
    color: var(--glp-shell-text);
    text-decoration: none;
}
.glp-sidebar-nav .glp-submenu-item.active {
    color: var(--glp-shell-text);
    font-weight: 600;
}
.glp-sidebar-nav .glp-submenu-item.active::before {
    background: var(--glp-shell-brand);
}

/* --- Separator --- */
.glp-sidebar-nav .glp-menu-separator {
    height: 1px;
    background: var(--glp-shell-border);
    margin: 6px 14px;
}

/* ==========================================================
 * SIDEBAR FOOTER — User card + Logout
 * ======================================================== */

.glp-sidebar-footer {
    padding: 10px;
    border-top: 1px solid var(--glp-shell-border);
    flex-shrink: 0;
}

.glp-user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--glp-shell-border);
    background: var(--glp-shell-white);
    transition: border-color 0.15s ease;
}
.glp-user-card:hover {
    border-color: #ddd;
}

/* Avatar */
.glp-user-card-avatar {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    background: #eee;
}

/* User info */
.glp-user-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow: hidden;
    transition: opacity 0.25s ease, width 0.25s ease;
}
.glp-user-card-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--glp-shell-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.glp-user-card-email {
    font-size: 11px;
    font-weight: 400;
    color: var(--glp-shell-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* Logout icon button */
.glp-user-card-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    flex-shrink: 0;
    color: var(--glp-shell-text-muted);
    background: transparent;
    text-decoration: none;
    transition: all 0.15s ease;
    font-size: 14px;
}
.glp-user-card-logout:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
}

/* ==========================================================
 * SIDEBAR COLLAPSED STATE (desktop)
 * ======================================================== */

body.glp-sidebar-closed .glp-sidebar {
    width: var(--glp-sidebar-collapsed);
}

/* Sidebar header collapsed: just icon logo centered */
body.glp-sidebar-closed .glp-sidebar-header {
    justify-content: center;
    padding: 0 8px;
}
body.glp-sidebar-closed .glp-sidebar-logo .glp-logo-full {
    display: none;
}
body.glp-sidebar-closed .glp-sidebar-logo .glp-logo-icon {
    display: block;
}
/* toggle is now .glp-nav-toggle-item in nav */

body.glp-sidebar-closed .glp-sidebar-nav .glp-menu-text,
body.glp-sidebar-closed .glp-sidebar-nav .glp-menu-arrow {
    opacity: 0;
    width: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

body.glp-sidebar-closed .glp-sidebar-nav .glp-menu-icon {
    margin-right: 0;
}

body.glp-sidebar-closed .glp-sidebar-nav .glp-menu-item {
    justify-content: center;
    padding: 12px;
}

body.glp-sidebar-closed .glp-sidebar-nav .glp-submenu {
    display: none;
}

body.glp-sidebar-closed .glp-sidebar-nav .glp-menu-separator {
    margin: 6px 8px;
}

/* Tooltip on hover when collapsed */
body.glp-sidebar-closed .glp-sidebar-nav .glp-menu-item {
    position: relative;
}
body.glp-sidebar-closed .glp-sidebar-nav .glp-menu-item[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--glp-shell-text);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 1001;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* User card collapsed: only avatar, centered */
body.glp-sidebar-closed .glp-sidebar-footer {
    padding: 8px;
}
body.glp-sidebar-closed .glp-user-card {
    justify-content: center;
    padding: 8px;
    border: none;
    background: transparent;
    gap: 0;
}
body.glp-sidebar-closed .glp-user-card-info {
    display: none;
}
body.glp-sidebar-closed .glp-user-card-logout {
    display: none;
}
body.glp-sidebar-closed .glp-user-card-avatar {
    width: 34px;
    height: 34px;
    cursor: default;
}

/* Sidebar overlay (mobile) */
.glp-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    cursor: pointer;
    backdrop-filter: blur(2px);
}

/* ==========================================================
 * NOTIFICATIONS SIDEBAR
 * ======================================================== */

.glp-notifications-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    max-width: 100%;
    height: 100%;
    background: var(--glp-shell-white);
    box-shadow: -4px 0 25px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    transform: translateX(100%);
    transition: transform var(--glp-shell-transition);
    overflow-y: auto;
    font-family: var(--glp-shell-font);
}
.glp-notifications-sidebar.is-open {
    transform: translateX(0);
}

.glp-notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--glp-shell-border);
    position: sticky;
    top: 0;
    background: var(--glp-shell-white);
    z-index: 20;
}
.glp-notifications-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #111;
}
.glp-notifications-close {
    background: #f5f5f5;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #555;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
    padding: 0;
}
.glp-notifications-close:hover {
    background: #e5e5e5;
    color: #111;
}

.glp-notifications-content {
    padding: 0;
}

.glp-notifications-empty {
    padding: 40px 20px;
    text-align: center;
    color: #888;
}
.glp-notifications-empty i {
    font-size: 40px;
    margin-bottom: 15px;
    opacity: 0.5;
    display: block;
}
.glp-notifications-empty p {
    font-size: 15px;
    margin: 0;
}

/* Notification items */
.glp-notifications-content .notification-item {
    display: flex;
    align-items: flex-start;
    padding: 20px 25px;
    border-bottom: 1px solid #f5f5f5;
    text-decoration: none;
    color: #333;
    transition: background 0.2s;
    position: relative;
    gap: 15px;
}
.glp-notifications-content .notification-item:hover {
    background: #fafafa;
}
.glp-notifications-content .notification-item.unread {
    background: #f4f9ff;
}
.glp-notifications-content .notification-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #017DFA;
}

/* Notifications overlay */
.glp-notifications-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1999;
    cursor: pointer;
    backdrop-filter: blur(2px);
}

/* ==========================================================
 * RESPONSIVE: TABLET (<=1024px)
 * ======================================================== */

@media (max-width: 1024px) {
    body.glp-has-shell.glp-logged-in {
        padding-left: 0;
    }
    body.glp-has-shell.glp-sidebar-closed {
        padding-left: 0;
    }

    /* Topbar full width on mobile */
    .glp-topbar {
        left: 0;
    }
    body.glp-sidebar-closed .glp-topbar {
        left: 0;
    }

    /* Show hamburger on mobile */
    .glp-topbar-hamburger {
        display: flex;
    }

    .glp-sidebar {
        width: var(--glp-sidebar-width);
        transform: translateX(-100%);
        box-shadow: none;
        transition: transform var(--glp-shell-transition);
    }

    body.glp-sidebar-mobile-open .glp-sidebar {
        transform: translateX(0);
        box-shadow: 4px 0 25px rgba(0, 0, 0, 0.15);
    }
    body.glp-sidebar-mobile-open .glp-sidebar-overlay {
        display: block;
    }

    /* Reset collapsed styles on mobile */
    body.glp-sidebar-closed .glp-sidebar-nav .glp-menu-text,
    body.glp-sidebar-closed .glp-sidebar-nav .glp-menu-arrow {
        opacity: 1;
        width: auto;
    }
    body.glp-sidebar-closed .glp-sidebar-nav .glp-menu-icon {
        margin-right: 12px;
    }
    body.glp-sidebar-closed .glp-sidebar-nav .glp-menu-item {
        justify-content: flex-start;
        padding: 10px 14px;
    }
    body.glp-sidebar-closed .glp-sidebar {
        width: var(--glp-sidebar-width);
    }

    /* Sidebar header: show full logo on mobile */
    body.glp-sidebar-closed .glp-sidebar-header {
        justify-content: center;
        padding: 0 14px;
    }
    body.glp-sidebar-closed .glp-sidebar-logo .glp-logo-full {
        display: block;
    }
    body.glp-sidebar-closed .glp-sidebar-logo .glp-logo-icon {
        display: none;
    }

    /* Nav toggle: left-aligned on mobile (not right) */
    body.glp-sidebar-closed .glp-nav-toggle-item {
        justify-content: flex-end;
    }

    /* User card full on mobile */
    body.glp-sidebar-closed .glp-user-card {
        justify-content: flex-start;
        padding: 10px 12px;
        border: 1px solid var(--glp-shell-border);
        background: var(--glp-shell-white);
        gap: 10px;
    }
    body.glp-sidebar-closed .glp-user-card-info {
        display: flex;
    }
    body.glp-sidebar-closed .glp-user-card-logout {
        display: flex;
    }
}

/* ==========================================================
 * RESPONSIVE: MOBILE (<=768px)
 * ======================================================== */

@media (max-width: 768px) {
    .glp-topbar-search {
        display: none;
    }

    .glp-topbar {
        padding: 0 14px;
        gap: 10px;
    }

    .glp-sidebar {
        width: 85%;
        max-width: 320px;
    }

    .glp-notifications-sidebar {
        width: 100%;
    }

    .glp-topbar-btn {
        padding: 7px 14px;
        font-size: 13px;
    }

    /* Mobile: swap full logo for icon */
    .glp-shell-guest .glp-topbar-logo .glp-topbar-logo-full {
        display: none !important;
    }
    .glp-shell-guest .glp-topbar-logo .glp-topbar-logo-icon {
        display: block !important;
    }
}

/* ==========================================================
 * DARK MODE TOGGLE (switch in sidebar)
 * ======================================================== */

.glp-darkmode-item {
    cursor: pointer;
}
.glp-darkmode-item:hover {
    background: transparent;
}

/* Guest dark mode toggle in topbar */
.glp-topbar-darkmode {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #f9f9f9;
    border: 1px solid var(--glp-shell-border);
    color: #666;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.glp-topbar-darkmode:hover {
    background: #f0f0f0;
}
body.glp-dark-mode .glp-topbar-darkmode {
    background: #1a1a2e;
    border-color: #2a2a3e;
    color: #fbbf24;
}
body.glp-dark-mode .glp-topbar-darkmode:hover {
    background: #2a2a3e;
}
.glp-darkmode-icon {
    color: var(--glp-shell-text-muted);
    font-size: 16px;
}

/* Switch — pill toggle */
.glp-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.glp-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.glp-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #d1d5db;
    border-radius: 24px;
    transition: background 0.3s ease;
}
.glp-switch-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.glp-switch input:checked + .glp-switch-slider {
    background: var(--glp-shell-brand);
}
.glp-switch input:checked + .glp-switch-slider::before {
    transform: translateX(20px);
}

/* Collapsed: hide switch, show only icon */
body.glp-sidebar-closed .glp-darkmode-item .glp-menu-text {
    display: none;
}

/* ==========================================================
 * Floating controls — respect sidebar width
 * ======================================================== */

body.glp-has-shell.glp-logged-in .glp-floating-controls {
    left: calc(var(--glp-sidebar-width) + 10px);
    transition: left var(--glp-shell-transition);
}
body.glp-has-shell.glp-sidebar-closed .glp-floating-controls {
    left: calc(var(--glp-sidebar-collapsed) + 10px);
}

@media (max-width: 1024px) {
    body.glp-has-shell.glp-logged-in .glp-floating-controls,
    body.glp-has-shell.glp-sidebar-closed .glp-floating-controls {
        left: 10px;
    }
}

/* Ensure fab buttons have white bg + border in light mode */
body.glp-has-shell .glp-fab,
body.glp-has-shell .fab-orange,
body.glp-has-shell .fab-black,
body.glp-has-shell .fab-white {
    background-color: #fff;
    border: 1px solid #e8ecf1;
}

/* Dark mode styles are in dark-mode.css */
