/* ==========================================================================
   BIMOTIX NAVIGATION
   File: assets/css/ui/bimotix-navigation.css

   The global sidebar width is defined in bimotix-theme.css:
   --bx-sidebar-width: 300px;
   ========================================================================== */


/* ==========================================================================
   Sidebar
   ========================================================================== */

.bx-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1000;

    width: var(--bx-sidebar-width);
    height: 100vh;
    height: 100dvh;

    color: var(--bx-text-inverse);

    background:
        radial-gradient(
            circle at 18% 8%,
            rgba(96, 165, 250, 0.18),
            transparent 18rem
        ),
        linear-gradient(
            180deg,
            var(--bx-primary-darker) 0%,
            var(--bx-primary-dark) 52%,
            #102a52 100%
        );

    border-right: 1px solid rgba(255, 255, 255, 0.08);

    box-shadow:
        12px 0 36px rgba(15, 23, 42, 0.16);
}

.bx-sidebar-inner {
    display: flex;
    flex-direction: column;

    width: 100%;
    height: 100%;
    min-height: 0;
}


/* ==========================================================================
   Brand, logo and subtitle
   ========================================================================== */

.bx-sidebar-brand {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    width: 100%;
    padding: 1.35rem 1.25rem 1.15rem;

    text-align: center;

    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bx-sidebar-brand-link {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;

    color: inherit;
    text-decoration: none;
}

.bx-sidebar-brand-link:hover {
    color: inherit;
}

.bx-sidebar-logo {
    display: block;

    width: min(100%, 210px);
    height: auto;
    margin: 0 auto;
}

.bx-sidebar-product {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;

    width: 100%;
    margin-top: 0.9rem;
}

.bx-sidebar-product strong {
    color: #ffffff;

    font-size: 1rem;
    font-weight: var(--bx-font-weight-bold);
    line-height: 1.25;
}

.bx-sidebar-product span {
    display: block;

    width: 100%;
    max-width: 240px;

    color: rgba(255, 255, 255, 0.68);

    font-size: 0.78rem;
    font-weight: var(--bx-font-weight-medium);
    line-height: 1.5;
    text-align: center;

    overflow-wrap: normal;
    word-break: normal;
}


/* ==========================================================================
   User card
   ========================================================================== */

.bx-sidebar-user {
    flex: 0 0 auto;

    padding: 1rem;
}

.bx-sidebar-user-link {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 14px;
    align-items: center;
    gap: 0.8rem;

    width: 100%;
    min-height: 68px;
    padding: 0.8rem;

    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);

    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: var(--bx-radius-lg);

    text-decoration: none;

    transition:
        background-color var(--bx-transition-fast),
        border-color var(--bx-transition-fast),
        transform var(--bx-transition-fast);
}

.bx-sidebar-user-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.13);

    border-color: rgba(255, 255, 255, 0.2);

    transform: translateY(-1px);
}

.bx-sidebar-avatar-wrap {
    position: relative;

    display: inline-flex;
    flex: 0 0 48px;

    width: 48px;
    height: 48px;
}

.bx-sidebar-avatar {
    display: block;

    width: 48px;
    height: 48px;
    min-width: 48px;
    max-width: 48px;
    min-height: 48px;
    max-height: 48px;

    object-fit: cover;

    background: var(--bx-primary);

    border: 2px solid rgba(255, 255, 255, 0.55);
    border-radius: 50%;
}

.bx-sidebar-presence {
    position: absolute;
    right: 0;
    bottom: 0;

    width: 12px;
    height: 12px;

    background: var(--bx-success);

    border: 2px solid var(--bx-primary-dark);
    border-radius: 50%;
}

.bx-sidebar-user-copy {
    display: flex;
    flex-direction: column;

    min-width: 0;
}

.bx-sidebar-user-copy strong {
    overflow: hidden;

    color: #ffffff;

    font-size: 0.88rem;
    font-weight: var(--bx-font-weight-bold);
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bx-sidebar-user-copy small {
    overflow: hidden;

    margin-top: 0.15rem;

    color: rgba(255, 255, 255, 0.57);

    font-size: 0.72rem;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bx-sidebar-user-arrow {
    color: rgba(255, 255, 255, 0.4);

    font-size: 0.7rem;
}


/* ==========================================================================
   Navigation area
   ========================================================================== */

.bx-sidebar-navigation {
    flex: 1 1 auto;
    min-height: 0;

    overflow: hidden;
}

.bx-sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;

    height: 100%;
    margin: 0;
    padding: 0.3rem 0.95rem 1rem;

    overflow-y: auto;
    overflow-x: hidden;

    list-style: none;

    scrollbar-width: thin;
    scrollbar-color:
        rgba(255, 255, 255, 0.22)
        transparent;
}

.bx-sidebar-menu::-webkit-scrollbar {
    width: 5px;
}

.bx-sidebar-menu::-webkit-scrollbar-track {
    background: transparent;
}

.bx-sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.22);
    border-radius: var(--bx-radius-pill);
}

