<div [style.background]="postsService.theme ? postsService.theme.background_color : null" style="width: 100%; height: 100%;">
    <div class="mat-elevation-z3" style="position: relative; z-index: 10;">
        <mat-toolbar color="primary" class="sticky-toolbar top-toolbar">
            <div class="flex-row" width="100%" height="100%">
                <div class="flex-column" style="text-align: left; margin-top: 1px;">
                    <button #hamburgerMenu style="outline: none" *ngIf="router.url.split(';')[0] !== '/player'" mat-icon-button aria-label="Toggle side navigation" (click)="toggleSidenav()"><mat-icon>menu</mat-icon></button>
                    <button (click)="goBack()" *ngIf="router.url.split(';')[0] === '/player'" mat-icon-button><mat-icon>arrow_back</mat-icon></button>
                </div>
                <div class="flex-column" style="text-align: center; margin-top: 5px;">
                    <div style="font-size: 22px; text-shadow: #141414 0.25px 0.25px 1px;">
                        {{topBarTitle}}
                    </div>
                </div>
                <div class="flex-column" style="text-align: right; align-items: flex-end;">
                    <button [matMenuTriggerFor]="menuSettings" mat-icon-button><mat-icon>more_vert</mat-icon></button>
                    <mat-menu #menuSettings="matMenu">
                        <button (click)="openProfileDialog()" *ngIf="postsService.isLoggedIn" mat-menu-item>
                            <mat-icon>person</mat-icon>
                            <span i18n="Profile menu label">Profile</span>
                        </button>
                        <button (click)="themeMenuItemClicked($event)" *ngIf="allowThemeChange" mat-menu-item>
                          <mat-icon>{{(postsService.theme.key === 'default') ? 'brightness_5' : 'brightness_2'}}</mat-icon>
                          <span i18n="Dark mode toggle label">Dark</span>
                          <mat-slide-toggle class="theme-slide-toggle" [checked]="postsService.theme.key === 'dark'"></mat-slide-toggle>
                        </button>
                        <button *ngIf="postsService.config && (!postsService.config.Advanced.multi_user_mode || (postsService.isLoggedIn && postsService.permissions.includes('settings')))" (click)="openSettingsDialog()" mat-menu-item>
                          <mat-icon>settings</mat-icon>
                          <span i18n="Settings menu label">Settings</span>
                        </button>
                        <button (click)="openAboutDialog()" mat-menu-item>
                            <mat-icon>info</mat-icon>
                            <span i18n="About menu label">About</span>
                        </button>
                    </mat-menu>
                </div>
            </div>
        </mat-toolbar>
    </div>
    <div class="sidenav-container" style="height: calc(100% - 64px)">
        <mat-sidenav-container style="height: 100%">
            <mat-sidenav [opened]="postsService.sidepanel_mode === 'side' && !window.location.href.includes('/player')" [mode]="postsService.sidepanel_mode" #sidenav>
                <mat-nav-list>
                    <a *ngIf="postsService.config && (!postsService.config.Advanced.multi_user_mode || postsService.isLoggedIn)" mat-list-item (click)="postsService.sidepanel_mode === 'over' ? sidenav.close() : null" routerLink='/home'><ng-container i18n="Navigation menu Home Page title">Home</ng-container></a>
                    <a *ngIf="postsService.config && postsService.config.Advanced.multi_user_mode && !postsService.isLoggedIn" mat-list-item (click)="sidenav.close()" routerLink='/login'><ng-container i18n="Navigation menu Login Page title">Login</ng-container></a>
                    <a *ngIf="postsService.config && allowSubscriptions && (!postsService.config.Advanced.multi_user_mode || (postsService.isLoggedIn && postsService.permissions.includes('subscriptions')))" mat-list-item (click)="postsService.sidepanel_mode === 'over' ? sidenav.close() : null" routerLink='/subscriptions'><ng-container i18n="Navigation menu Subscriptions Page title">Subscriptions</ng-container></a>
                    <a *ngIf="postsService.config && enableDownloadsManager && (!postsService.config.Advanced.multi_user_mode || (postsService.isLoggedIn && postsService.permissions.includes('downloads_manager')))" mat-list-item (click)="postsService.sidepanel_mode === 'over' ? sidenav.close() : null" routerLink='/downloads'><ng-container i18n="Navigation menu Downloads Page title">Downloads</ng-container></a>
                    <ng-container *ngIf="postsService.config && allowSubscriptions && postsService.subscriptions && (!postsService.config.Advanced.multi_user_mode || (postsService.isLoggedIn && postsService.permissions.includes('subscriptions')))">
                        <mat-divider></mat-divider>
                        <a *ngFor="let subscription of postsService.subscriptions" mat-list-item (click)="postsService.sidepanel_mode === 'over' ? sidenav.close() : null" [routerLink]="['/subscription', { id: subscription.id }]"><ngx-avatar [style.margin-right]="'10px'" size="32" [name]="subscription.name"></ngx-avatar>{{subscription.name}}</a>
                    </ng-container>
                </mat-nav-list>
            </mat-sidenav>
            <mat-sidenav-content [style.background]="postsService.theme ? postsService.theme.background_color : null">
                <router-outlet></router-outlet>
            </mat-sidenav-content>
        </mat-sidenav-container>
    </div>
</div>