/* =========================================
   RESET
========================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    height: 100%;
}

body {
    font-family:
        Arial,
        Helvetica,
        sans-serif;

    background: #252525;
    color: #ffffff;
    overflow: hidden;
    user-select: none;
}


/* =========================================
   APP
========================================= */

.app {
    width: 100%;
    height: 100vh;

    display: flex;
    flex-direction: column;

    background:
        radial-gradient(
            ellipse at center,
            #434343 0%,
            #2f2f2f 45%,
            #252525 80%
        );
}


/* =========================================
   TOPBAR
========================================= */

.topbar {
    height: 102px;
    flex-shrink: 0;

    display: grid;
    grid-template-columns: 1fr auto 1fr;

    align-items: center;

    gap: 20px;

    padding: 0 22px;

    background: #1f1f1f;

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

    z-index: 100;
}


.topbar-left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}


.topbar-center {
    display: flex;
    align-items: center;
    justify-content: center;
}


.topbar-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}


/* =========================================
   LOGO DEL SITIO
   MÁS GRANDE
========================================= */

.site-brand {
    display: flex;
    align-items: center;

    gap: 16px;
}


.site-logo-box {
    width: 86px;
    height: 86px;

    flex-shrink: 0;

    border-radius: 14px;

    overflow: hidden;

    background: #ffffff;

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

    border:
        1px solid
        rgba(255, 255, 255, 0.14);

    box-shadow:
        0 5px 16px
        rgba(0, 0, 0, 0.30);
}


.site-logo {
    width: 100%;
    height: 100%;

    object-fit: contain;

    display: block;
}


.site-brand-text {
    display: flex;
    flex-direction: column;

    justify-content: center;

    line-height: 1.2;
}


.site-brand-label {
    font-size: 12px;

    opacity: 0.7;

    margin-bottom: 3px;
}


.site-brand-name {
    font-size: 18px;

    font-weight: 700;

    color: #ffffff;

    white-space: nowrap;
}


/* =========================================
   TÍTULO DE LA REVISTA
========================================= */

#magazineTitle {
    font-size: 24px;

    font-weight: 700;

    text-align: center;

    color: #ffffff;

    white-space: nowrap;
}


.topbar-status {
    font-size: 13px;

    opacity: 0.75;
}


/* =========================================
   MAIN LAYOUT
========================================= */

.main-layout {
    flex: 1;

    min-height: 0;

    display: grid;

    grid-template-columns:
        190px
        1fr
        250px;

    overflow: hidden;
}


/* =========================================
   PANELES LATERALES
========================================= */

.side-panel {
    position: relative;

    overflow: hidden;

    background:
        linear-gradient(
            to bottom,
            rgba(70, 70, 70, 0.95),
            rgba(56, 56, 56, 0.95)
        );
}


.left-panel {
    border-right:
        1px solid
        rgba(255, 255, 255, 0.05);
}


.right-panel {
    border-left:
        1px solid
        rgba(255, 255, 255, 0.05);

    padding: 22px 18px;
}


/* =========================================
   LOGO DE LA UNIVERSIDAD
========================================= */

