/* ==========================================
   SPI PLATFORM
   Premium Sidebar
   Version 1.1.0
========================================== */


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

.spi-sidebar {
    position: fixed;
    z-index: 1000;

    top: 0;
    left: 0;

    width: 270px;
    height: 100vh;

    display: flex;
    flex-direction: column;

    background:
        linear-gradient(
            180deg,
            #ffffff 0%,
            #ffffff 72%,
            #f8fbfa 100%
        );

    border-right:
        1px solid rgba(226, 232, 240, .85);

    box-shadow:
        8px 0 35px rgba(15, 23, 42, .045);

    transition:
        transform .3s cubic-bezier(.4, 0, .2, 1),
        box-shadow .3s ease;

    overflow: hidden;
}


/* subtle premium glow */

.spi-sidebar::after {
    content: "";

    position: absolute;

    top: -120px;
    left: -120px;

    width: 260px;
    height: 260px;

    background:
        radial-gradient(
            circle,
            rgba(34, 197, 94, .07) 0%,
            rgba(14, 165, 233, .035) 35%,
            transparent 70%
        );

    pointer-events: none;
}


/* ==========================================
   HEADER
========================================== */

.spi-sidebar-header {
    position: relative;
    z-index: 2;

    height: 78px;

    padding: 0 22px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom:
        1px solid rgba(226, 232, 240, .8);

    background:
        rgba(255, 255, 255, .88);

    backdrop-filter: blur(12px);
}


/* ==========================================
   BRAND
========================================== */

.spi-brand {
    display: flex;

    align-items: center;

    gap: 11px;

    text-decoration: none;

    color: inherit;

    transition:
        transform .25s ease;
}

.spi-brand:hover {
    transform: translateX(2px);
}


/* ==========================================
   BRAND LOGO
========================================== */

.spi-brand-logo {
    position: relative;

    width: 40px;
    height: 40px;

    display: flex;

    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 12px;

    background:
        linear-gradient(
            135deg,
            rgba(34, 197, 94, .08),
            rgba(14, 165, 233, .08)
        );

    box-shadow:
        0 6px 18px rgba(15, 23, 42, .04);

    transition:
        transform .3s ease,
        box-shadow .3s ease;
}

.spi-brand:hover .spi-brand-logo {
    transform:
        translateY(-2px)
        rotate(-2deg);

    box-shadow:
        0 10px 24px rgba(34, 197, 94, .12);
}

.spi-brand-logo img {
    width: 100%;
    height: 100%;

    padding: 3px;

    object-fit: contain;
}


/* ==========================================
   BRAND TEXT
========================================== */

.spi-brand-text {
    display: flex;

    flex-direction: column;

    line-height: 1.1;
}

.spi-brand-text strong {
    font-size: 20px;

    font-weight: 800;

    letter-spacing: -.4px;

    color: #0f172a;
}

.spi-brand-text span {
    margin-top: 4px;

    font-size: 10px;

    color: #94a3b8;

    font-weight: 600;

    letter-spacing: .65px;

    text-transform: uppercase;
}


/* ==========================================
   CLOSE BUTTON
========================================== */

.spi-sidebar-close {
    display: none;

    width: 34px;
    height: 34px;

    border: 1px solid #e2e8f0;

    border-radius: 10px;

    background: #ffffff;

    color: #64748b;

    cursor: pointer;

    font-size: 20px;

    line-height: 1;

    transition:
        color .2s ease,
        background .2s ease,
        border-color .2s ease,
        transform .2s ease;
}

.spi-sidebar-close:hover {
    color: #ef4444;

    background: #fff7f7;

    border-color: #fecaca;

    transform: rotate(90deg);
}


/* ==========================================
   USER PROFILE
========================================== */

.spi-sidebar-user {
    position: relative;
    z-index: 2;

    margin: 18px 18px 20px;

    padding: 14px;

    display: flex;

    align-items: center;

    gap: 12px;

    border:
        1px solid rgba(226, 232, 240, .75);

    border-radius: 16px;

    background:
        linear-gradient(
            135deg,
            #f8fafc 0%,
            #f8fffb 100%
        );

    box-shadow:
        0 5px 20px rgba(15, 23, 42, .035);

    transition:
        transform .25s ease,
        box-shadow .25s ease,
        border-color .25s ease;
}

