/* Idol Memory stable flipbook */

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

html{
    background:#ffffff;
}

body{
    margin:0;
    padding:0;
    overflow:hidden;
    background:#ffffff;
    color:#222222;
    font-family:Arial, Helvetica, sans-serif;
    box-sizing:border-box;
}

*,
*::before,
*::after{
    box-sizing:border-box;
}

#catalog-header{
    position:fixed;
    top:0;
    left:0;
    right:0;
    height:58px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
    padding:0 16px 0 0;
    background:#43a000;
    border-bottom:1px solid rgba(0,0,0,0.12);
    z-index:2147483647;
}







#search-wrapper{
    width:420px;
    max-width:calc(100vw - 320px);
    height:34px;
    display:flex;
    align-items:center;
    background:#b7ff74;
}

#catalog-search{
    flex:1 1 auto;
    width:100%;
    height:34px;
    padding:0 12px;
    border:0;
    outline:0;
    background:#b7ff74;
    color:#333333;
    font-size:17px;
}

#catalog-search::placeholder{
    color:#777777;
    opacity:1;
}

#search-button{
    width:42px;
    height:34px;
    border:0;
    background:#b7ff74;
    color:#75bd30;
    font-size:28px;
    line-height:1;
    cursor:pointer;
}

#canvas{
    position:fixed;
    top:58px;
    left:0;
    right:0;
    bottom:52px;
    width:100%;
    min-height:0;
    margin:0 auto;
    padding:6px 48px 6px;
    z-index:1;
    visibility:hidden;
    overflow:hidden;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
}

#book-zoom{
    width:1200px;
    height:600px;
    position:relative;
    z-index:1;
    transform-origin:center center;
    -webkit-transform-origin:center center;
    transition:transform 0.25s ease;
    -webkit-transition:-webkit-transform 0.25s ease;
    touch-action:pan-y;
}

.sample-docs{
    width:1200px;
    height:600px;
    margin:0;
    position:relative;
    z-index:1;
    touch-action:pan-y;
    user-select:none;
    -webkit-user-select:none;
}

.animated{
    transition:margin-left 0.2s ease-in-out;
    -webkit-transition:margin-left 0.2s ease-in-out;
}

.sample-docs .page,
.sample-docs .hard,
.sample-docs .turn-page{
    width:600px;
    height:600px;
    position:relative;
    background:#ffffff;
    overflow:hidden;
    box-shadow:0 0 12px rgba(0,0,0,0.32);
}

.sample-docs .page img,
.sample-docs .hard img,
.sample-docs .turn-page img,
.sample-docs img{
    width:100% !important;
    height:100% !important;
    max-width:100% !important;
    max-height:100% !important;
    display:block;
    object-fit:contain;
    pointer-events:none;
    -webkit-user-drag:none;
}

.sample-docs .page-wrapper{
    perspective:2000px;
    -webkit-perspective:2000px;
}

.sample-docs .loader{
    width:22px;
    height:22px;
    position:absolute;
    top:50%;
    left:50%;
    margin-top:-11px;
    margin-left:-11px;
    background-image:url(../pics/loader.gif);
}

.sample-docs .shadow{
    transition:box-shadow 0.5s;
    -webkit-transition:-webkit-box-shadow 0.5s;
    box-shadow:0 0 20px #cccccc;
}

.sample-docs .tabs,
#slider-bar,
#slider{
    display:none !important;
}

.toc-hotspot-layer{
    position:absolute;
    inset:0;
    z-index:9999;
    pointer-events:auto;
}

.toc-hotspot{
    position:absolute;
    display:block;
    border:0;
    background:transparent;
    color:transparent;
    cursor:pointer;
    pointer-events:auto;
    padding:0;
    margin:0;
    overflow:hidden;
}

.toc-hotspot:hover{
    background:rgba(169,211,38,0.22);
}

