/* Custom styles for ThinPDF */

:root {
    --primary-color: #137fec;
}

.htmx-indicator {
    opacity: 0;
    transition: opacity 500ms ease-in;
}

.htmx-request .htmx-indicator {
    opacity: 1;
}

.htmx-request.htmx-indicator {
    opacity: 1;
}

/* Loading spinner */
.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

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

/* File upload area dragover state */
.file-drop-area.dragover {
    border-color: var(--primary-color) !important;
    background-color: rgb(249 250 251) !important;
}

/* Show compress button when file is selected */
.file-selected #compress-btn {
    display: flex !important;
}

/* File input change animation */
.file-selected .upload-icon {
    color: var(--primary-color);
}

.file-selected h3 {
    color: #059669;
}

/* Progress bar animations */
.progress-bar {
    transition: width 0.3s ease-in-out;
}

.progress-bar-animated {
    animation: progress-pulse 2s ease-in-out infinite;
}

@keyframes progress-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Progress bar indeterminate animation */
.progress-indeterminate {
    position: relative;
    overflow: hidden;
}

.progress-indeterminate::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: progress-indeterminate 1.5s ease-in-out infinite;
}

@keyframes progress-indeterminate {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Hide elements during processing */
.processing .upload-form {
    display: none;
}

.processing .processing-indicator {
    display: block;
}

.processing-indicator {
    display: none;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}