.carousel-section {
    position: relative;
    background: linear-gradient(135deg, #2d1b69 0%, #11998e 100%);
    min-height: 100vh;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.carousel-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.floating-elements {
    position: absolute;
    width: 100%;
    height: 100%;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.3;
    animation: floatUpDown 8s ease-in-out infinite;
}

.shape-1 {
    width: 6px;
    height: 6px;
    background: linear-gradient(45deg, #f4d03f, #f7dc6f);
    animation-duration: 6s;
}

.shape-2 {
    width: 8px;
    height: 8px;
    background: linear-gradient(45deg, #85c1e9, #5dade2);
    animation-duration: 8s;
}

.shape-3 {
    width: 4px;
    height: 4px;
    background: linear-gradient(45deg, #f8c471, #f5b041);
    animation-duration: 10s;
}

@keyframes floatUpDown {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.6;
    }
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.2;
    animation: orbFloat 20s ease-in-out infinite alternate;
}

.orb-1 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(244, 208, 63, 0.4), transparent);
    top: 15%;
    left: 15%;
    animation-delay: 0s;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(133, 193, 233, 0.3), transparent);
    bottom: 15%;
    right: 15%;
    animation-delay: 7s;
}

.orb-3 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(248, 196, 113, 0.3), transparent);
    top: 60%;
    right: 40%;
    animation-delay: 14s;
}

@keyframes orbFloat {
    0% {
        transform: translate(0, 0) scale(1);
    }
    100% {
        transform: translate(30px, -20px) scale(1.1);
    }
}

.carousel-title, .carousel-subtitle {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.carousel-section.is-active .carousel-title.revealed,
.carousel-section.is-active .carousel-subtitle.revealed {
    opacity: 1;
    transform: translateY(0);
}

.simple-book {
    position: relative;
    width: 500px;
    height: 350px;
    perspective: 1200px;
    margin: 0 auto;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.3));
    transform-style: preserve-3d;
    will-change: transform;
}

.book-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    border-radius: 15px;
    z-index: 50;
    opacity: 1;
    visibility: visible;
    perspective: 1200px;
    transform-style: preserve-3d;
    will-change: transform;
}

.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(135deg, #fdfefe 0%, #f8f9fa 100%),
        radial-gradient(circle at 10% 20%, rgba(102, 126, 234, 0.05), transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(118, 75, 162, 0.05), transparent 50%);
    border-radius: 15px;
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(102, 126, 234, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    padding: 3rem;
    box-sizing: border-box;
    transform-origin: left center;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s ease;
    z-index: 1;
    overflow: hidden;
    backface-visibility: visible;
    opacity: 0;
    visibility: visible;
    cursor: pointer;
    will-change: transform;
    pointer-events: none;
}

.page .page-decoration {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    border: 1px solid rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    pointer-events: none;
    z-index: 0;
}

.page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(135deg, #fdfefe 0%, #f8f9fa 100%),
        radial-gradient(circle at 10% 20%, rgba(102, 126, 234, 0.05), transparent 50%);
    border-radius: 15px;
    backface-visibility: hidden;
    z-index: -1;
}

.page::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(135deg, #e8eaf6 0%, #c5cae9 100%),
        radial-gradient(circle at 50% 50%, rgba(102, 126, 234, 0.1), transparent 70%);
    border-radius: 15px;
    transform: rotateY(180deg);
    backface-visibility: hidden;
    z-index: -2;
    box-shadow: inset 0 0 50px rgba(102, 126, 234, 0.2);
}

.page.behind::after {
    background: 
        linear-gradient(135deg, #d1c4e9 0%, #b39ddb 100%),
        radial-gradient(circle at 50% 50%, rgba(102, 126, 234, 0.2), transparent 70%);
    box-shadow: 
        inset 0 0 50px rgba(102, 126, 234, 0.3),
        0 0 20px rgba(102, 126, 234, 0.2);
}

.page.behind {
    z-index: 5;
    transform: rotateY(-180deg);
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: auto;
}

.page.active {
    z-index: 10;
    opacity: 1;
    pointer-events: auto;
}

.page.behind:hover {
    opacity: 1;
    transform: rotateY(-180deg) scale(1.02);
    cursor: pointer;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.page.active {
    z-index: 10;
    transform: rotateY(0deg);
}

.page.active:hover {
    transform: rotateY(0deg) scale(1.01);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.page:not(.active):not(.behind) {
    z-index: 3;
    transform: rotateY(0deg);
}

.page h4 {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    position: relative;
}

.page h4::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 2px;
}

.page p {
    font-size: 1.2rem;
    color: #444;
    line-height: 1.8;
    font-weight: 400;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    margin: 0 auto;
}

.book-nav {
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 10px 25px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
    z-index: 30;
}

.book-nav button {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    font-weight: bold;
}

.book-nav button:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.book-nav button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.book-nav button:disabled:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    transform: none;
    box-shadow: none;
}

#pageIndicator {
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    min-width: 60px;
    text-align: center;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    letter-spacing: 1px;
}

.section-indicator {
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
    letter-spacing: 2px;
    z-index: 10;
}

.indicator-text {
    margin-bottom: 1rem;
}

.indicator-line {
    width: 2px;
    height: 60px;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.6), transparent);
    margin: 0 auto;
}