.bx-sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.36);
}

.bx-sidebar-item {
    flex: 0 0 auto;
}

.bx-sidebar-link {
    position: relative;

    display: flex;
    align-items: center;
    gap: 0.85rem;

    min-height: 46px;
    padding: 0.72rem 0.9rem;

    color: rgba(255, 255, 255, 0.74);

    border-radius: var(--bx-radius-md);

    font-size: 0.9rem;
    font-weight: var(--bx-font-weight-semibold);
    text-decoration: none;

    transition:
        color var(--bx-transition-fast),
        background-color var(--bx-transition-fast),
        transform var(--bx-transition-fast);
}

.bx-sidebar-link::before {
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: -0.95rem;

    width: 3px;

    content: "";

    background: var(--bx-primary-light);

    border-radius:
        0
        var(--bx-radius-pill)
        var(--bx-radius-pill)
        0;

    opacity: 0;

    transform: scaleY(0.45);

    transition:
        opacity var(--bx-transition-fast),
        transform var(--bx-transition-fast);
}

.bx-sidebar-link i {
    flex: 0 0 1.25rem;

    width: 1.25rem;

    font-size: 1.05rem;
    text-align: center;
}

.bx-sidebar-link span {
    min-width: 0;

    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.bx-sidebar-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);

    transform: translateX(2px);
}

.bx-sidebar-link.is-active {
    color: #ffffff;
    background: rgba(96, 165, 250, 0.19);

    box-shadow:
        inset 0 0 0 1px rgba(147, 197, 253, 0.12);
}

.bx-sidebar-link.is-active::before {
    opacity: 1;
    transform: scaleY(1);
}

.bx-sidebar-link-danger:hover {
    color: #fecaca;
    background: rgba(220, 38, 38, 0.14);
}

.bx-sidebar-section-title {
    flex: 0 0 auto;

    margin: 1rem 0 0.2rem;
    padding: 0.45rem 0.9rem;

    color: rgba(255, 255, 255, 0.4);

    font-size: 0.67rem;
    font-weight: var(--bx-font-weight-bold);
    letter-spacing: 0.09em;
    text-transform: uppercase;
}


/* ==========================================================================
   Storage quota card
   ========================================================================== */

.bx-storage-card {
    flex: 0 0 auto;

    margin: 0 0.95rem 0.85rem;
    padding: 0.95rem;

    background: rgba(7, 20, 44, 0.3);

    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: var(--bx-radius-lg);
}

.bx-storage-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.bx-storage-header > div {
    display: flex;
    flex-direction: column;
}