/* To test hotspot placement, uncomment this block:
.toc-hotspot{
    border:1px solid red !important;
    background:rgba(255,0,0,0.18) !important;
    color:red !important;
    font-size:10px !important;
}
*/

.side-arrow{
    position:fixed;
    top:50%;
    transform:translateY(-50%);
    width:62px;
    height:92px;
    border:0;
    background:transparent;
    color:rgba(0,0,0,0.16);
    font-size:86px;
    font-family:Arial, Helvetica, sans-serif;
    line-height:1;
    cursor:pointer;
    z-index:500;
}

.side-arrow:hover{
    color:rgba(0,0,0,0.34);
}

.side-arrow:disabled{
    opacity:0.25;
    cursor:not-allowed;
}

.side-arrow-left{
    left:18px;
}

.side-arrow-right{
    right:18px;
}

#flipbook-toolbar{
    position:fixed;
    left:0;
    right:0;
    bottom:0;
    height:52px;
    padding:0 13px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:16px;
    background:#43a000;
    border-top:1px solid rgba(0,0,0,0.16);
    z-index:2147483647;
    pointer-events:auto;
    white-space:nowrap;
}

#flipbook-toolbar button{
    min-width:28px;
    height:40px;
    padding:0 3px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border:0;
    background:transparent;
    color:#050505;
    font:400 28px Arial, Helvetica, sans-serif;
    line-height:1;
    text-decoration:none;
    cursor:pointer;
}

#flipbook-toolbar button:hover{
    background:rgba(255,255,255,0.16);
}

#flipbook-toolbar button:disabled{
    opacity:0.26;
    cursor:not-allowed;
}

#page-status{
    min-width:116px;
    height:36px;
    padding:0 12px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    background:#ffffff;
    color:#000000;
    font-size:18px;
    font-weight:400;
    text-align:center;
}

.toolbar-spacer{
    flex:1 1 auto;
}

#toc-panel{
    position:fixed;
    left:58px;
    bottom:62px;
    width:330px;
    max-width:calc(100vw - 80px);
    max-height:calc(100vh - 140px);
    padding:0;
    overflow:hidden;
    background:#ffffff;
    border:1px solid #c9c9c9;
    border-radius:4px;
    box-shadow:0 8px 24px rgba(0,0,0,0.24);
    z-index:2147483646;
    display:none;
}

#toc-panel.open{
    display:block;
}

.toc-panel-header{
    height:44px;
    padding:0 12px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    background:#43a000;
    color:#ffffff;
}

.toc-panel-header h3{
    margin:0;
    font-size:16px;
    font-weight:700;
}

#toc-close{
    width:30px;
    height:30px;
    border:0;
    background:transparent;
    color:#ffffff;
    font-size:25px;
    line-height:1;
    cursor:pointer;
}

.toc-link{
    width:100%;
    min-height:39px;
    padding:9px 12px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    border:0;
    border-bottom:1px solid #eeeeee;
    background:#ffffff;
    color:#222222;
    font:600 14px Arial, Helvetica, sans-serif;
    text-align:left;
    cursor:pointer;
}

.toc-link:hover{
    background:#f3f3f3;
}

.toc-link strong{
    color:#43a000;
}

#search-results{
    position:fixed;
    top:66px;
    right:16px;
    width:410px;
    max-width:calc(100vw - 32px);
    max-height:70vh;
    display:none;
    overflow:hidden;
    background:#ffffff;
    border:1px solid #c8c8c8;
    border-radius:4px;
    box-shadow:0 8px 24px rgba(0,0,0,0.22);
    z-index:2147483646;
}

#search-results.open{
    display:block;
}

.search-results-header{
    height:42px;
    padding:0 12px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    background:#43a000;
    color:#ffffff;
}

#close-search{
    width:30px;
    height:30px;
    border:0;
    background:transparent;
    color:#ffffff;
    font-size:24px;
    cursor:pointer;
}

#search-results-list{
    max-height:calc(70vh - 42px);
    overflow:auto;
}

