.elms-book-loader-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.96);
    pointer-events: all;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.elms-book-loader-overlay.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

html.page-loader-active {
    overflow: hidden;
}

.elms-book-loader-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.elms-book-loader-book {
    position: relative;
    width: 144px;
    height: 112px;
    perspective: 1200px;
}

.elms-book-loader-glow {
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 85%;
    height: 16px;
    border-radius: 999px;
    opacity: 0.8;
    background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.4) 0%, rgba(99, 102, 241, 0) 70%);
    filter: blur(8px);
    animation: elms-book-pulse-glow 3s infinite alternate;
}

.elms-book-loader-shadow {
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    height: 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.15);
    filter: blur(8px);
}

.elms-book-loader-cover {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 112px;
    border-radius: 8px;
    box-shadow: 0 15px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
    background-image:
        linear-gradient(145deg, #6366f1 0%, #4f46e5 55%, #4338ca 100%),
        url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
    overflow: hidden;
}

.elms-book-loader-cover-shimmer {
    position: absolute;
    inset: -100%;
    opacity: 0.3;
    background: linear-gradient(45deg, transparent 40%, rgba(255, 255, 255, 0.8) 45%, transparent 50%);
    animation: elms-book-shimmer 3s infinite;
}

.elms-book-loader-cover-title {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    width: 100%;
    padding: 0 8px;
}

.elms-book-loader-cover-name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: transparent;
    background: linear-gradient(180deg, #f7e373 0%, #eac54f 30%, #e6a417 70%, #d69323 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-stroke: 0.5px rgba(0, 0, 0, 0.1);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.elms-book-loader-cover-tagline {
    margin-top: 4px;
    font-size: 8px;
    line-height: 1.2;
    opacity: 0.7;
    color: #fff;
    letter-spacing: 0.08em;
}

.elms-book-loader-cover-line {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    height: 1px;
    opacity: 0.6;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.6) 50%, transparent 100%);
    box-shadow: 0 0.5px 0.5px rgba(0, 0, 0, 0.2);
}

.elms-book-loader-cover-line-top {
    top: 64px;
}

.elms-book-loader-cover-line-bottom {
    top: 112px;
}

