body {
    background-color: #f0f0f0;
    padding: 20px 0;
}

.container {
    max-width: 1400px;
}

#viewer {
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    margin: 20px auto;
    position: relative;
    overflow: hidden;
}

.double-page {
    display: none;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.first-page {
    justify-content: center;
}

.page-container {
    flex: 0 0 auto;
    width: 49%;
    max-width: 49%;
    text-align: center;
    margin: 0 5px;
    display: inline-block;
}

.first-page .page-container {
    width: 50%;
    max-width: 50%;
}

.page {
    width: 100%;
    height: auto;
    cursor: pointer;
    transition: transform 0.2s;
    display: block;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
    padding: 0 10px;
}

.thumbnail {
    width: 77px;
    height: 109px;
    margin: 5px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border 0.2s;
}

.thumbnail.active {
    border: 2px solid #0d6efd;
}

#thumbnails {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

#progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 5px;
    background-color: #0d6efd;
    z-index: 1000;
    transition: width 0.3s;
}

/* Mode zoom */
.zoom-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: move;
    user-select: none;
}

.zoom-img-wrapper {
    position: relative;
    overflow: visible;
    transform-origin: center center;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Empêcher la sélection du texte et des images */
.no-select {
    user-select: none;        /* Standard */
    -webkit-user-select: none; /* Safari et Chrome */
    -moz-user-select: none;   /* Firefox */
    -ms-user-select: none;    /* Internet Explorer */
    pointer-events: none;     /* Désactive les interactions */
}

/* Désactive complètement le drag sur les images */
.no-drag {
    -webkit-user-drag: none;  /* Safari */
    -moz-user-drag: none;     /* Firefox */
    -o-user-drag: none;       /* Opera */
    user-drag: none;          /* Standard */
    pointer-events: auto;     /* Active les clics et autres interactions */
}


.zoom-img {
    transform: scale(2);
    max-width: 100%;
    max-height: 100vh;
    object-fit: contain;
    transition: transform 0.2s ease;
    transform-origin: center center;
    user-select: none;
    -webkit-user-drag: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: auto;
    cursor: grab;
}

.zoom-img.dragging {
    pointer-events: none;
    cursor: grabbing;
}

.zoom-controls {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1001;
    display: flex;
    gap: 10px;
}

.zoom-btn {
    background-color: rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.zoom-btn:hover {
    background-color: rgba(255, 255, 255, 0.9);
}

/* Swipe indicator */
.swipe-indicator {
    position: fixed;
    top: 50%;
    padding: 10px 15px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 50px;
    display: none;
    z-index: 1002;
    transform: translateY(-50%);
}

.swipe-left {
    left: 20px;
}

.swipe-right {
    right: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .page-container {
        width: 100%;
        max-width: 100%;
    }
    .double-page .page-container:nth-child(2) {
        display: none;
    }
}
