/* Navbar Styles */
.navbar {
    position: fixed;
    left: 20px;
    top: 32px; /* Start below titlebar */
    width: 68px;
    height: calc(100vh - 64px); /* Account for titlebar and bottom padding */
    max-height: calc(100vh - 64px);
    background: rgba(15, 8, 32, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 40px;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                background 0.3s ease,
                border 0.3s ease;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.3) transparent;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    padding: 15px 0;
}

/* Unique Navbar Scrollbar (Slider) */
.navbar::-webkit-scrollbar {
    width: 4px;
    display: block; /* Show it but make it pretty */
}

.navbar::-webkit-scrollbar-track {
    background: transparent;
    margin: 20px 0;
}

.navbar::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, transparent, #8b5cf6, transparent);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.navbar:hover::-webkit-scrollbar-thumb {
    opacity: 1;
}

.navbar:hover {
    width: 220px;
    background: rgba(15, 8, 32, 0.7);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.navbar-brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 20px;
    height: 50px;
    margin-bottom: 20px;
    position: relative;
    gap: 15px;
}

.brand-icon {
    font-size: 1.6rem;
    color: #8b5cf6;
    filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.5));
    transition: transform 0.3s ease;
    min-width: 26px;
    display: flex;
    justify-content: center;
}

.brand-name-nav {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    background: linear-gradient(to right, #fff, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar:hover .brand-name-nav {
    opacity: 1;
    transform: translateX(0);
}

.navbar:hover .brand-icon {
    transform: scale(1.1);
}

.navbar-menu {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.nav-item {
    width: 100%;
    padding: 0 10px;
}

.nav-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: transparent;
    border: none;
    color: rgba(167, 139, 250, 0.7);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    font-weight: 500;
    text-align: left;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.nav-btn:hover {
    background: rgba(139, 92, 246, 0.15);
    color: #fff;
    transform: translateX(5px);
}

.nav-item.active .nav-btn {
    background: rgba(139, 92, 246, 0.25);
    color: #fff;
    box-shadow: inset 0 0 10px rgba(139, 92, 246, 0.2);
}

.nav-item.active .nav-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 25%;
    height: 50%;
    width: 4px;
    background: #8b5cf6;
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 10px #8b5cf6;
}

.nav-icon {
    min-width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.nav-icon svg {
    width: 22px;
    height: 22px;
    display: block;
}

.nav-btn:hover .nav-icon {
    transform: scale(1.1);
}

.nav-label {
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.navbar:hover .nav-label {
    opacity: 1;
    transform: translateX(0);
}

/* Context Menu - Enhanced */
.context-menu {
    position: fixed;
    background: rgba(15, 8, 32, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 16px;
    padding: 12px 0;
    min-width: 260px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: none;
    animation: menuFadeIn 0.2s ease-out;
}

@keyframes menuFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.context-menu-header {
    padding: 8px 20px 15px;
    font-size: 0.85rem;
    color: #8b5cf6;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
    margin-bottom: 8px;
}

.context-menu-layout {
    padding: 10px 14px 14px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
    margin-bottom: 8px;
}

.context-menu-layout-title {
    font-size: 0.75rem;
    color: rgba(167, 139, 250, 0.75);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}

.context-menu-layout-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.context-layout-btn {
    border: 1px solid rgba(139, 92, 246, 0.25);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(216, 204, 255, 0.8);
    border-radius: 12px;
    padding: 9px 10px;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border 0.2s ease, box-shadow 0.2s ease;
}

.context-layout-btn:hover,
.context-layout-btn.active {
    background: rgba(139, 92, 246, 0.28);
    border-color: rgba(167, 139, 250, 0.7);
    color: #fff;
    box-shadow: 0 0 18px rgba(139, 92, 246, 0.22);
}

.context-menu-list {
    list-style: none;
    max-height: 450px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.3) transparent;
}

.context-menu-list::-webkit-scrollbar {
    width: 4px;
}

.context-menu-list::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3);
    border-radius: 10px;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: rgba(167, 139, 250, 0.8);
    cursor: pointer;
    transition: all 0.2s ease;
}

.context-menu-item:hover {
    background: rgba(139, 92, 246, 0.15);
    color: #fff;
}

.context-menu-icon {
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.context-menu-item:hover .context-menu-icon {
    opacity: 1;
}

.context-menu-icon svg {
    width: 18px;
    height: 18px;
}

.context-menu-label {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
}

.context-menu-check {
    font-size: 1.1rem;
    color: #8b5cf6;
    min-width: 20px;
    text-align: right;
    text-shadow: 0 0 8px rgba(139, 92, 246, 0.5);
}

@media (max-width: 768px) {
    .navbar {
        left: 10px;
        width: 60px;
    }
    
    .navbar:hover {
        width: 180px;
    }
}

body.nav-layout-top .navbar {
    left: 0;
    top: 32px;
    width: 100%;
    height: 72px;
    max-height: 72px;
    border-radius: 0;
    padding: 0 24px;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    align-items: center;
    gap: 18px;
    background: rgba(7, 2, 16, 0.82);
    border-left: 0;
    border-right: 0;
    border-top: 0;
    border-bottom: 1px solid rgba(139, 92, 246, 0.28);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45), 0 0 24px rgba(139, 92, 246, 0.16);
    transition: background 0.3s ease, border 0.3s ease;
}

body.nav-layout-top .navbar:hover {
    width: 100%;
    background: rgba(7, 2, 16, 0.9);
    border-bottom-color: rgba(167, 139, 250, 0.42);
}

body.nav-layout-top .navbar::-webkit-scrollbar {
    height: 4px;
    width: auto;
}

body.nav-layout-top .navbar::-webkit-scrollbar-track {
    margin: 0 28px;
}

body.nav-layout-top .navbar::-webkit-scrollbar-thumb {
    background: linear-gradient(to right, transparent, #8b5cf6, transparent);
}

body.nav-layout-top .navbar-brand {
    flex: 0 0 auto;
    height: 100%;
    margin: 0 10px 0 0;
    padding-left: 0;
    padding-right: 10px;
}

body.nav-layout-top .brand-name-nav,
body.nav-layout-top .navbar:hover .brand-name-nav {
    opacity: 1;
    transform: translateX(0);
}

body.nav-layout-top .navbar-menu {
    flex: 1 0 auto;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    height: 100%;
    padding: 0;
}

body.nav-layout-top .nav-item {
    width: auto;
    flex: 0 0 auto;
    padding: 0;
}

body.nav-layout-top .nav-btn {
    width: auto;
    min-width: max-content;
    height: 46px;
    gap: 9px;
    padding: 0 13px;
    border-radius: 16px;
}

body.nav-layout-top .nav-btn:hover {
    transform: translateY(-1px);
}

body.nav-layout-top .nav-label,
body.nav-layout-top .navbar:hover .nav-label {
    opacity: 1;
    transform: translateX(0);
}

body.nav-layout-top .nav-item.active .nav-btn::before {
    left: 16px;
    top: auto;
    bottom: 4px;
    width: calc(100% - 32px);
    height: 3px;
    border-radius: 4px;
}

body.nav-layout-top .main-content {
    padding-left: 0;
    padding-top: 72px;
}

body.nav-layout-top .hero-section {
    width: 100%;
    margin: 0;
    border-radius: 0 0 26px 26px;
}

@media (max-width: 900px) {
    body.nav-layout-top .navbar {
        padding: 0 14px;
    }

    body.nav-layout-top .brand-name-nav {
        display: none;
    }

    body.nav-layout-top .nav-btn {
        padding: 0 11px;
    }
}
