/* ===== InteractiveBook Component Styles ===== */

.interactive-book {
    max-width: 800px;
    margin: 2rem auto 1.2rem auto;
    padding: 0;
    position: relative;
    font-family: 'Georgia', 'Times New Roman', serif;
    perspective: 2000px;
}

.book-inner {
    position: relative;
    transform-style: preserve-3d;
    perspective: 2000px;
}

.book-container {
    position: relative;
    width: 100%;
    max-width: 750px;
    margin: 0 auto;
    background: transparent;
    /* Verhindert Überlauf unter Header/Footer */
    max-height: calc(100vh - var(--header-h) - var(--footer-h) - 140px);
    min-height: 450px;
    transform-style: preserve-3d;
}

.book-spine {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, rgba(18,18,18,0.4) 0%, rgba(13,13,13,0.6) 50%, rgba(18,18,18,0.4) 100%);
    transform: translateX(-50%);
    z-index: 1;
    border-radius: 2px;
    box-shadow: inset 1px 0 2px rgba(0,0,0,0.2), inset -1px 0 2px rgba(0,0,0,0.2);
    pointer-events: none;
}

.book-cover {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 500px;
    min-height: 500px;
    max-height: 500px;
    background: transparent;
    position: relative;
    transition: box-shadow .4s ease;
    transform-style: preserve-3d;
    border-radius: 8px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5), 0 10px 20px rgba(0,0,0,.4);
    overflow: hidden;
}