@media screen and (max-width: 768px) {
    .simple-book {
        width: 350px;
        height: 280px;
        will-change: transform;
    }
    
    .book-cover h3 {
        font-size: 2rem;
    }
    
    .book-cover p {
        font-size: 1rem;
    }
    
    .page {
        padding: 2rem;
        transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    
    .page h4 {
        font-size: 1.8rem;
    }
    
    .page p {
        font-size: 1.1rem;
    }
    
    .section-indicator {
        display: none;
    }
    
    .page.flipping-forward {
        animation: pageFlipForward 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    }

    .page.flipping-backward {
        animation: pageFlipBackward 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    }
}

@media screen and (max-width: 480px) {
    .simple-book {
        width: 280px;
        height: 220px;
    }
    
    .page {
        padding: 1.5rem;
    }
    
    .book-cover h3 {
        font-size: 1.8rem;
    }
    
    .book-cover p {
        font-size: 0.9rem;
    }
    
    .cover-hint {
        font-size: 0.8rem;
    }
}

.book-cover {
    background: 
        linear-gradient(135deg, #667eea 0%, #764ba2 100%),
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.1), transparent 60%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.08), transparent 50%);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.book-cover::before {
    background: 
        linear-gradient(135deg, #667eea 0%, #764ba2 100%),
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.1), transparent 60%);
}

.book-cover::after {
    background: 
        linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.05), transparent 70%);
    box-shadow: inset 0 0 50px rgba(102, 126, 234, 0.4);
}

.book-cover.behind::after {
    background: 
        linear-gradient(135deg, #4c51bf 0%, #553c9a 100%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.08), transparent 70%);
    box-shadow: 
        inset 0 0 50px rgba(102, 126, 234, 0.5),
        0 0 20px rgba(102, 126, 234, 0.3);
}

.book-cover h3 {
    font-size: 2.8rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
    background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.book-cover p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.3rem;
    line-height: 1.6;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
}

.cover-decoration {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    pointer-events: none;
    z-index: 0;
}

.cover-hint {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    font-weight: 600;
    animation: pulseHint 2s infinite;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

@keyframes pulseHint {
    0%, 100% {
        opacity: 0.8;
        transform: translateX(-50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateX(-50%) scale(1.05);
    }
}

.page.flipping-forward {
    animation: pageFlipForward 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.page.flipping-backward {
    animation: pageFlipBackward 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes pageFlipForward {
    0% {
        transform: rotateY(0deg);
        z-index: 25;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    }
    50% {
        transform: rotateY(-90deg);
        z-index: 25;
        box-shadow: 0 25px 45px rgba(0, 0, 0, 0.6);
    }
    100% {
        transform: rotateY(-180deg);
        z-index: 5;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    }
}

@keyframes pageFlipBackward {
    0% {
        transform: rotateY(-180deg);
        z-index: 25;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    }
    50% {
        transform: rotateY(-90deg);
        z-index: 25;
        box-shadow: 0 25px 45px rgba(0, 0, 0, 0.6);
    }
    100% {
        transform: rotateY(0deg);
        z-index: 10;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    }
}