.spi-sidebar-user:hover {
    transform: translateY(-2px);

    border-color:
        rgba(34, 197, 94, .18);

    box-shadow:
        0 10px 25px rgba(15, 23, 42, .06);
}


/* ==========================================
   AVATAR
========================================== */

.spi-user-avatar,
.spi-navbar-avatar {
    position: relative;

    width: 42px;
    height: 42px;

    flex-shrink: 0;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 13px;

    background:
        linear-gradient(
            135deg,
            #22c55e 0%,
            #14b8a6 45%,
            #0ea5e9 100%
        );

    color: #ffffff;

    font-size: 14px;

    font-weight: 800;

    box-shadow:
        0 6px 16px rgba(34, 197, 94, .18);

    overflow: hidden;
}


/* avatar shine */

.spi-user-avatar::after,
.spi-navbar-avatar::after {
    content: "";

    position: absolute;

    top: -40%;
    left: -30%;

    width: 80%;
    height: 180%;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255,255,255,.25),
            transparent
        );

    transform: rotate(25deg);

    transition:
        left .5s ease;
}

.spi-sidebar-user:hover .spi-user-avatar::after {
    left: 120%;
}


/* ==========================================
   USER INFORMATION
========================================== */

.spi-user-info {
    min-width: 0;

    display: flex;

    flex-direction: column;

    gap: 2px;
}

.spi-user-info strong {
    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

    font-size: 12px;

    color: #1e293b;

    font-weight: 700;
}

.spi-user-info span {
    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

    font-size: 10px;

    color: #94a3b8;

    font-weight: 500;
}


/* ==========================================
   NAVIGATION
========================================== */

.spi-sidebar-nav {
    position: relative;
    z-index: 2;

    flex: 1;

    padding: 2px 14px 20px;

    overflow-y: auto;

    overflow-x: hidden;

    scrollbar-width: thin;

    scrollbar-color:
        #dbe5df
        transparent;
}


/* Chrome / Edge / Safari */

.spi-sidebar-nav::-webkit-scrollbar {
    width: 5px;
}

.spi-sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.spi-sidebar-nav::-webkit-scrollbar-thumb {
    background: #dbe5df;

    border-radius: 20px;
}

.spi-sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: #b8cbbf;
}


/* ==========================================
   NAV SECTION
========================================== */

.spi-nav-section {
    margin-bottom: 22px;
}

.spi-nav-title {
    padding: 0 12px;

    margin-bottom: 8px;

    color: #a0aec0;

    font-size: 9px;

    font-weight: 800;

    letter-spacing: 1.25px;

    text-transform: uppercase;
}


/* ==========================================
   NAV ITEM
========================================== */

.spi-nav-item {
    position: relative;

    min-height: 44px;

    margin-bottom: 4px;

    padding: 0 12px;

    display: flex;

    align-items: center;

    gap: 12px;

    border:
        1px solid transparent;

    border-radius: 12px;

    color: #64748b;

    text-decoration: none;

    font-size: 13px;

    font-weight: 550;

    overflow: hidden;

    transition:
        background .25s ease,
        color .25s ease,
        border-color .25s ease,
        transform .25s ease,
        box-shadow .25s ease;
}


/* hover background glow */

.spi-nav-item::after {
    content: "";

    position: absolute;

    inset: 0;

    background:
        linear-gradient(
            90deg,
            rgba(34, 197, 94, .04),
            rgba(14, 165, 233, .025)
        );

    opacity: 0;

    transition:
        opacity .25s ease;

    pointer-events: none;
}

.spi-nav-item:hover::after {
    opacity: 1;
}

.spi-nav-item:hover {
    color: #1e293b;

    background: #f8fafc;

    border-color:
        rgba(226, 232, 240, .7);

    transform: translateX(2px);
}


/* ==========================================
   ACTIVE ITEM
========================================== */

.spi-nav-item.active {
    color: #15803d;

    background:
        linear-gradient(
            100deg,
            rgba(240, 253, 244, .95),
            rgba(236, 253, 245, .82)
        );

    border-color:
        rgba(34, 197, 94, .12);

    font-weight: 700;

    box-shadow:
        0 5px 18px rgba(34, 197, 94, .055);
}


/* active left indicator */

