
.agwa-flip-container {
    display: flex;
    width: 100%;
    height: 100vh;
    background: #111;
    overflow: hidden;
}

.agwa-sidebar {
    width: 110px;
    flex: 0 0 110px;
    background: #1a1a1a;
    overflow-y: auto;
    padding: 10px;
    box-sizing: border-box;
}

.agwa-sidebar canvas {
    width: 100%;
    margin-bottom: 10px;
    cursor: pointer;
    border: 2px solid transparent;
}

.agwa-sidebar canvas.active {
    border-color: #00aaff;
}

.agwa-viewer {
    flex: 1;
    min-width: 0;
    display:flex;
    justify-content:center;
    align-items:center;
    position:relative;
    overflow: hidden;
    padding: 24px;
    box-sizing: border-box;
}

.agwa-page-wrapper {
    position:relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    scrollbar-width: none;
    cursor: default;
}

.agwa-page-wrapper::-webkit-scrollbar {
    display: none;
}

.agwa-page-wrapper.is-pannable {
    align-items: flex-start;
    justify-content: flex-start;
    cursor: grab;
}

.agwa-page-wrapper.is-dragging {
    cursor: grabbing;
}

.agwa-loading {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 10, 0.88);
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.agwa-loading.is-hidden {
    opacity: 0;
    visibility: hidden;
}

.agwa-loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    color: #fff;
}

.agwa-loading-spinner svg {
    width: 88px;
    height: 88px;
    transform: rotate(-90deg);
}

.agwa-loading-track,
.agwa-loading-progress {
    fill: none;
    stroke-width: 10;
}

.agwa-loading-track {
    stroke: rgba(255, 255, 255, 0.16);
}

.agwa-loading-progress {
    stroke: #00aaff;
    stroke-linecap: round;
    stroke-dasharray: 327;
    stroke-dashoffset: 327;
    transition: stroke-dashoffset 0.2s ease;
}

.agwa-loading-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.agwa-loading-text strong {
    font-size: 16px;
    font-weight: 600;
}

.agwa-loading-text span {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.agwa-loading-text small {
    display: none;
    max-width: 320px;
    font-size: 11px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.82);
    word-break: break-word;
}

.agwa-loading-text small.is-visible {
    display: block;
}

.agwa-book {
    display: inline-flex;
    align-items: stretch;
    justify-content: center;
    gap: 0;
    background: #000;
    box-shadow: 0 20px 50px rgba(0,0,0,0.7);
    overflow: hidden;
    flex: 0 0 auto;
}

.agwa-book canvas {
    display: block;
    background: #fff;
    width: auto;
    height: auto;
    flex: 0 0 auto;
}

#agwa-canvas-left.is-hidden,
#agwa-canvas-right.is-hidden {
    display: none;
}

.agwa-flip-overlay {
    position:absolute;
    top:0;
    left:0;
    width:100%;
    height:100%;
    pointer-events:none;
    opacity:0;
    background: linear-gradient(to right, rgba(0,0,0,0.4), transparent 40%);
}

.flip-next {
    animation: flipNext 0.6s ease;
}

.flip-prev {
    animation: flipPrev 0.6s ease;
}

@keyframes flipNext {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(-15deg); }
    100% { transform: rotateY(0deg); }
}

@keyframes flipPrev {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(15deg); }
    100% { transform: rotateY(0deg); }
}

.agwa-controls {
    position:absolute;
    bottom:20px;
    background:rgba(0,0,0,0.7);
    padding:8px 20px;
    border-radius:30px;
    display:flex;
    gap:10px;
    align-items:center;
}

.agwa-controls button,
.agwa-controls a,
.agwa-controls button[id],
.agwa-controls a[id] {
    min-width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    font-size: 16px;
    line-height: 1;
    border-radius: 10px;
    box-sizing: border-box;
}

#agwa-page-info {
    display: inline-block;
    font-size: 16px;
    line-height: 1.1;
}

@media(max-width:768px){
    .agwa-sidebar{
        display:none;
    }

    .agwa-viewer {
        padding: 16px;
    }

    .agwa-controls {
        bottom: 12px;
        gap: 8px;
        padding: 6px 10px;
        border-radius: 18px;
    }

    .agwa-flip-container .agwa-controls button,
    .agwa-flip-container .agwa-controls a,
    .agwa-flip-container .agwa-controls button[id],
    .agwa-flip-container .agwa-controls a[id] {
        min-width: 30px !important;
        width: 30px !important;
        height: 30px !important;
        padding: 0 !important;
        font-size: 13px !important;
        line-height: 1 !important;
        border-radius: 8px !important;
        padding: .5rem 0.4rem !important;
    }

    .agwa-flip-container #agwa-page-info {
        font-size: 12px !important;
        line-height: 1 !important;
        min-width: 36px !important;
    }
}
