/* Spinner styles */
#pdf-viewer-container {
    position: relative; /* Ensure the loader can overlay */
}

#preview-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 10;
    backdrop-filter: blur(2px);
    border-radius: 4px;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    margin-left: 10px;
    font-weight: bold;
    color: #3498db;
    font-size: 0.9em;
}

/* Prevent content from being hidden behind the fixed bottom bars */
body {
    padding-bottom: 100px; /* Default padding */
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    /* Hide original button on mobile to avoid duplication */
    #payWithStripeButton {
        display: none !important;
    }

    /* Sticky Bottom Bar for Mobile (Always at the very bottom) */
    #mobile-sticky-bar {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        background-color: #ffffff;
        border-top: 1px solid #ddd;
        padding: 15px 20px;
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
        z-index: 2000 !important; /* Ensure it is above most elements */
        box-sizing: border-box;
        padding-bottom: 15px;
        padding-bottom: max(15px, env(safe-area-inset-bottom)); /* iOS Safe Area */
    }

    #mobile-price-display {
        font-weight: bold;
        font-size: 1.1em;
        color: #2c3e50;
    }

    #mobile-pay-button {
        background-color: #6772E5;
        color: white;
        border: none;
        padding: 10px 20px;
        border-radius: 6px;
        font-size: 1em;
        font-weight: bold;
        cursor: pointer;
        width: auto !important; /* Ensure it doesn't take full width here */
    }

    /* Reposition the Onboarding Bar (Pilot-Phase) ABOVE the Payment Bar */
    #bottom-cta-bar {
        bottom: 75px !important; /* Shifted up by the height of the mobile-sticky-bar */
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1) !important;
        z-index: 1999 !important; /* Just below the mobile sticky bar */
    }
    
    /* Increase body padding to account for BOTH bars (approx 75px + 70px) */
    body {
        padding-bottom: 160px !important; 
    }
}

@media (min-width: 769px) {
    #mobile-sticky-bar {
        display: none;
    }
}
