body {
    margin: 0;
    padding: 0;
    background: #1a1a1a;
    color: white;
    font-family: Arial, sans-serif;
    overflow: hidden;
}

.manga-container {
    perspective: 3000px;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.manga-page-wrapper {
    width: 100%;
    height: 100vh;
    position: relative;
    transform-style: preserve-3d;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.manga-page {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: absolute;
    transform-origin: right;
    transition: transform 1s cubic-bezier(0.645, 0.045, 0.355, 1.000);
    backface-visibility: hidden;
    margin: 0;
    padding: 0;
}

@keyframes turnPageForward {
    0% {
        transform: rotateY(0deg);
        transform-origin: right;
    }

    100% {
        transform: rotateY(180deg);
        transform-origin: right;
    }
}

@keyframes turnPageBackward {
    0% {
        transform: rotateY(180deg);
        transform-origin: right;
    }

    100% {
        transform: rotateY(0deg);
        transform-origin: right;
    }
}

.page-turn-forward {
    animation: turnPageForward 1.5s cubic-bezier(0.645, 0.045, 0.355, 1.000) forwards;
}

.page-turn-backward {
    animation: turnPageBackward 1.5s cubic-bezier(0.645, 0.045, 0.355, 1.000) forwards;
}

.manga-page.cover {
    transform-origin: right !important;
    position: relative;
    width: auto;
    max-height: 98vh;
    display: block;
    margin: 0 auto;
}

.nav-buttons {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 20px;
}

button {
    padding: 10px 20px;
    margin: 0 5px;
    cursor: pointer;
    background: #444;
    border: none;
    color: white;
    border-radius: 5px;
    transition: background 0.3s;
}


#loadingIndicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 10px;
    z-index: 2000;
}

.hidden {
    display: none;
}


.page-half {
    position: absolute;
    width: 50%;
    height: 100%;
    overflow: hidden;
}

.page-left {
    left: 0;
}

.page-right {
    right: 0;
}

.flip-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    perspective: 2000px;
    z-index: 10;
}


.flip-page {
    position: absolute;
    width: 50%;
    height: 100%;
    left: 0;
    transform-origin: right center;
    transition: transform 0.8s cubic-bezier(0.645, 0.045, 0.355, 1.000);
    transform-style: preserve-3d;
    backface-visibility: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.flip-page-cover {
    width: 100%;
}

.flip-page-front,
.flip-page-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    overflow: hidden;
}

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


.flip-page.flipped {
    transform: rotateY(180deg);
}

.page-content {
    position: absolute;
    width: 200%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.left-content {
    left: 0;
}

.right-content {
    left: -100%;
}

.cover-content {
    width: 100%;
    background-size: contain;
    background-position: center;
}


.static-page-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}


.right-side-overlay {
    position: absolute;
    top: 0;
    left: 50%;
    width: 50%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
    overflow: hidden;
}


.right-half-image {
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    object-fit: contain;
}


.left-side-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
    overflow: hidden;
}


.left-half-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    object-fit: contain;
}

.settings-btn {
    position: fixed;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px 12px;
    cursor: pointer;
    z-index: 1500;
    font-size: 14px;
}

.settings-panel {
    position: fixed;
    top: 60px;
    right: 15px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 8px;
    padding: 15px;
    z-index: 1500;
    width: 300px;
    display: none;
}

.settings-panel input {
    width: 100%;
    padding: 8px;
    margin: 8px 0;
    border-radius: 4px;
    border: 1px solid #666;
    background: #333;
    color: white;
}

.settings-panel button {
    margin-top: 10px;
    background: #444;
    transition: background 0.3s;
}

.settings-panel button:hover {
    background: #666;
}
