* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: transparent;
}

.viewer-container {
    max-width: 100%;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.book-viewer {
    perspective: 2000px;
    padding: 20px;
    min-height: 800px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.page-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 750px;
}

.page {
    position: absolute;
    width: 100%;
    height: 100%;
    background: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border-radius: 5px;
    transform-style: preserve-3d;
    transition: transform 0.8s ease;
    cursor: pointer;
}

.page-content {
    width: 100%;
    height: 100%;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.page-content img {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 85%;
    object-fit: contain;
    transition: transform 0.3s ease;
    cursor: zoom-in;
}

.page-content img.zoomed {
    cursor: zoom-out;
}

.page-flip-icons {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    justify-content: center;
    align-items: center;
}

.page-flip-icon {
    width: 45px;
    height: 45px;
    background: rgba(128, 128, 128, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.page-flip-icon:hover {
    background: rgba(100, 100, 100, 0.9);
    transform: scale(1.1) rotateY(15deg);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.page-flip-icon:active {
    transform: scale(0.95) rotateY(25deg);
}

.page-flip-icon.prev:hover {
    transform: scale(1.1) rotateY(-15deg);
}

.page-flip-icon.prev:active {
    transform: scale(0.95) rotateY(-25deg);
}

.page-number {
    margin-top: 5px;
    color: #666;
    font-size: 0.9em;
}

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

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

.page.hidden {
    display: none;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    flex-wrap: wrap;
}

.zoom-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.zoom-btn {
    background: #3498db;
    padding: 8px 20px;
}

.zoom-btn:hover:not(:disabled) {
    background: #2980b9;
}

button {
    background: #2c3e50;
    color: white;
    border: none;
    padding: 10px 30px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.3s;
}

button:hover:not(:disabled) {
    background: #34495e;
}

button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.page-info {
    color: #666;
    font-size: 1em;
}

@media (max-width: 768px) {
    .page-wrapper {
        height: 550px;
    }

    .book-viewer {
        padding: 15px 10px;
        min-height: 600px;
    }

    button {
        padding: 8px 20px;
        font-size: 0.9em;
    }

    .page-flip-icon {
        width: 50px;
        height: 50px;
        font-size: 28px;
    }

    .page-flip-icons {
        gap: 30px;
        margin-top: 15px;
    }
}