.left-panel-inner {
    width: 100%;
    height: 100%;

    display: flex;

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


.university-logo-wrapper {
    width: 150px;

    max-width: 88%;

    aspect-ratio: 1 / 1;

    border-radius: 16px;

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

    display: flex;

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

    padding: 14px;

    box-shadow:
        0 8px 20px
        rgba(0, 0, 0, 0.28),

        inset
        0 1px 0
        rgba(255, 255, 255, 0.08);
}


.university-logo {
    width: 100%;
    height: 100%;

    object-fit: contain;

    display: block;
}


/* =========================================
   PARTICIPANTES
========================================= */

.participants-box {
    width: 100%;
    height: 100%;

    overflow: auto;

    padding-right: 6px;
}


.participants-box h2 {
    font-size: 20px;

    margin-bottom: 16px;

    color: #ffffff;

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

    padding-bottom: 10px;
}


.participants-list {
    padding-left: 22px;

    line-height: 1.9;

    color: #f2f2f2;

    font-size: 15px;
}


.participants-list li {
    margin-bottom: 4px;
}


/* =========================================
   CENTRO
========================================= */

.center-area {
    position: relative;

    overflow: hidden;

    background:
        radial-gradient(
            ellipse at center,
            rgba(80, 80, 80, 0.25) 0%,
            rgba(40, 40, 40, 0.15) 55%,
            rgba(0, 0, 0, 0) 100%
        );

    display: flex;

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


/* =========================================
   LOADING
========================================= */

.loading-screen {
    position: absolute;

    inset: 0;

    display: flex;

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

    z-index: 220;

    background:
        rgba(25, 25, 25, 0.22);

    backdrop-filter:
        blur(1px);
}


.loading-screen.hidden {
    display: none;
}


.loading-box {
    min-width: 250px;

    max-width: 380px;

    padding: 22px 26px;

    border-radius: 16px;

    background:
        rgba(26, 26, 26, 0.92);

    box-shadow:
        0 16px 40px
        rgba(0, 0, 0, 0.45);

    display: flex;

    flex-direction: column;

    align-items: center;

    gap: 16px;

    text-align: center;
}


.loading-box p {
    font-size: 15px;

    line-height: 1.5;

    color: #ffffff;
}


.spinner {
    width: 44px;
    height: 44px;

    border:
        4px solid
        rgba(255, 255, 255, 0.20);

    border-top-color:
        #ffffff;

    border-radius:
        50%;

    animation:
        spin
        0.9s
        linear
        infinite;
}


@keyframes spin {

    from {
        transform:
            rotate(0deg);
    }

    to {
        transform:
            rotate(360deg);
    }

}


/* =========================================
   ERROR
========================================= */

.error-message {
    display: none;

    max-width: 650px;

    margin: 20px;

    padding: 28px;

    border-radius: 14px;

    background:
        #5a2323;

    color:
        #ffffff;

    line-height:
        1.7;

    box-shadow:
        0 18px 40px
        rgba(0, 0, 0, 0.35);

    z-index:
        230;
}


.error-message.visible {
    display: block;
}


/* =========================================
   BOOK STAGE
========================================= */

.book-stage {
    position: relative;

    width: 100%;
    height: 100%;

    display: none;

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

    overflow: visible;

    padding: 22px;
}


.book-stage.visible {
    display: flex;
}


/* =========================================
   LIBRO
========================================= */

.book {
    position: relative;

    z-index: 10;

    filter:
        drop-shadow(
            0 22px 28px
            rgba(0, 0, 0, 0.36)
        )

        drop-shadow(
            0 10px 12px
            rgba(0, 0, 0, 0.22)
        );
}


/* =========================================
   PÁGINAS
========================================= */

.page {
    position: relative;

    width: 100%;
    height: 100%;

    overflow: hidden;

    background:
        #ffffff;

    color:
        #000000;

    box-shadow:
        inset
        0 0 0 1px
        rgba(0, 0, 0, 0.04),

        inset
        0 2px 4px
        rgba(255, 255, 255, 0.5);
}


/* =========================================
   IMAGEN DE LA PÁGINA
========================================= */

.page-image {
    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: fill;

    background:
        #ffffff;

    display: block;

    pointer-events:
        none;

    opacity:
        0;

    transition:
        opacity
        0.2s
        ease;
}


.page-image.loaded {
    opacity: 1;
}


/* =========================================
   PLACEHOLDER
========================================= */

.page-placeholder {
    position: absolute;

    inset: 0;

    display: flex;

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

    background:
        linear-gradient(
            135deg,
            #ffffff,
            #f3f3f3
        );

    color:
        #777777;

    font-size:
        14px;
}


.page-placeholder.hidden {
    display: none;
}


/* =========================================
   GROSOR DE PÁGINAS
========================================= */

.page-stack {
    position: absolute;

    display: none;

    pointer-events: none;

    z-index: 5;

    opacity: 0;

    transition:
        width
        0.35s
        ease,

        left
        0.35s
        ease,

        opacity
        0.25s
        ease;
}


.page-stack.visible {
    display: block;

    opacity: 1;
}


.page-stack-left {
    background:
        repeating-linear-gradient(
            to right,

            #d2d2d2 0px,
            #d2d2d2 1px,

            #fafafa 1px,
            #fafafa 2px,

            #cccccc 2px,
            #cccccc 3px,

            #f3f3f3 3px,
            #f3f3f3 4px
        );

    border-radius:
        5px 0 0 5px;

    box-shadow:
        -5px 4px 10px
        rgba(0, 0, 0, 0.25),

        inset
        -4px 0 6px
        rgba(0, 0, 0, 0.14);
}


.page-stack-right {
    background:
        repeating-linear-gradient(
            to left,

            #d2d2d2 0px,
            #d2d2d2 1px,

            #fafafa 1px,
            #fafafa 2px,

            #cccccc 2px,
            #cccccc 3px,

            #f3f3f3 3px,
            #f3f3f3 4px
        );

    border-radius:
        0 5px 5px 0;

    box-shadow:
        5px 4px 10px
        rgba(0, 0, 0, 0.25),

        inset
        4px 0 6px
        rgba(0, 0, 0, 0.14);
}


.page-stack::before {
    content: "";

    position: absolute;

    left: 0;
    top: 0;

    width: 100%;
    height: 7px;

    background:
        linear-gradient(
            to bottom,

            rgba(255, 255, 255, 0.75),

            rgba(0, 0, 0, 0.08),

            transparent
        );
}


.page-stack::after {
    content: "";

    position: absolute;

    left: 0;
    bottom: 0;

    width: 100%;
    height: 7px;

    background:
        linear-gradient(
            to top,

            rgba(0, 0, 0, 0.14),

            transparent
        );
}


/* =========================================
   LOMO CENTRAL
========================================= */

.spine-shadow {
    position: absolute;

    display: none;

    pointer-events: none;

    z-index: 30;

    opacity: 0;

    visibility: hidden;

    transition:
        opacity
        0.22s
        ease,

        visibility
        0.22s
        ease;

    background:
        linear-gradient(
            to right,

            rgba(0, 0, 0, 0.00) 0%,

            rgba(0, 0, 0, 0.04) 18%,

            rgba(0, 0, 0, 0.15) 36%,

            rgba(0, 0, 0, 0.30) 47%,

            rgba(255, 255, 255, 0.13) 50%,

            rgba(0, 0, 0, 0.25) 53%,

            rgba(0, 0, 0, 0.11) 68%,

            rgba(0, 0, 0, 0.00) 100%
        );

    mix-blend-mode:
        multiply;
}


.spine-shadow.visible {
    display: block;

    opacity: 1;

    visibility: visible;
}


.spine-shadow.turning {
    opacity: 0 !important;

    visibility: hidden !important;

    transition:
        opacity
        0.08s
        linear;
}


.spine-shadow::before {
    content: "";

    position: absolute;

    top: 0;

    left: -24px;

    width: 50%;
    height: 100%;

    background:
        linear-gradient(
            to right,

            transparent,

            rgba(0, 0, 0, 0.10)
        );

    filter:
        blur(6px);
}


.spine-shadow::after {
    content: "";

    position: absolute;

    top: 0;

    right: -24px;

    width: 50%;
    height: 100%;

    background:
        linear-gradient(
            to left,

            transparent,

            rgba(0, 0, 0, 0.09)
        );

    filter:
        blur(6px);
}


/* =========================================
   SOMBRA NATIVA DEL PAGE FLIP
========================================= */

.stf__shadow {
    filter:
        blur(1px);
}


/* =========================================
   CONTROLES
========================================= */

.controls {
    height: 78px;

    flex-shrink: 0;

    display: flex;

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

    gap: 24px;

    padding:
        0 20px;

    background:
        #1f1f1f;

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

    z-index:
        100;
}


/* =========================================
   BOTONES
========================================= */

.control-button {
    width: 48px;
    height: 48px;

    border: none;

    border-radius:
        50%;

    background:
        #4a4a4a;

    color:
        #ffffff;

    font-size:
        22px;

    cursor:
        pointer;

    transition:
        background-color
        0.2s
        ease,

        transform
        0.2s
        ease,

        opacity
        0.2s
        ease;
}


.control-button:hover:not(:disabled) {
    background:
        #666666;

    transform:
        scale(1.08);
}


.control-button:active:not(:disabled) {
    transform:
        scale(0.94);
}


.control-button:disabled {
    opacity:
        0.28;

    cursor:
        default;
}


/* =========================================
   INFORMACIÓN DE PÁGINA
========================================= */

.page-information {
    min-width:
        160px;

    text-align:
        center;
}


#pageInfo {
    font-size:
        15px;

    font-weight:
        700;

    color:
        #ffffff;
}


/* =========================================
   RESPONSIVE 1280
========================================= */

@media screen and (max-width: 1280px) {

    .main-layout {
        grid-template-columns:
            150px
            1fr
            210px;
    }


    #magazineTitle {
        font-size:
            20px;
    }


    .university-logo-wrapper {
        width:
            135px;
    }


    .site-logo-box {
        width:
            76px;

        height:
            76px;
    }


    .topbar {
        height:
            92px;
    }

}