.bx-storage-eyebrow {
    color: rgba(255, 255, 255, 0.44);

    font-size: 0.65rem;
    font-weight: var(--bx-font-weight-bold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.bx-storage-header strong {
    margin-top: 0.1rem;

    color: #ffffff;

    font-size: 0.84rem;
    font-weight: var(--bx-font-weight-bold);
}

.bx-storage-percentage {
    color: rgba(255, 255, 255, 0.75);

    font-size: 0.8rem;
    font-weight: var(--bx-font-weight-bold);
}

.bx-storage-percentage[data-state="warning"] {
    color: #fbbf24;
}

.bx-storage-percentage[data-state="danger"] {
    color: #fca5a5;
}

.bx-storage-progress {
    width: 100%;
    height: 8px;
    margin-top: 0.75rem;

    overflow: hidden;

    background: rgba(255, 255, 255, 0.13);

    border-radius: var(--bx-radius-pill);
}

.bx-storage-progress-fill {
    display: block;

    width: 0;
    height: 100%;

    background: var(--bx-success);

    border-radius: inherit;

    transition:
        width 0.5s ease,
        background-color var(--bx-transition-fast);
}

.bx-storage-progress-fill[data-state="warning"] {
    background: var(--bx-warning);
}

.bx-storage-progress-fill[data-state="danger"] {
    background: var(--bx-danger);
}

.bx-storage-progress-fill[data-state="neutral"] {
    background: var(--bx-text-muted);
}

.bx-storage-summary {
    display: flex;
    align-items: center;
    gap: 0.25rem;

    margin-top: 0.5rem;

    color: rgba(255, 255, 255, 0.61);

    font-size: 0.72rem;
}

.bx-storage-details {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;

    margin-top: 0.75rem;
    padding-top: 0.75rem;

    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.bx-storage-detail {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;

    color: rgba(255, 255, 255, 0.57);

    font-size: 0.71rem;
}

.bx-storage-detail span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;

    min-width: 0;
}

.bx-storage-detail strong {
    max-width: 60%;

    overflow: hidden;

    color: rgba(255, 255, 255, 0.86);

    font-weight: var(--bx-font-weight-semibold);
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bx-storage-error {
    margin: 0.65rem 0 0;

    color: #fecaca;

    font-size: 0.69rem;
    line-height: 1.35;
}


/* ==========================================================================
   Sidebar footer
   ========================================================================== */

.bx-sidebar-footer {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;

    padding: 0.8rem 0.95rem;

    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.bx-sidebar-language .dropdown-toggle {
    min-height: 34px;
    padding: 0.38rem 0.65rem;

    color: rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.08);

    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: var(--bx-radius-pill);

    font-size: 0.74rem;
    font-weight: var(--bx-font-weight-bold);
}

.bx-sidebar-language .dropdown-toggle:hover,
.bx-sidebar-language .dropdown-toggle:focus {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.13);

    border-color: rgba(255, 255, 255, 0.21);
}

.bx-sidebar-language .dropdown-menu {
    min-width: 155px;
}

.bx-sidebar-version {
    color: rgba(255, 255, 255, 0.35);

    font-size: 0.66rem;
}


/* ==========================================================================
   Optional top bar
   ========================================================================== */

.bx-topbar {
    position: sticky;
    top: 0;
    z-index: 900;

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

    min-height: var(--bx-topbar-height, 72px);
    padding: 0 1.5rem;

    background: rgba(255, 255, 255, 0.94);

    border-bottom: 1px solid var(--bx-border);

    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.bx-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.bx-user-menu {
    display: flex;
    align-items: center;
    gap: 0.7rem;

    color: var(--bx-text-secondary);
}


/* ==========================================================================
   Mobile navigation
   ========================================================================== */

.bx-mobile-menu-button {
    position: fixed;
    top: 0.9rem;
    left: 0.9rem;
    z-index: 1101;

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

    width: 44px;
    height: 44px;

    color: #ffffff;
    background: var(--bx-primary);

    border: 0;
    border-radius: var(--bx-radius-md);

    box-shadow: var(--bx-shadow-md);
}

.bx-mobile-menu-button:hover {
    background: var(--bx-primary-hover);
}

.bx-sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;

    background: rgba(15, 23, 42, 0.58);

    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

body.has-sidebar-open {
    overflow: hidden;
}

.bx-sidebar-tagline {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem;

    width: 100%;
    max-width: 250px;

    color: rgba(255, 255, 255, 0.68);

    font-size: 0.72rem;
    font-weight: var(--bx-font-weight-medium);
    line-height: 1.45;
    text-align: center;
}

.bx-sidebar-tagline > span {
    color: rgba(147, 197, 253, 0.85);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 991.98px) {
    .bx-sidebar {
        transform: translateX(-100%);

        transition:
            transform var(--bx-transition-normal);
    }

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

    .bx-mobile-menu-button {
        display: inline-flex;
    }
}

@media (min-width: 992px) {
    .bx-sidebar-overlay {
        display: none !important;
    }
}

@media (max-height: 820px) and (min-width: 992px) {
    .bx-sidebar-brand {
        padding-top: 0.8rem;
        padding-bottom: 0.7rem;
    }

    .bx-sidebar-logo {
        width: min(100%, 165px);
    }

    .bx-sidebar-product {
        margin-top: 0.5rem;
    }

    .bx-sidebar-product span {
        font-size: 0.7rem;
    }

    .bx-sidebar-user {
        padding-top: 0.65rem;
        padding-bottom: 0.65rem;
    }

    .bx-sidebar-user-link {
        min-height: 60px;
        padding: 0.6rem;
    }

    .bx-storage-card {
        padding: 0.75rem;
    }

    .bx-storage-details {
        gap: 0.4rem;
    }
}

@media (max-width: 575.98px) {
    .bx-sidebar {
        width: min(88vw, var(--bx-sidebar-width));
    }

    .bx-sidebar-logo {
        width: min(100%, 185px);
    }
}


/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .bx-sidebar,
    .bx-sidebar-link,
    .bx-sidebar-user-link,
    .bx-storage-progress-fill {
        transition: none;
    }
}