.elms-book-loader-corner {
    position: absolute;
    width: 16px;
    height: 16px;
    opacity: 0.8;
    background: linear-gradient(135deg, #f7e373 0%, #e6a417 100%);
}

.elms-book-loader-corner-tl {
    top: 8px;
    left: 8px;
    clip-path: polygon(0 0, 40% 0, 0 40%);
}

.elms-book-loader-corner-tr {
    top: 8px;
    right: 8px;
    clip-path: polygon(100% 0, 60% 0, 100% 40%);
}

.elms-book-loader-corner-bl {
    bottom: 8px;
    left: 8px;
    clip-path: polygon(0 100%, 0 60%, 40% 100%);
}

.elms-book-loader-corner-br {
    bottom: 8px;
    right: 8px;
    clip-path: polygon(100% 100%, 60% 100%, 100% 60%);
}

.elms-book-loader-spine {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 12px;
    height: 112px;
    border-radius: 8px 0 0 8px;
    box-shadow: inset -1px 0 1px rgba(0, 0, 0, 0.3);
    background: linear-gradient(145deg, #6366f1 0%, #4f46e5 55%, #4338ca 100%);
}

.elms-book-loader-spine-line {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 1px;
    height: 80px;
    background: linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
}

.elms-book-loader-edge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 8px;
    height: 112px;
    border-radius: 0 2px 2px 0;
    background:
        repeating-linear-gradient(0deg, rgba(220, 220, 220, 0.8) 0px, #fff 1px, #fff 2px, rgba(220, 220, 220, 0.8) 3px),
        linear-gradient(to left, #e5e7eb, #fff);
    box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.1);
}

.elms-book-loader-stack {
    position: absolute;
    bottom: 4px;
    left: 12px;
    width: 45%;
    height: 112px;
    border-radius: 0 2px 2px 0;
    background:
        url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23000000' fill-opacity='0.02' fill-rule='evenodd'/%3E%3C/svg%3E"),
        linear-gradient(to right, #f9fafb 70%, #f3f4f6 100%);
    box-shadow: inset -2px 0 3px rgba(0, 0, 0, 0.05);
}

.elms-book-loader-stack-page {
    position: absolute;
    right: 12px;
    font-size: 10px;
    color: #9ca3af;
}

.elms-book-loader-stack-page-1 { bottom: 5px; }
.elms-book-loader-stack-page-2 { bottom: 17px; }
.elms-book-loader-stack-page-3 { bottom: 29px; }

.elms-book-loader-page {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 45%;
    height: 112px;
    border-radius: 2px 0 0 2px;
    transform-origin: left center;
    transform-style: preserve-3d;
    background:
        url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23000000' fill-opacity='0.02' fill-rule='evenodd'/%3E%3C/svg%3E"),
        linear-gradient(to left, #ffffff 85%, #f3f4f6 100%);
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
    animation: elms-book-page-turn-curl 4s infinite cubic-bezier(0.3, 0.1, 0.3, 1);
}

.elms-book-loader-page-1 { z-index: 10; animation-delay: 0s; }
.elms-book-loader-page-2 { z-index: 9; animation-delay: 0.5s; }
.elms-book-loader-page-3 { z-index: 8; animation-delay: 1s; }
.elms-book-loader-page-4 { z-index: 7; animation-delay: 1.5s; }
.elms-book-loader-page-5 { z-index: 6; animation-delay: 2s; }

.elms-book-loader-page-num {
    position: absolute;
    left: 12px;
    bottom: 8px;
    font-size: 10px;
    color: #9ca3af;
}

.elms-book-loader-page-line {
    position: absolute;
    left: 12%;
    height: 1px;
    opacity: 0.8;
    background: linear-gradient(90deg, rgba(160, 160, 160, 0.6) 0%, rgba(160, 160, 160, 0.3) 80%, rgba(160, 160, 160, 0) 100%);
}

.elms-book-loader-page-curl {
    position: absolute;
    inset: 0;
    border-radius: 2px 0 0 2px;
    overflow: hidden;
    background: linear-gradient(to bottom right, transparent 75%, rgba(0, 0, 0, 0.05) 85%, rgba(0, 0, 0, 0.08) 95%);
    mix-blend-mode: multiply;
}

.elms-book-loader-particle {
    position: absolute;
    border-radius: 50%;
    background: rgb(99, 102, 241);
    box-shadow: 0 0 3px rgba(99, 102, 241, 0.6);
    transform: translateZ(0);
}

.elms-book-loader-brand {
    margin-top: 16px;
    font-size: 1.875rem;
    font-weight: 700;
    color: #6366f1;
}

@keyframes elms-book-page-turn-curl {
    0%, 5% {
        transform: rotateY(0deg) translateZ(0);
        filter: drop-shadow(-5px 2px 3px rgba(0, 0, 0, 0.05));
    }
    40%, 45% {
        transform: rotateY(-170deg) translateZ(2px) scale(0.98);
        filter: drop-shadow(5px 3px 5px rgba(0, 0, 0, 0.1));
    }
    85%, 100% {
        transform: rotateY(-360deg) translateZ(0);
        filter: drop-shadow(-5px 2px 3px rgba(0, 0, 0, 0.05));
    }
}

@keyframes elms-book-pulse-glow {
    0% {
        opacity: 0.6;
        transform: translateX(-50%) scale(0.95);
    }
    100% {
        opacity: 0.8;
        transform: translateX(-50%) scale(1.05);
    }
}

@keyframes elms-book-shimmer {
    0% {
        transform: translateX(-150%) translateY(-150%) rotate(45deg);
    }
    100% {
        transform: translateX(150%) translateY(150%) rotate(45deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .elms-book-loader-page,
    .elms-book-loader-cover-shimmer,
    .elms-book-loader-glow,
    .elms-book-loader-particle {
        animation: none !important;
    }
}
