.rpf-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px auto;
    width: 100%;
    max-width: 1000px;
    background: #2c2c2c;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
    position: relative;
    touch-action: none;
}

.rpf-wrapper.rpf-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 20px 10px 80px 10px !important;
    z-index: 999999 !important;
    border-radius: 0 !important;
    background: #1e1e1e !important;
    overflow: auto !important;
    box-sizing: border-box !important;
}

.rpf-container {
    width: 100%;
    height: 600px;
    position: relative;
    background: #1e1e1e;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.1s ease-out;
    transform-origin: center center;
    margin: auto;
    touch-action: none;
}

.rpf-wrapper.rpf-fullscreen .rpf-container {
    height: calc(100vh - 100px) !important;
    min-width: 100% !important;
}

.rpf-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #ffffff;
    font-size: 16px;
    text-align: center;
    padding: 20px;
}

.rpf-error-msg {
    color: #ff6b6b;
    font-size: 14px;
    line-height: 1.5;
}

.rpf-page {
    background-color: #ffffff;
    overflow: hidden;
}

.rpf-page canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Fixed Floating Controls */
.rpf-controls {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 8px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #ffffff;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(8px);
    padding: 8px 14px;
    border-radius: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.12);
    z-index: 1000000;
    transition: all 0.2s ease;
    max-width: 95vw;
    box-sizing: border-box;
}

.rpf-wrapper.rpf-fullscreen .rpf-controls {
    position: fixed !important;
    bottom: 15px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin-top: 0 !important;
    background: rgba(20, 20, 20, 0.95) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.8) !important;
}

.rpf-control-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rpf-controls button {
    background: #3a3a3a;
    color: #ffffff;
    border: 1px solid #555;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    transition: background 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
}

.rpf-controls button:hover {
    background: #2271b1;
    border-color: #2271b1;
}

.rpf-divider {
    color: #555;
    font-weight: 300;
}

.rpf-page-num {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    padding: 0 4px;
}

@media screen and (max-width: 600px) {
    .rpf-controls {
        padding: 6px 10px;
        gap: 5px;
        width: 96vw;
        justify-content: space-between;
    }

    .rpf-controls button {
        padding: 5px 8px;
        font-size: 11px;
    }

    .rpf-page-num {
        font-size: 11px;
        padding: 0 2px;
    }

    .rpf-divider {
        display: none;
    }

    .rpf-btn-text {
        display: none;
    }

    .rpf-wrapper.rpf-fullscreen .rpf-controls {
        bottom: 10px !important;
    }
}

@media screen and (max-width: 380px) {
    .rpf-controls button {
        padding: 4px 6px;
        font-size: 10px;
    }
    .rpf-zoom-reset-btn {
        display: none;
    }
}
