/*
 * ROCKOLA WEB V4
 * APPLICATION SHELL
 *
 * Responsabilidad:
 * estructura general responsive de la aplicación.
 */

html,
body {
    width: 100%;
    min-height: 100%;
    background: var(--color-bg);
}

body {
    color: var(--color-text);
    font-family: var(--font-family);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-regular);
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}


/* =========================================================
   APPLICATION ROOT
   ========================================================= */

.app-shell {
    position: relative;

    display: grid;

    grid-template-columns:
        var(--layout-sidebar-width)
        minmax(0, 1fr);

    grid-template-rows:
        minmax(100vh, auto);

    width: 100%;
    min-height: 100vh;

    background: var(--color-bg);
}


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

.app-header {
    position: fixed;

    top: 0;
    right: 0;
    left: var(--layout-sidebar-width);

    z-index: var(--z-header);

    height: var(--layout-header-height);
}


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

.app-navigation {
    position: fixed;

    top: 0;
    bottom: 0;
    left: 0;

    z-index: var(--z-navigation);

    width: var(--layout-sidebar-width);

    padding-bottom:
        var(--layout-player-height-desktop);
}


/* =========================================================
   MAIN CONTENT
   ========================================================= */

.app-content {
    grid-column: 2;

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

    padding:
        calc(
            var(--layout-header-height) +
            var(--space-8)
        )
        var(--space-8)
        calc(
            var(--layout-player-height-desktop) +
            var(--space-8)
        );

    overflow-x: hidden;
}

.app-view {
    width: 100%;
    max-width: var(--layout-content-max);

    margin: 0 auto;
}


/* =========================================================
   PLAYER REGION
   ========================================================= */

.app-player {
    position: fixed;

    right: 0;
    bottom: 0;
    left: var(--layout-sidebar-width);

    z-index: var(--z-player);

    min-width: 0;
    min-height: var(--layout-player-height-desktop);
}


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

@media (max-width: 980px) {

    :root {
        --layout-sidebar-width: 210px;
    }

    .app-content {
        padding-right: var(--space-6);
        padding-left: var(--space-6);
    }
}


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

@media (max-width: 760px) {

    .app-shell {
        display: block;

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

    .app-header {
        top: 0;
        right: 0;
        left: 0;

        height: var(--layout-header-height);
    }

    .app-navigation {
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;

        width: 100%;
        height: var(--layout-mobile-nav-height);

        padding-bottom: 0;
    }

    .app-content {
        width: 100%;
        min-height: 100svh;

        padding:
            calc(
                var(--layout-header-height) +
                var(--space-4)
            )
            var(--space-4)
            calc(
                var(--layout-mobile-nav-height) +
                var(--layout-player-height-mobile) +
                var(--space-5)
            );
    }

    .app-view {
        width: 100%;
        max-width: none;
    }

    .app-player {
        right: 0;

        bottom: var(--layout-mobile-nav-height);

        left: 0;

        min-height: var(--layout-player-height-mobile);
    }
}


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

@media (max-width: 480px) {

    .app-content {
        padding-right: var(--space-3);
        padding-left: var(--space-3);
    }
}


/* =========================================================
   AUTH MODE
   Pantalla exclusiva de autenticacion.
   ========================================================= */

.app-shell.is-auth-mode {
    display: block;
    width: 100%;
    min-height: 100vh;
}


.app-shell.is-auth-mode .app-header,
.app-shell.is-auth-mode .app-navigation,
.app-shell.is-auth-mode .app-queue-panel,
.app-shell.is-auth-mode .app-player {
    display: none;
}


.app-shell.is-auth-mode .app-content {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 100vh;
    padding: 0;
    overflow-x: hidden;
}


.app-shell.is-auth-mode .app-view {
    width: 100%;
    max-width: none;
    margin: 0;
}


@media (max-width: 760px) {

    .app-shell.is-auth-mode {
        min-height: 100svh;
    }

    .app-shell.is-auth-mode .app-content {
        min-height: 100svh;
        padding: 0;
    }
}