.search-result-item{
    width:100%;
    padding:11px 12px;
    display:block;
    border:0;
    border-bottom:1px solid #eeeeee;
    background:#ffffff;
    color:#222222;
    text-align:left;
    cursor:pointer;
}

.search-result-item:hover{
    background:#f4f4f4;
}

.search-result-item strong{
    display:block;
    margin-bottom:3px;
    color:#43a000;
    font-size:14px;
}

.search-result-item span{
    display:block;
    color:#333333;
    font-size:13px;
}

.search-result-item small{
    display:block;
    margin-top:4px;
    color:#777777;
    font-size:12px;
}

.search-empty{
    padding:15px;
    color:#666666;
    font-size:14px;
}

body.fullscreen-active{
    overflow:hidden;
    background:#ffffff;
}

body.fullscreen-active #canvas{
    position:fixed !important;
    inset:58px 0 52px !important;
    width:100vw !important;
    min-height:0 !important;
    margin:0 !important;
    padding:16px 76px 18px !important;
    display:flex !important;
    flex-direction:column !important;
    align-items:center !important;
    justify-content:center !important;
    background:#ffffff !important;
    overflow:hidden !important;
    z-index:2147483000 !important;
}

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

    #catalog-header{
        height:62px;
        padding:7px 8px;
        flex-direction:column;
        align-items:stretch;
        justify-content:center;
        gap:6px;
    }

    .brand{
        min-width:0;
        height:22px;
        padding-left:0;
        font-size:22px;
    }

    .brand-diamond{
        width:26px;
        height:26px;
        font-size:24px;
    }

    .brand sup{
        padding-top:0;
        font-size:8px;
    }

    #search-wrapper{
        width:100%;
        max-width:none;
        height:28px;
    }

    #catalog-search{
        height:28px;
        font-size:15px;
    }

    #search-button{
        height:28px;
        width:36px;
        font-size:24px;
    }

    #canvas{
        top:62px;
        bottom:54px;
        padding:10px 16px 12px;
    }

    .side-arrow{
        display:none;
    }

    #flipbook-toolbar{
        height:54px;
        padding:0 7px;
        gap:7px;
        overflow-x:auto;
        justify-content:flex-start;
    }

    #flipbook-toolbar button{
        min-width:32px;
        height:42px;
        font-size:24px;
        flex:0 0 auto;
    }

    #page-status{
        min-width:86px;
        height:34px;
        font-size:15px;
        flex:0 0 auto;
    }

    .toolbar-spacer{
        display:none;
    }

    #toc-panel{
        left:8px;
        bottom:62px;
        width:calc(100vw - 16px);
        max-width:none;
        max-height:calc(100vh - 132px);
    }

    #search-results{
        top:68px;
        right:8px;
        width:calc(100vw - 16px);
        max-width:none;
    }
}

/* Repeat-click TOC fix */
.toc-hotspot-layer,
.toc-hotspot{
    -webkit-transform:translateZ(0);
    transform:translateZ(0);
}

.toc-hotspot-layer{
    z-index:999999 !important;
}

.toc-hotspot{
    z-index:1000000 !important;
}


/* Client logo replacement */
.brand{
    height:58px;
    min-width:340px;
    padding-left:10px;
    display:flex;
    align-items:center;
    justify-content:flex-start;
    overflow:hidden;
}

.brand-logo{
    display:block;
    width:auto;
    max-width:325px;
    max-height:46px;
    object-fit:contain;
}

/* Clear navigation arrow labels */
#first-page,
#previous-spread,
#previous-page,
#next-page,
#next-spread,
#last-page{
    font-size:22px !important;
    font-weight:700 !important;
    letter-spacing:0.5px;
}

/* Mobile logo sizing */
@media screen and (max-width:900px){
    .brand{
        min-width:0 !important;
        height:24px !important;
        padding-left:0 !important;
    }

    .brand-logo{
        max-height:24px !important;
        max-width:220px !important;
    }
}
