/* Sidebar */
.sidebar {
    width: 250px;
    background: linear-gradient(180deg, var(--color-sidebar-bg-from) 0%, var(--color-sidebar-bg-to) 100%);
    color: var(--color-sidebar-text-active);
    display: flex;
    flex-direction: column;
    height: 100%;
    flex-shrink: 0;
    box-shadow: 2px 0 12px var(--color-shadow-md);
    transition: transform 0.3s ease;
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-sidebar-overlay);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 999;
        transform: translateX(-100%);
    }

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

    [dir="rtl"] .sidebar {
        left: auto;
        right: 0;
        transform: translateX(100%);
    }

    [dir="rtl"] .sidebar.open {
        transform: translateX(0);
    }
}

.logo-container {
    padding: 22px 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--color-sidebar-separator);
    margin-bottom: 8px;
    text-decoration: none;
    color: inherit;
}

.logo {
    width: 40px;
    height: 40px;
    background: var(--color-sidebar-logo-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    box-shadow: 0 3px 10px var(--color-sidebar-shadow);
    transition:
        transform 0.2s,
        box-shadow 0.2s;

    [dir="rtl"] & {
        margin-left: 12px;
        margin-right: unset;
    }
}

.logo:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 14px var(--color-sidebar-shadow-lg);
}

.logo svg {
    width: 22px;
    height: 22px;
    fill: var(--color-sidebar-text-active);
}

.app-name {
    font-size: 19px;
    font-weight: 700;
    color: var(--color-sidebar-text-active);
    letter-spacing: 0.3px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 8px 12px;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 11px 14px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--color-sidebar-text);
    font-size: 14.5px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    border-left: 3px solid transparent;

    [dir="rtl"] & {
        border-left: none;
        border-right: 3px solid transparent;
    }
}

.nav-item:hover {
    background-color: var(--color-sidebar-hover-bg);
    color: var(--color-sidebar-text-hover);
}

.nav-item.active {
    background-color: var(--color-sidebar-active-bg);
    color: var(--color-sidebar-text-active);
    border-left-color: var(--color-accent);
    font-weight: 600;

    [dir="rtl"] & {
        border-left-color: transparent;
        border-right-color: var(--color-accent);
    }
}

.nav-item i,
.nav-item .nav-icon,
.nav-item .oxi-icon {
    margin-right: 14px;
    width: 20px;
    height: 20px;
    text-align: center;
    font-size: 16px;
    transition:
        color 0.2s,
        transform 0.2s;
    flex-shrink: 0;

    [dir="rtl"] & {
        margin-left: 14px;
        margin-right: unset;
    }
}

/* Colored icons per section */
.nav-item:nth-child(1) i,
.nav-item:nth-child(1) .oxi-icon {
    color: var(--color-cal-1);
} /* Files - orange */
.nav-item:nth-child(2) i,
.nav-item:nth-child(2) .oxi-icon {
    color: var(--color-cal-2);
} /* Shared - blue */
.nav-item:nth-child(3) i,
.nav-item:nth-child(3) .oxi-icon {
    color: var(--color-cal-3);
} /* Recent - teal */
.nav-item:nth-child(4) i,
.nav-item:nth-child(4) .oxi-icon {
    color: var(--color-cal-4);
} /* Favorites - gold */
.nav-item:nth-child(5) i,
.nav-item:nth-child(5) .oxi-icon {
    color: var(--color-cal-5);
} /* Photos - pink */
.nav-item:nth-child(6) i,
.nav-item:nth-child(6) .oxi-icon {
    color: var(--color-cal-6);
} /* Trash - red */

.nav-item.active:nth-child(1) i,
.nav-item.active:nth-child(1) .oxi-icon {
    color: var(--color-accent);
}
.nav-item.active:nth-child(2) i,
.nav-item.active:nth-child(2) .oxi-icon {
    color: var(--color-cal-7);
}
.nav-item.active:nth-child(3) i,
.nav-item.active:nth-child(3) .oxi-icon {
    color: var(--color-cal-8);
}
.nav-item.active:nth-child(4) i,
.nav-item.active:nth-child(4) .oxi-icon {
    color: var(--color-cal-9);
}
.nav-item.active:nth-child(5) i,
.nav-item.active:nth-child(5) .oxi-icon {
    color: var(--color-cal-10);
}
.nav-item.active:nth-child(6) i,
.nav-item.active:nth-child(6) .oxi-icon {
    color: var(--color-cal-11);
}

.nav-item:hover i,
.nav-item:hover .oxi-icon {
    transform: scale(1.1);
}

/* Storage indicator */
.storage-container {
    margin: auto 12px 16px 12px;
    background: var(--color-sidebar-storage-bg);
    border: 1px solid var(--color-sidebar-storage-border);
    border-radius: 12px;
    padding: 16px;
}

.storage-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-sidebar-storage-text);
    letter-spacing: 0.3px;
}

.storage-bar {
    height: 6px;
    background-color: var(--color-sidebar-storage-bar);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.storage-fill {
    height: 100%;
    background: var(--color-sidebar-progress);
    border-radius: 3px;
    width: 0%;
    transition: width 0.8s ease;
}

.storage-info {
    text-align: center;
    font-size: 11.5px;
    color: var(--color-sidebar-storage-faint);
    font-weight: 400;
}