/* =========================================
   RESPONSIVE 980
========================================= */

@media screen and (max-width: 980px) {

    .main-layout {
        grid-template-columns:
            120px
            1fr
            190px;
    }


    .university-logo-wrapper {
        width:
            108px;
    }


    .participants-box h2 {
        font-size:
            17px;
    }


    .participants-list {
        font-size:
            14px;
    }


    .topbar {
        grid-template-columns:
            1fr
            auto;

        height:
            84px;
    }


    .topbar-right {
        display:
            none;
    }


    .site-logo-box {
        width:
            68px;

        height:
            68px;
    }


    .site-brand-name {
        font-size:
            16px;
    }

}


/* =========================================
   RESPONSIVE MÓVIL
========================================= */

@media screen and (max-width: 760px) {

    .main-layout {
        grid-template-columns:
            1fr;
    }


    .left-panel,
    .right-panel {
        display:
            none;
    }


    .topbar {
        grid-template-columns:
            1fr;

        justify-items:
            center;

        gap:
            8px;

        height:
            auto;

        padding:
            10px 14px;
    }


    .topbar-left,
    .topbar-center {
        width:
            100%;

        justify-content:
            center;
    }


    .site-brand {
        justify-content:
            center;
    }


    .site-logo-box {
        width:
            64px;

        height:
            64px;
    }


    #magazineTitle {
        font-size:
            18px;
    }


    .controls {
        height:
            70px;

        gap:
            16px;
    }


    .control-button {
        width:
            42px;

        height:
            42px;

        font-size:
            19px;
    }


    #pageInfo {
        font-size:
            14px;
    }

}