/**
 * BookBlock Odrin - Complete CSS
 * Fullscreen Modal exactly like Odrin Theme
 */

/* =====================================================
   FULLSCREEN MODAL CONTAINER
   ===================================================== */

.book-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    background: #fff;
    
    /* Hidden by default */
    opacity: 0;
    visibility: hidden;
    transform: scale(0.9);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    
    overflow: hidden;
}

.book-container.showBook {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

/* Disable body scroll when book is open */
body.body--disabled {
    overflow: hidden;
}

/* =====================================================
   TABLE OF CONTENTS PANEL
   ===================================================== */

.menu-panel {
    position: absolute;
    left: 0;
    top: 0;
    width: 300px;
    height: 100%;
    background: #2c2c2c;
    color: #fff;
    padding: 40px 30px;
    z-index: 100;
    
    /* Hidden by default */
    transform: translateX(-100%);
    transition: transform 0.4s ease;
    
    overflow-y: auto;
}

.book-container.slideRight .menu-panel {
    transform: translateX(0);
}

.menu-panel h3 {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.menu-toc {
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu-toc li {
    margin-bottom: 15px;
}

.menu-toc li a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    display: block;
    padding: 10px 0;
    transition: color 0.3s ease;
}

.menu-toc li a:hover {
    color: #fff;
}

.menu-toc li.menu-toc-current a {
    color: #fff;
    font-weight: 600;
}

/* =====================================================
   BOOKBLOCK WRAPPER
   ===================================================== */

.bb-custom-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s ease;
}

.book-container.slideRight .bb-custom-wrapper {
    transform: translateX(300px);
}

/* =====================================================
   BOOKBLOCK CORE
   ===================================================== */

.bb-bookblock {
    width: calc(100% - 120px);
    max-width: 1400px;
    height: calc(100vh - 160px);
    position: relative;
    background: #fff;
    margin: 0 auto;
    box-shadow: 0 10px 50px #c013a1;
;
}

@media (max-width: 768px) {
    .bb-bookblock {
        width: calc(100% - 40px);
        height: calc(100vh - 120px);
    }
}

.bb-page {
    width: 50%;
    height: 100%;
    left: 50%;
    position: absolute;
    transform-style: preserve-3d;
    transform-origin: left center;
}

.bb-page > div,
.bb-outer,
.bb-content {
    position: absolute;
    height: 100%;
    top: 0;
    left: 0;
}

.bb-content {
    background: #fff;
}

.bb-inner {
    position: relative;
    width: 100%;
    height: 100%;
}

.bb-overlay, .bb-outer {
    backface-visibility: hidden;
}

.bb-page > div {
    width: 100%;
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

.bb-back {
    transform: rotateY(-180deg);
}

.bb-outer {
    width: 100%;
    overflow: hidden;
    z-index: 999;
}

.bb-overlay, 
.bb-flipoverlay {
    background-color: rgba(0, 0, 0, 0.7);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    z-index: 1000;
}

.bb-flipoverlay {
    background-color: rgba(0, 0, 0, 0.2);
}

.bb-bookblock > div.bb-page:first-child,
.bb-bookblock > div.bb-page:first-child .bb-back {
    transform: rotateY(180deg);
}

.bb-item {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: none;
    background: #fff;
}

.bb-item:first-child {
    display: block;
}

/* =====================================================
   BOOK CONTENT
   ===================================================== */

.book-content {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.book-content-inner {
    width: 100%;
    height: 100%;
    padding: 60px;
    overflow-y: auto;
    overflow-x: hidden;
}

@media (max-width: 768px) {
    .book-content-inner {
        padding: 40px 30px;
    }
}

.chapter-heading {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 30px;
    color: #222;
    line-height: 1.3;
}

.chapter-content {
    font-size: 16px;
    line-height: 1.8;
    color: #555;
}

.chapter-content p {
    margin-bottom: 20px;
}

.chapter-content h2,
.chapter-content h3,
.chapter-content h4 {
    margin-top: 30px;
    margin-bottom: 15px;
    color: #222;
}

.chapter-content img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
}

/* Special first letter */
.special-first-letter .chapter-content p:first-of-type:first-letter {
    font-size: 4em;
    line-height: 0.9;
    float: left;
    margin: 0.1em 0.1em 0 0;
    font-weight: 700;
    color: #222;
}

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

.bb-custom-wrapper nav {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    pointer-events: none;
}

.bb-custom-wrapper nav span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    font-size: 24px;
    color: #fff;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: all;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.bb-custom-wrapper nav span:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

#bb-nav-prev {
    left: 15px;
}

#bb-nav-next {
    right: 15px;
}

/* =====================================================
   TOC TOGGLE BUTTON
   ===================================================== */

#tblcontents {
    position: absolute;
    top: 40px;
    left: 40px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

#tblcontents:hover,
#tblcontents.hovered {
    background: rgba(0, 0, 0, 0.9);
}

#tblcontents i {
    font-size: 14px;
}

#tblcontents span {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.icon-search::before {
    content: "☰";
}

.close-icon-color::before {
    content: "✕";
}

@media (max-width: 768px) {
    #tblcontents {
        top: 20px;
        left: 20px;
        padding: 10px 20px;
    }
    
    #tblcontents span {
        display: none;
    }
}

/* =====================================================
   CLOSE BUTTON
   ===================================================== */

.bb-nav-close {
    position: absolute;
    top: 40px;
    right: 40px;
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.bb-nav-close:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: rotate(90deg);
}

.bb-nav-close i {
    color: #fff;
    font-size: 20px;
    font-weight: 300;
}

@media (max-width: 768px) {
    .bb-nav-close {
        top: 20px;
        right: 20px;
    }
}

/* =====================================================
   BUTTON STYLING
   ===================================================== */

.btn.is-page-flip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    background: #222;
    color: #c013a1;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn.is-page-flip:hover {
    background: #c013a1;
    color: #222;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px #c013a1;
}

.btn.is-page-flip i {
    font-size: 18px;
}

.icon-book-open::before {
    content: "📖";
}

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

.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

@media (max-width: 1024px) {
    .menu-panel {
        width: 250px;
    }
    
    .book-container.slideRight .bb-custom-wrapper {
        transform: translateX(250px);
    }
}

@media (max-width: 768px) {
    .menu-panel {
        width: 100%;
        transform: translateY(-100%);
    }
    
    .book-container.slideRight .menu-panel {
        transform: translateY(0);
    }
    
    .book-container.slideRight .bb-custom-wrapper {
        transform: translateY(100%);
    }
    
    .bb-custom-wrapper nav span {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    #bb-nav-prev {
        left: 5px;
    }
    
    #bb-nav-next {
        right: 5px;
    }
}
/* Table of Contents Button nur auf Desktop */
@media (max-width: 1024px) {
    #tblcontents {
        display: none !important;
    }
}
/* =====================================================
   PRINT
   ===================================================== */

@media print {
    .book-container {
        position: static;
        opacity: 1;
        visibility: visible;
    }
    
    .menu-panel,
    .bb-custom-wrapper nav,
    #tblcontents,
    .bb-nav-close {
        display: none !important;
    }
}