/* Mobile: Text oben, Bild unten (Buch im Querformat gestapelt) */
@media (max-width: 768px) {
    .interactive-book {
        margin: 1rem auto;
        padding: 0 1rem;
    }
    .book-container {
        max-height: none;
        min-height: unset;
    }
    .book-spine,
    .page-edges,
    .stack-layer { display: none !important; }
    .book-cover {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: unset;
        max-height: none;
        box-shadow: 0 15px 35px rgba(0,0,0,0.4); /* GEÄNDERT: Schatten behalten */
        background: transparent;
        border-radius: 8px;
    }
    .book-page {
        border: none !important;
        box-shadow: none !important;
        /* GEÄNDERT: Gleiche Farben wie Desktop statt weiß */
        background: linear-gradient(to bottom, #fefefe, #fafafa) !important;
        background-image: linear-gradient(to bottom, rgba(255,255,255,0.98), rgba(250,250,250,0.98)),
            radial-gradient(circle at 30% 30%, rgba(0,0,0,0.015) 0%, rgba(0,0,0,0) 60%) !important;
        padding: 1.5rem 1rem !important;
        width: 100% !important;
        border-radius: 8px;
        margin-bottom: 0.5rem;
        justify-content: center !important; /* Zentriert */
        align-items: center !important;
    }
    .book-page::before { display: none !important; }
    
    /* Text zuerst (linke Seite) */
    .left-page { 
        order: 1; 
        min-height: 150px;
        /* GEÄNDERT: Gleiche Farbe wie Desktop */
        background: linear-gradient(to right, #ffffff 0%, #fafafa 100%) !important;
    }
    
    /* Bild danach (rechte Seite) */
    .right-page { 
        order: 2;
        display: flex !important;
        align-items: center;
        justify-content: center;
        min-height: 250px;
        /* GEÄNDERT: Gleiche Farbe wie Desktop */
        background: linear-gradient(to left, #ffffff 0%, #fafafa 100%) !important;
    }
    
    .page-content {
        width: 100%;
        overflow-y: visible;
        justify-content: center;
        align-items: center;
    }
    
    .page-text { 
        padding: 0;
        width: 100%;
    }
    
    .page-title {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }
    
    .page-body {
        font-size: 1rem;
        line-height: 1.7;
    }
    
    .page-image { 
        width: 100%; 
        height: auto;
        max-width: 100%;
        margin: auto;
    }
    
    .page-image img { 
        width: 100%;
        height: auto;
        max-height: 60vh; 
        object-fit: contain;
        border-radius: 8px;
        margin: auto;
    }
    
    .book-controls { 
        margin-top: 1rem;
        padding: 0 1rem;
    }
    
    .page-dots {
        margin-top: 1rem;
    }
}

/* Papierstapel-Kanten links/rechts - dezent */
.page-edges { position:absolute; top:12px; bottom:12px; width:10px; z-index:2; pointer-events:none; }
.page-edges.left { left: calc(50% - 5px); background: repeating-linear-gradient(to right, #ebebeb, #ebebeb 1px, #f6f6f6 1px, #f6f6f6 2px); box-shadow: inset -2px 0 4px rgba(0,0,0,0.04), -1px 0 3px rgba(0,0,0,0.02); }
.page-edges.right { right: calc(50% - 5px); background: repeating-linear-gradient(to left, #ebebeb, #ebebeb 1px, #f6f6f6 1px, #f6f6f6 2px); box-shadow: inset 2px 0 4px rgba(0,0,0,0.04), 1px 0 3px rgba(0,0,0,0.02); }

/* Sichtbare Stapelschichten - dezente Tiefe */
.stack-layer { 
    position:absolute; 
    top:8px; 
    bottom:8px; 
    width:48%; 
    left:0.5%; 
    border-radius:8px; 
    pointer-events:none; 
    background:linear-gradient(to right,#fcfcfc,#f5f5f5); 
    box-shadow:0 0 0 1px rgba(0,0,0,0.04), 2px 0 4px -1px rgba(0,0,0,0.05); 
    opacity:.7;
    transform-style: preserve-3d;
}
.stack-layer.depth1 { 
    top:10px; 
    bottom:10px; 
    z-index: 1;
    filter:brightness(0.99); 
}
.stack-layer.depth2 { 
    top:13px; 
    bottom:13px; 
    z-index: 1;
    filter:brightness(0.98); 
    box-shadow:0 0 0 1px rgba(0,0,0,0.03), 1px 0 3px -1px rgba(0,0,0,0.04); 
}
.stack-layer.depth3 { 
    top:16px; 
    bottom:16px; 
    z-index: 1;
    filter:brightness(0.97); 
    box-shadow:0 0 0 1px rgba(0,0,0,0.02), 1px 0 2px -1px rgba(0,0,0,0.03); 
}
.stack-layer.depth4 { 
    top:19px; 
    bottom:19px; 
    z-index: 1;
    filter:brightness(0.96); 
    box-shadow:0 0 0 1px rgba(0,0,0,0.02); 
}
.stack-layer:nth-of-type(2){ left:auto; right:0.5%; background:linear-gradient(to left,#fcfcfc,#f5f5f5); }
.stack-layer:nth-of-type(3){ left:auto; right:0.5%; }
.stack-layer:nth-of-type(4){ left:auto; right:0.5%; display:block; }

.interactive-book:hover .book-cover {
    box-shadow: 0 30px 55px rgba(0,0,0,0.55), 0 15px 25px rgba(0,0,0,.45);
}

.book-page {
    padding: 2rem;
    position: relative;
    background: #fefefe;
    display: flex;
    flex-direction: column;
    justify-content: center; /* GEÄNDERT: Inhalt vertikal zentrieren */
    align-items: center; /* Inhalt horizontal zentrieren */
    overflow: hidden;
    backface-visibility: hidden;
    border-radius: 8px;
    z-index: 10;
    background-image: linear-gradient(to bottom, rgba(255,255,255,0.98), rgba(250,250,250,0.98)),
        radial-gradient(circle at 30% 30%, rgba(0,0,0,0.015) 0%, rgba(0,0,0,0) 60%);
    background-blend-mode: normal, multiply;
}

.left-page {
    border-right: 1px solid rgba(200,200,200,0.3);
    background: linear-gradient(to right, #ffffff 0%, #fafafa 100%);
    box-shadow: inset -8px 0 12px rgba(0,0,0,0.04);
    align-items: center;
    justify-content: center; /* Vertikal zentrieren */
}

.right-page {
    border-left: 1px solid rgba(200,200,200,0.3);
    background: linear-gradient(to left, #ffffff 0%, #fafafa 100%);
    align-items: center;
    justify-content: center; /* Vertikal zentrieren */
    box-shadow: inset 8px 0 12px rgba(0,0,0,0.04);
}

/* Flip-Animation Layer */
.page-turner {
    position:absolute;
    top:0;left:50%;
    width:48%;
    height:100%;
    transform-origin:left center;
    transform: translateX(0) rotateY(0deg);
    pointer-events:none;
    z-index:5;
    opacity:0;
    visibility:hidden;
    transform-style:preserve-3d;
}

/* Ausrichtung abhängig von Richtung */
.page-turner.from-right { left:50%; transform-origin:left center; }
.page-turner.from-left { left:0; transform-origin:right center; }

@keyframes flipForward {
    0%   { transform: rotateY(0deg) skewY(0deg) scale(1);   box-shadow:0 12px 28px rgba(0,0,0,0.28); }
    15%  { transform: rotateY(-25deg) skewY(-0.8deg) scale(1.01); box-shadow:0 20px 40px rgba(0,0,0,0.38); }
    35%  { transform: rotateY(-65deg) skewY(-1.6deg) scale(1.02); box-shadow:0 30px 50px rgba(0,0,0,0.48); }
    60%  { transform: rotateY(-120deg) skewY(-0.8deg) scale(1.01); box-shadow:0 24px 42px rgba(0,0,0,0.40); }
    85%  { transform: rotateY(-165deg) skewY(-0.2deg) scale(1); box-shadow:0 14px 26px rgba(0,0,0,0.32); }
    100% { transform: rotateY(-180deg) skewY(0deg) scale(1); box-shadow:0 8px 18px rgba(0,0,0,0.30); }
}
@keyframes flipBack {
    0%   { transform: rotateY(0deg) skewY(0deg) scale(1);   box-shadow:0 12px 28px rgba(0,0,0,0.28); }
    15%  { transform: rotateY(25deg) skewY(0.8deg) scale(1.01);  box-shadow:0 20px 40px rgba(0,0,0,0.38); }
    35%  { transform: rotateY(65deg) skewY(1.6deg) scale(1.02);  box-shadow:0 30px 50px rgba(0,0,0,0.48); }
    60%  { transform: rotateY(120deg) skewY(0.8deg) scale(1.01);  box-shadow:0 24px 42px rgba(0,0,0,0.40); }
    85%  { transform: rotateY(165deg) skewY(0.2deg) scale(1);  box-shadow:0 14px 26px rgba(0,0,0,0.32); }
    100% { transform: rotateY(180deg) skewY(0deg) scale(1);  box-shadow:0 8px 18px rgba(0,0,0,0.30); }
}

.page-turner .flip-face { position:absolute; inset:0; background:linear-gradient(to right,#fafafa 0%,#f5f5f5 45%,#eeeeee 65%,#e7e7e7 100%), repeating-linear-gradient(-45deg, rgba(0,0,0,0.02) 0px, rgba(0,0,0,0.02) 1px, rgba(0,0,0,0) 2px, rgba(0,0,0,0) 4px); background-blend-mode:normal,multiply; backface-visibility:hidden; display:flex; align-items:center; justify-content:center; }
.page-turner .flip-face.back { transform:rotateY(180deg); }
.page-turner .flip-face .page-image { width:100%; height:100%; }
.page-turner .flip-face .page-image img { max-width:100%; max-height:100%; object-fit:contain; }
.page-turner .flip-face .page-text { width:100%; height:100%; display:flex; flex-direction:column; justify-content:center; padding:2.2rem; }
.page-turner .flip-face .page-title { font-size:1.3rem; margin:0 0 .9rem 0; color:#4da3ff; }
.page-turner .flip-face .page-body { font-size:.85rem; color:#555; }
.page-turner.pro-flip-forward, .page-turner.pro-flip-back { box-shadow:0 14px 32px rgba(0,0,0,0.32); }
.page-turner.pro-flip-forward::after, .page-turner.pro-flip-back::after { content:""; position:absolute; top:0; bottom:0; left:0; width:4px; background:linear-gradient(to right,rgba(0,0,0,0.15),rgba(0,0,0,0)); pointer-events:none; }

@keyframes proFlipForward { 
    0%{ transform:rotateY(0deg) scale(1); box-shadow:0 14px 30px rgba(0,0,0,0.28);} 
    20%{ transform:rotateY(-30deg) scale(1.01); box-shadow:0 22px 42px rgba(0,0,0,0.38);} 
    45%{ transform:rotateY(-90deg) scale(1.02); box-shadow:0 30px 54px rgba(0,0,0,0.46);} 
    70%{ transform:rotateY(-145deg) scale(1.01); box-shadow:0 20px 38px rgba(0,0,0,0.36);} 
    100%{ transform:rotateY(-180deg) scale(1); box-shadow:0 8px 18px rgba(0,0,0,0.3);} 
}
@keyframes proFlipBack { 
    0%{ transform:rotateY(0deg) scale(1); box-shadow:0 14px 30px rgba(0,0,0,0.28);} 
    20%{ transform:rotateY(30deg) scale(1.01); box-shadow:0 22px 42px rgba(0,0,0,0.38);} 
    45%{ transform:rotateY(90deg) scale(1.02); box-shadow:0 30px 54px rgba(0,0,0,0.46);} 
    70%{ transform:rotateY(145deg) scale(1.01); box-shadow:0 20px 38px rgba(0,0,0,0.36);} 
    100%{ transform:rotateY(180deg) scale(1); box-shadow:0 8px 18px rgba(0,0,0,0.3);} 
}

.page-turner.pro-flip-forward { animation: proFlipForward var(--flip-duration,900ms) ease-in-out forwards; opacity:1; visibility:visible; }
.page-turner.pro-flip-back { animation: proFlipBack var(--flip-duration,900ms) ease-in-out forwards; opacity:1; visibility:visible; }

.left-page::before, .right-page::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 18px;
    pointer-events: none;
    z-index: 2;
}

.left-page::before {
    right: 0;
    background: linear-gradient(to left, rgba(0,0,0,0.08), rgba(0,0,0,0));
}

.right-page::before {
    left: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.08), rgba(0,0,0,0));
}

.page-content {
    width: 100%;
    height: auto; /* GEÄNDERT: Auto statt 100% für bessere Zentrierung */
    display: flex;
    flex-direction: column;
    justify-content: center; /* GEÄNDERT: Vertikal zentrieren */
    align-items: center; /* Horizontal zentrieren */
    overflow-y: auto;
    overflow-x: hidden;
}

.page-content::-webkit-scrollbar {
    width: 6px;
}

.page-content::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05);
    border-radius: 3px;
}

.page-content::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 3px;
}

.page-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.3);
}

.page-text {
    line-height: 1.6;
    color: #5a5a5a;
    width: 100%;
    max-width: 100%;
}

.page-title {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0 0 0.8rem 0;
    color: #666;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: .4rem;
    font-family: 'Segoe UI', Arial, sans-serif;
    letter-spacing: 0.3px;
}

.page-body {
    font-size: 0.85rem;
    color: #707070;
}

.page-body h2 {
    font-size: 1rem;
    color: #666;
    margin: 1rem 0 0.7rem;
    font-weight: 500;
}

.page-body h3 {
    font-size: 0.9rem;
    color: #707070;
    margin: 0.8rem 0 0.5rem;
    font-weight: 500;
}

.page-body p {
    margin-bottom: 0.8rem;
    text-align: left;
    line-height: 1.6;
}

.page-body ul, .page-body ol {
    margin: 0.8rem 0;
    padding-left: 1.5rem;
}

.page-body li {
    margin-bottom: 0.4rem;
    color: #707070;
    line-height: 1.5;
    font-size: 0.8rem;
}

.page-body strong {
    color: #888;
    font-weight: 600;
}

.bullet-point {
    margin-bottom: 0.4rem;
    padding-left: 0.5rem;
    color: #707070;
    font-size: 0.8rem;
}

.page-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin: auto; /* HINZUGEFÜGT: Zentriert das Bild vertikal und horizontal */
}

.page-image img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    border-radius: 6px;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    margin: auto; /* HINZUGEFÜGT: Zentriert das Bild */
}

.page-image img:hover {
    transform: scale(1.01);
}

.page-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    opacity: 0;
    pointer-events: none;
    z-index: 5;
    transform-style: preserve-3d;
    transition: opacity 0.4s ease;
}

.page-overlay.active {
    opacity: 1;
}

/* Page turning animations */
.book-cover.turning-next {
    transform: rotateY(-15deg);
}

.book-cover.turning-prev {
    transform: rotateY(15deg);
}

.turning-next .right-page {
    transform: rotateY(-180deg);
}

.turning-prev .left-page {
    transform: rotateY(180deg);
}

/* Navigation Controls */
.book-controls {
    display:flex;
    align-items:center;
    justify-content:center;
    gap:1.8rem;
    margin:1.2rem auto .8rem auto;
    padding:.4rem .5rem .2rem .5rem;
}

.nav-btn {
    display:flex;
    align-items:center;
    justify-content:center;
    width:46px;
    height:46px;
    border:1px solid rgba(255,255,255,0.15);
    background:#181818;
    color:#4da3ff;
    border-radius:50%;
    cursor:pointer;
    transition:all .28s ease;
    font-size:0;
    box-shadow:0 3px 8px rgba(0,0,0,0.4);
}

.nav-btn:hover:not(:disabled){
    background:#262626;
    color:#4da3ff;
    transform:translateY(-3px);
    box-shadow:0 6px 18px rgba(0,0,0,0.55);
}

.nav-btn:active:not(:disabled) {
    transform: translateY(0);
}

.nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: #bdc3c7;
    color: #bdc3c7;
}

.nav-btn svg {
    width: 24px;
    height: 24px;
}

.page-indicator {
    display:flex;
    align-items:center;
    gap:.5rem;
    padding:.55rem 1.2rem;
    background:#141414;
    border-radius:24px;
    border:1px solid rgba(255,255,255,0.12);
    font-weight:600;
    color:#d0d7dd;
    box-shadow:0 4px 14px rgba(0,0,0,0.45);
    font-size:.8rem;
}

.current-page { color:#4da3ff; font-size:1rem; }
.inline-actions {
    display:flex;
    justify-content:center;
    gap:.75rem;
    margin:.4rem auto 0 auto;
    padding:.3rem 0 1.2rem 0;
}
.inline-actions .btn { margin:0 .3rem; }
.mini-actions .mini-btn {
    font-size:.65rem;
    padding:.35rem .55rem;
    background:#111;
    color:#d0d7dd;
    border:1px solid rgba(255,255,255,0.18);
    border-radius:6px;
    text-decoration:none;
    letter-spacing:.5px;
    transition:background .25s ease, transform .25s ease;
}
.mini-actions .mini-btn:hover { background:#1b1b1b; transform:translateY(-2px); color:#4da3ff; }
.mini-actions .mini-btn:active { transform:translateY(0); }

.page-image.placeholder { display:flex; align-items:center; justify-content:center; background:#222; color:#888; font-size:.8rem; border:1px dashed #444; border-radius:8px; }

/* Page Dots */
.page-dots {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.page-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #bdc3c7;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.page-dot:hover {
    border-color: #3498db;
    transform: scale(1.2);
}

.page-dot.active {
    background: #3498db;
    border-color: #3498db;
}

.page-dot:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Autoplay Toggle - versteckt */
.autoplay-toggle {
    display: none !important;
}

/* Error State */
.interactive-book.error {
    text-align: center;
    padding: 4rem 2rem;
}

.error-message {
    max-width: 500px;
    margin: 0 auto;
}

.error-message h2 {
    color: #e74c3c;
    margin-bottom: 1rem;
}

.error-message p {
    color: #666;
    margin-bottom: 2rem;
}

.retry-btn {
    padding: 0.75rem 2rem;
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease;
}

.retry-btn:hover {
    background: #2980b9;
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles */
.interactive-book *:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* High contrast mode support (use 'more' for broader browser compatibility) */
@media (prefers-contrast: more) {
    .book-container {
        border: 2px solid #000;
    }
    
    .page-title {
        border-bottom-color: #000;
    }
    
    .nav-btn {
        border-color: #000;
        color: #000;
    }
    
    .nav-btn:hover:not(:disabled) {
        background: #000;
        color: #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .book-cover,
    .nav-btn,
    .page-dot,
    .autoplay-toggle,
    .page-image img {
        transition: none;
    }
    
    .book-cover.turning-next,
    .book-cover.turning-prev {
        transform: none;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .interactive-book {
        padding: 0.5rem;
        margin: 1.5rem auto 1rem auto;
    }
    
    .book-container {
        max-width: 100%;
    }
    
    .book-cover { 
        grid-template-columns: 1fr; 
        grid-template-rows: 1fr; 
        height: auto;
        min-height: 400px;
        max-height: none;
    }
    
    .book-spine {
        display: none;
    }
    
    .stack-layer {
        display: none;
    }
    
    .page-edges {
        display: none;
    }
    
    .left-page,
    .right-page {
        border: 1px solid #e0e0e0;
        background: #fefefe;
        border-radius: 8px;
        min-height: 400px;
        max-height: 600px;
    }
    
    .right-page {
        display: none;
    }
    
    .left-page {
        grid-column: 1;
        grid-row: 1;
        border-right: none;
    }
    
    .book-page { 
        padding: 1.5rem;
    }
    
    .page-title {
        font-size: 1rem;
    }
    
    .page-body {
        font-size: 0.85rem;
    }

    .page-image { 
        min-height: auto;
        max-height: 300px;
    }
    
    .page-image img { 
        max-height: 300px;
        object-fit: cover;
        width: 100%;
    }
    
    .page-content {
        overflow-y: auto;
        max-height: 550px;
    }
    
    .book-controls {
        gap: 0.8rem;
        margin-top: 1rem;
        padding: 0.5rem;
    }
    
    .nav-btn {
        width: 36px;
        height: 36px;
    }
    
    .nav-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .page-indicator {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .page-dots {
        margin-top: 1rem;
        gap: 0.5rem;
    }
    
    .page-dot {
        width: 8px;
        height: 8px;
    }
}

@media (max-width: 480px) {
    .interactive-book {
        margin: 1rem auto 1rem auto;
        padding: 0.25rem;
    }
    
    .book-cover {
        min-height: 350px;
    }
    
    .book-page {
        padding: 1rem;
    }
    
    .left-page,
    .right-page {
        min-height: 350px;
        max-height: 500px;
    }
    
    .page-title {
        font-size: 0.95rem;
        margin-bottom: 0.7rem;
    }
    
    .page-body { 
        font-size: 0.8rem;
    }
    
    .page-body h2 {
        font-size: 0.9rem;
    }
    
    .page-body h3 {
        font-size: 0.85rem;
    }
    
    .page-body li {
        font-size: 0.75rem;
    }
    
    .page-image { 
        min-height: auto;
        max-height: 250px;
    }
    
    .page-image img { 
        max-height: 250px;
        object-fit: cover;
    }
    
    .page-content {
        max-height: 450px;
    }
    
    .book-controls {
        flex-direction: row;
        gap: 0.6rem;
        margin-top: 0.8rem;
    }
    
    .nav-btn {
        width: 32px;
        height: 32px;
    }
    
    .nav-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .page-indicator {
        padding: 0.35rem 0.7rem;
        font-size: 0.75rem;
    }
    
    .page-dots {
        gap: 0.4rem;
    }
    
    .page-dot {
        width: 7px;
        height: 7px;
    }
}

/* Print styles */
@media print {
    .interactive-book {
        box-shadow: none;
    }
    
    .book-controls,
    .page-dots,
    .autoplay-toggle {
        display: none;
    }
    
    .book-cover {
        display: block;
    }
    
    .book-page {
        page-break-inside: avoid;
        break-inside: avoid;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .interactive-book {
        color: #e0e0e0;
    }
    
    .book-container {
        background: linear-gradient(145deg, #2c2c2c, #1e1e1e);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    }
    
    .book-page {
        background: #2a2a2a;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .left-page {
        background: linear-gradient(to right, #2a2a2a 0%, #242424 100%);
    }
    
    .right-page {
        background: linear-gradient(to left, #2a2a2a 0%, #242424 100%);
    }
    
    .page-title {
        color: #64b5f6;
        border-bottom-color: #64b5f6;
    }
    
    .page-body {
        color: #b0b0b0;
    }
    
    .page-body h2 {
        color: #81c784;
    }
    
    .page-body h3 {
        color: #64b5f6;
    }
    
    .page-body strong {
        color: #ff7043;
    }
    
    .nav-btn {
        background: #2a2a2a;
        border-color: #64b5f6;
        color: #64b5f6;
    }
    
    .nav-btn:hover:not(:disabled) {
        background: #64b5f6;
        color: #2a2a2a;
    }
    
    .page-indicator {
        background: #2a2a2a;
        border-color: #444;
        color: #b0b0b0;
    }
    
    .current-page {
        color: #64b5f6;
    }
    
    .autoplay-toggle {
        background: #2a2a2a;
        border-color: #81c784;
        color: #81c784;
    }
    
    .autoplay-toggle:hover {
        background: #81c784;
        color: #2a2a2a;
    }
}