body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
    /*Para que no tenga scroll con el overflow y todo el contenido, el pdf y demas, bien centrado
    mas que nada pricnipalmente para cuando se pasa a full-screen*/
}

nav {
    background-color: #193848;
}

.viewer-navbar {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
}

.viewer-navbar__brand {
    justify-self: start;
}

.viewer-navbar__title {
    justify-self: center;
    text-align: center;
    min-width: 0;
}

.viewer-navbar__actions {
    justify-self: end;
}

.viewer-zoom-hint-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.viewer-fullscreen-hint-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.title-pdf {
    color: #f7f3e8;
    font-weight: 600;
    display: block;
    max-width: min(48vw, 560px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-nav {
    background-color: #f7f3e8;
    color: #193848;
    text-decoration: none;
    padding: 4px 12px;
    border: 1px solid #f7f3e8;
    border-radius: 4px;
}

.btn:hover {
    background-color: unset;
    border-color: unset;
    color: unset;
}

.flipbook-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    width: 100%;
    padding-inline: clamp(16px, 4vw, 48px);
    padding-bottom: 10px;
}

.btn-zoom-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 34px;
    padding: 0;
}

.btn-zoom-toggle svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.btn-zoom-toggle.is-active {
    background-color: #193848;
    color: #f7f3e8;
}

.viewer-zoom-hint {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    z-index: 30;
    width: 240px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.94);
    color: #193848;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.viewer-zoom-hint::before {
    content: "";
    position: absolute;
    top: -8px;
    right: 16px;
    width: 16px;
    height: 16px;
    background: rgba(255, 255, 255, 0.94);
    transform: rotate(45deg);
    border-radius: 3px;
}

.viewer-zoom-hint span {
    position: relative;
    display: block;
    font-size: 0.9rem;
    line-height: 1.35;
}

.viewer-zoom-hint.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.viewer-fullscreen-hint {
    right: 50%;
    transform: translate(50%, -8px) scale(0.98);
}

.viewer-fullscreen-hint::before {
    right: 50%;
    transform: translateX(50%) rotate(45deg);
}

.viewer-fullscreen-hint.is-visible {
    transform: translate(50%, 0) scale(1);
}

#flipbook-wrapper {
    filter: drop-shadow(0 18px 40px rgba(15, 23, 42, 0.2));
}

.page canvas {
    border-radius: 6px;
}

.viewer-loading {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    margin-bottom: 8px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.82);
    color: #193848;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.viewer-loading__spinner {
    width: 22px;
    height: 22px;
    border-radius: 9999px;
    border: 3px solid rgba(25, 56, 72, 0.18);
    border-top-color: #193848;
    animation: viewer-spin 0.9s linear infinite;
}

.viewer-loading__copy {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.viewer-loading__copy strong {
    font-size: 0.95rem;
}

.viewer-loading__copy span {
    font-size: 0.82rem;
    color: rgba(25, 56, 72, 0.72);
}

.viewer-magnifier {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 20;
    display: none;
    overflow: hidden;
    border: 2px solid rgba(247, 243, 232, 0.9);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
    pointer-events: none;
}

.viewer-magnifier.is-visible {
    display: block;
}

.viewer-magnifier canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.btn-flip {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 9999px;
    background-color: rgba(90, 90, 90, 0.55);
    color: #ffffff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.btn-flip svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.btn-flip:hover {
    background-color: rgba(90, 90, 90, 0.75);
}

.btn-flip:focus {
    outline: 2px solid rgba(255, 255, 255, 0.7);
    outline-offset: 2px;
}


.btn-fullscren {
    position:static; 
    transform:none;
    cursor: pointer;
    border-radius: 5px;
    
}



.btn-prev {
    left: clamp(8px, 2vw, 24px);
}

.btn-next {
    right: clamp(8px, 2vw, 24px);
}

@media (max-width: 768px) {
    .viewer-navbar {
        grid-template-columns: auto 1fr;
        grid-template-areas:
            "brand actions"
            "title title";
        row-gap: 12px;
    }

    .viewer-navbar__brand {
        grid-area: brand;
    }

    .viewer-navbar__actions {
        grid-area: actions;
    }

    .viewer-navbar__title {
        grid-area: title;
        width: 100%;
    }

    .title-pdf {
        max-width: 100%;
    }

    .btn-flip {
        width: 46px;
        height: 46px;
    }

    .btn-flip svg {
        width: 20px;
        height: 20px;
    }

    .flipbook-container {
        padding-inline: 12px;
        padding-bottom: 6px;
    }

    .viewer-loading {
        padding: 12px 14px;
        margin-inline: 12px;
    }

    .viewer-zoom-hint {
        right: auto;
        left: 0;
        width: min(240px, calc(100vw - 32px));
    }

    .viewer-zoom-hint::before {
        right: auto;
        left: 16px;
    }

    .viewer-fullscreen-hint {
        left: auto;
        right: 0;
        transform: translateY(-8px) scale(0.98);
    }

    .viewer-fullscreen-hint::before {
        left: auto;
        right: 16px;
        transform: rotate(45deg);
    }

    .viewer-fullscreen-hint.is-visible {
        transform: translateY(0) scale(1);
    }

    .viewer-magnifier {
        display: none !important;
    }
}

@keyframes viewer-spin {
    to {
        transform: rotate(360deg);
    }
}


