/* Custom UI Styles */

/* Ensure the app takes up the full viewport and prevents bouncing on mobile */
body {
    overscroll-behavior-y: contain;
    -webkit-tap-highlight-color: transparent;
}

/* Canvas Styling */
#pdf-canvas {
    display: block;
    margin: 0 auto;
    touch-action: none;
    /* Prevents the browser from scrolling while you tap to sign */
    position: relative;
    z-index: 5;
    /* Ensures it is above the background but below the drawer */
}

main {
    -webkit-overflow-scrolling: touch;
    /* Smooth scrolling on iOS */
    display: block;
    width: 100%;
}

/* Side Drawer for Form Filling */
#form-drawer {
    box-shadow: -10px 0 15px -3px rgba(0, 0, 0, 0.1);
}

/* Hide scrollbars for a cleaner mobile look */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Tool Button States */
.tool-btn {
    transition: transform 0.1s ease, color 0.2s ease;
}

.tool-btn:active {
    transform: scale(0.9);
}

/* Toggle Switch Customization */
input[type="checkbox"]:checked+div {
    background-color: #2563eb;
}

/* Loading Overlay Styles */
#loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    display: none;
    /* Hidden by default */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(2px);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive adjustment for desktop */
@media (min-width: 768px) {
    #pdf-canvas {
        max-width: 800px;
    }
}