.spi-nav-item.active::before {
    content: "";

    position: absolute;

    left: 0;

    top: 8px;

    bottom: 8px;

    width: 3px;

    border-radius: 0 8px 8px 0;

    background:
        linear-gradient(
            180deg,
            #22c55e,
            #14b8a6
        );

    box-shadow:
        0 0 10px rgba(34, 197, 94, .28);

    animation:
        spiActiveIndicator .35s ease;
}


/* ==========================================
   NAV ICON
========================================== */

.spi-nav-icon {
    position: relative;
    z-index: 1;

    width: 22px;
    height: 22px;

    display: flex;

    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    font-size: 15px;

    transition:
        transform .25s ease,
        color .25s ease;
}

.spi-nav-item:hover .spi-nav-icon {
    transform:
        translateX(1px)
        scale(1.06);
}

.spi-nav-item.active .spi-nav-icon {
    color: #16a34a;

    transform: scale(1.04);
}

.spi-nav-icon svg {
    width: 18px;
    height: 18px;

    fill: currentColor;

    transition:
        transform .25s ease;
}

.spi-nav-item:hover .spi-nav-icon svg {
    transform: scale(1.08);
}


/* ==========================================
   NAV LABEL
========================================== */

.spi-nav-label {
    position: relative;
    z-index: 1;

    flex: 1;

    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;
}


/* ==========================================
   FOOTER
========================================== */

.spi-sidebar-footer {
    position: relative;
    z-index: 2;

    padding: 16px 20px;

    border-top:
        1px solid rgba(226, 232, 240, .8);

    background:
        rgba(255, 255, 255, .82);

    backdrop-filter: blur(10px);
}

.spi-sidebar-version {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 10px;

    font-size: 10px;

    color: #94a3b8;
}

.spi-sidebar-version span {
    color: #cbd5e1;

    font-weight: 500;
}


/* ==========================================
   OVERLAY
========================================== */

.spi-sidebar-overlay {
    display: none;

    position: fixed;

    z-index: 900;

    inset: 0;

    background:
        rgba(15, 23, 42, .32);

    backdrop-filter:
        blur(4px);

    -webkit-backdrop-filter:
        blur(4px);

    opacity: 0;

    transition:
        opacity .25s ease;
}

.spi-sidebar-overlay.active {
    display: block;

    opacity: 1;
}


/* ==========================================
   ANIMATION
========================================== */

@keyframes spiActiveIndicator {

    from {
        opacity: 0;

        transform:
            scaleY(.4);
    }

    to {
        opacity: 1;

        transform:
            scaleY(1);
    }

}


/* ==========================================
   TABLET
========================================== */

@media (max-width: 1100px) {

    .spi-sidebar {
        width: 250px;
    }

    .spi-sidebar-header {
        padding: 0 19px;
    }

}


/* ==========================================
   MOBILE
========================================== */

@media (max-width: 900px) {

    .spi-sidebar {
        width: 275px;

        transform:
            translateX(-105%);

        box-shadow:
            15px 0 45px rgba(15, 23, 42, .15);
    }

    .spi-sidebar.open {
        transform:
            translateX(0);
    }

    .spi-sidebar-close {
        display: flex;

        align-items: center;
        justify-content: center;
    }

    .spi-sidebar-overlay.active {
        display: block;
    }

}


/* ==========================================
   SMALL MOBILE
========================================== */

@media (max-width: 480px) {

    .spi-sidebar {
        width: min(88vw, 300px);
    }

    .spi-sidebar-header {
        height: 72px;

        padding:
            0 17px;
    }

    .spi-sidebar-user {
        margin:
            15px 15px 18px;

        padding: 13px;
    }

    .spi-sidebar-nav {
        padding-left: 12px;
        padding-right: 12px;
    }

    .spi-nav-item {
        min-height: 45px;

        padding-left: 11px;
        padding-right: 11px;
    }

    .spi-sidebar-footer {
        padding:
            14px 17px;
    }

}


/* ==========================================
   REDUCED MOTION
========================================== */

@media (prefers-reduced-motion: reduce) {

    .spi-sidebar,
    .spi-brand,
    .spi-brand-logo,
    .spi-sidebar-user,
    .spi-nav-item,
    .spi-nav-icon,
    .spi-nav-icon svg,
    .spi-sidebar-close {
        transition: none !important;
    }

    .spi-nav-item.active::before {
        animation: none !important;
    }

}