/* Custom styles for JPEG to PDF Converter */

/* Ultra-dynamic hero section styling */
.min-vh-75 {
    min-height: 75vh;
}

.feature-card-large {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.feature-card-large:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

.feature-card-detailed {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.feature-card-detailed:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Enhanced gradient backgrounds for feature icons */
.bg-gradient-success {
    background: linear-gradient(45deg, #28a745, #20c997) !important;
}

.bg-gradient-warning {
    background: linear-gradient(45deg, #ffc107, #fd7e14) !important;
}

.bg-gradient-info {
    background: linear-gradient(45deg, #17a2b8, #007bff) !important;
}

.bg-gradient-primary {
    background: linear-gradient(45deg, #007bff, #6f42c1) !important;
}

.bg-gradient-danger {
    background: linear-gradient(45deg, #dc3545, #e83e8c) !important;
}

/* Ultra-responsive container */
@media (min-width: 1400px) {
    .container-fluid.px-4 {
        padding-left: 5rem !important;
        padding-right: 5rem !important;
    }
}

@media (min-width: 1200px) {
    .col-xl-8 .row.g-4 {
        gap: 1.5rem !important;
    }
    
    .feature-card-large {
        min-height: 200px;
    }
    
    .feature-card-detailed {
        min-height: 140px;
    }
}

/* Desktop-specific layout improvements - better use of screen space */
@media screen and (min-width: 992px) {
    /* Main container - wider on desktop */
    .container.my-5 {
        max-width: 1400px !important;
        margin: 2rem auto 4rem auto !important;
        padding: 0 2rem !important;
    }
    
    /* Footer content centering for desktop */
    footer .container {
        max-width: 1200px !important;
        margin: 0 auto !important;
        text-align: center !important;
    }
    
    footer .row {
        justify-content: center !important;
        text-align: center !important;
        align-items: flex-start !important;
    }
    
    footer .col-lg-4,
    footer .col-lg-3,
    footer .col-lg-2 {
        text-align: center !important;
        margin-bottom: 2rem !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    
    footer .list-unstyled {
        display: inline-block !important;
        text-align: center !important;
        margin: 0 auto !important;
    }
    
    footer h5,
    footer h6 {
        text-align: center !important;
        margin-bottom: 1rem !important;
    }
    
    footer p {
        text-align: center !important;
        margin: 0 auto 1rem auto !important;
        max-width: 300px !important;
    }
    
    footer .d-flex.gap-3 {
        justify-content: center !important;
        margin: 1rem auto !important;
    }
    
    /* Header section - more generous spacing */
    .text-center.mb-5 {
        margin-bottom: 2rem !important;
        padding: 1rem 0 !important;
    }
    
    .display-4 {
        font-size: 3.5rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    .lead {
        font-size: 1.4rem !important;
        margin-bottom: 1rem !important;
        max-width: 800px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    /* Upload area - wider and more spacious */
    .card.mb-4 {
        margin-bottom: 3rem !important;
    }
    
    .drop-zone {
        min-height: 300px !important;
        padding: 3rem 2rem !important;
        margin: 1rem 0 !important;
    }
    
    .drop-zone h4 {
        font-size: 2rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    .drop-zone .btn-lg {
        padding: 1rem 2rem !important;
        font-size: 1.2rem !important;
    }
    
    /* File list section - better spacing */
    .card-header {
        padding: 1.5rem 2rem !important;
    }
    
    .card-body {
        padding: 2rem !important;
    }
    
    /* Convert section - centered and spacious */
    .convert-section .row {
        margin: 3rem 0 !important;
    }
    
    .convert-section .col-md-6 {
        padding: 0 2rem !important;
    }
    
    /* Settings panels - better layout */
    .settings-panel {
        margin: 2rem 0 !important;
        padding: 2rem !important;
    }
    
    /* Success section - better centering */
    .success-section {
        padding: 3rem 2rem !important;
        margin: 3rem 0 !important;
    }
    
    /* Modal improvements */
    .modal-dialog {
        max-width: 800px !important;
    }
    
    .modal-body {
        padding: 2rem !important;
    }
    
    /* Footer spacing */
    footer {
        margin-top: 5rem !important;
        padding: 3rem 0 !important;
    }
}

/* Large desktop - even more generous spacing */
@media screen and (min-width: 1400px) {
    .container.my-5 {
        max-width: 1600px !important;
        padding: 0 3rem !important;
    }
    
    .drop-zone {
        min-height: 350px !important;
        padding: 5rem 3rem !important;
    }
    
    .card-body {
        padding: 3rem !important;
    }
}

/* Jiggle animation for download button */
@keyframes jiggle {
    0%, 100% { transform: rotate(0deg); }
    10% { transform: rotate(-3deg); }
    20% { transform: rotate(3deg); }
    30% { transform: rotate(-3deg); }
    40% { transform: rotate(3deg); }
    50% { transform: rotate(-2deg); }
    60% { transform: rotate(2deg); }
    70% { transform: rotate(-1deg); }
    80% { transform: rotate(1deg); }
    90% { transform: rotate(0deg); }
}

.jiggle-animation {
    animation: jiggle 0.8s ease-in-out;
}

/* Premium badge styles */
.premium-badge {
    display: flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 193, 7, 0.05));
    border-radius: 0.375rem;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.premium-badge .badge {
    background: transparent !important;
    color: #ffc107 !important;
    font-weight: 600;
    font-size: 0.75rem;
}

.premium-badge i {
    font-size: 1rem;
    text-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
    animation: crown-glow 2s ease-in-out infinite alternate;
}

@keyframes crown-glow {
    from {
        text-shadow: 0 0 5px rgba(255, 193, 7, 0.5);
    }
    to {
        text-shadow: 0 0 15px rgba(255, 193, 7, 0.8), 0 0 20px rgba(255, 193, 7, 0.4);
    }
}

.drop-zone {
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem 1rem;
}

.drop-zone:hover {
    border-color: var(--bs-primary) !important;
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

.drop-zone.dragover {
    border-color: var(--bs-primary) !important;
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    transform: scale(1.02);
}

.upload-icon {
    transition: transform 0.3s ease;
}

.drop-zone:hover .upload-icon {
    transform: translateY(-5px);
}

.file-item {
    transition: all 0.3s ease;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    padding-left: 2.5rem; /* Space for grip handle */
    padding-top: 2rem; /* Space for page number and remove button */
    background-color: var(--bs-body-bg);
    position: relative;
    cursor: grab;
    min-height: 240px; /* Compact height for better space utilization */
}

.file-item:active {
    cursor: grabbing;
}

.file-item.sortable-ghost {
    opacity: 0.5;
    transform: scale(0.95);
}

.grip-handle {
    position: absolute;
    left: 0.5rem;
    top: 1rem; /* Fixed position instead of 50% */
    color: var(--bs-secondary);
    font-size: 1.2rem;
    cursor: grab;
    z-index: 10;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grip-handle:active {
    cursor: grabbing;
}

.page-number {
    position: absolute;
    top: 0.5rem;
    left: 50%;
    transform: translateX(-50%); /* Center horizontally */
    background-color: var(--bs-primary);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    z-index: 10;
}

.file-item:hover {
    border-color: var(--bs-primary);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.file-preview {
    width: 100%;
    height: 240px;
    object-fit: cover;
    border-radius: 0.375rem;
    transition: transform 0.3s ease;
}

.file-preview:hover {
    transform: scale(1.05);
}

.file-info {
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Ensure button consistency */
.file-info button {
    min-height: 2.25rem !important; /* Consistent button height */
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-size {
    color: var(--bs-secondary);
}

.remove-file {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background-color: var(--bs-danger);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.file-item:hover .remove-file {
    opacity: 1;
}

.remove-file:hover {
    background-color: var(--bs-danger);
    transform: scale(1.1);
}

/* Progress animations */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Chrome-specific scrolling fixes for profile modal */
#profileModal .modal-body {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important; /* iOS Safari */
    scroll-behavior: smooth !important; /* Chrome smooth scrolling */
    overscroll-behavior: contain !important; /* Chrome momentum scrolling */
    -webkit-transform: translateZ(0) !important; /* Hardware acceleration for Chrome */
    will-change: scroll-position !important; /* Chrome optimization */
    scrollbar-width: thin !important; /* Firefox */
    scrollbar-color: rgba(255,255,255,0.3) transparent !important; /* Firefox */
}

/* Custom scrollbar for profile modal in WebKit browsers (Safari, Chrome) */
#profileModal .modal-body::-webkit-scrollbar {
    width: 6px !important;
    background: transparent !important;
}

#profileModal .modal-body::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1) !important;
    border-radius: 3px !important;
}

#profileModal .modal-body::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3) !important;
    border-radius: 3px !important;
    border: none !important;
}

#profileModal .modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5) !important;
}

#profileModal .modal-body::-webkit-scrollbar-thumb:active {
    background: rgba(255,255,255,0.7) !important;
}

/* Smooth transitions for sections */
#file-list-container,
#convert-section,
#progress-section,
#success-section,
#error-section {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    /* Mobile optimizations with proper spacing to prevent overlap */
    html, body {
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: hidden !important;
    }

    /* Mobile container with adequate spacing */
    .container, .container-fluid, .container.my-5 {
        margin: 0 !important;
        padding: 1rem !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Proper mobile header spacing to prevent overlap */
    .text-center.mb-5, .text-center {
        margin-bottom: 1rem !important;
        padding: 0.5rem !important;
    }

    .display-4 {
        font-size: 1.75rem !important;
        margin-bottom: 1rem !important;
        line-height: 1.2 !important;
    }

    .lead {
        font-size: 1rem !important;
        margin-bottom: 1rem !important;
        line-height: 1.4 !important;
    }

    /* Make cards more compact but with adequate spacing */
    .card.mb-4 {
        margin-bottom: 1rem !important;
    }

    .card-body {
        padding: 1rem !important;
    }

    .drop-zone {
        padding: 1.5rem 1rem !important;
        min-height: 150px !important;
        margin: 1rem 0 !important;
    }

    .upload-icon {
        margin-bottom: 8px !important;
    }

    .upload-icon i {
        font-size: 1.8rem !important;
    }

    .drop-zone h4 {
        font-size: 1.25rem !important;
        margin-bottom: 0.75rem !important;
        line-height: 1.3 !important;
    }

    .drop-zone .text-muted {
        margin-bottom: 1rem !important;
        font-size: 0.9rem !important;
    }

    .drop-zone .btn {
        margin-bottom: 0.75rem !important;
        padding: 0.75rem 1rem !important;
    }

    .drop-zone .mt-3 {
        margin-top: 0.75rem !important;
    }

    .drop-zone small {
        font-size: 0.85rem !important;
        line-height: 1.3 !important;
    }

    /* Ensure proper ad spacing on mobile */
    .adsbygoogle {
        margin: 0 !important;
        max-height: 50px !important;
        display: block !important;
    }

    /* Hide desktop ads completely on mobile */
    .d-none.d-md-block {
        display: none !important;
    }
}

/* AdSense/AdMob Compliance - Prevents Accidental Clicks and Invalid Activity */
.ad-container {
    transition: opacity 0.3s ease, height 0.3s ease;
    overflow: hidden;
    /* Ensure sufficient spacing from interactive elements per AdMob guidelines */
    margin: 20px 0;
    padding: 10px;
    border-radius: 8px;
    /* Clear labeling to prevent deceptive practices */
    position: relative;
}

.ad-container::before {
    content: "Advertisement";
    font-size: 10px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    text-align: center;
    margin-bottom: 5px;
}

.ad-container.ad-failed {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Hide ads that fail to load or are unfilled */
.adsbygoogle[data-adsbygoogle-status="unfilled"],
.adsbygoogle[data-adsbygoogle-status="error"] {
    display: none !important;
}

/* Ensure no minimum height for ads that fail to load */
ins.adsbygoogle {
    min-height: 0 !important;
}

/* Hide empty ad containers */
.adsbygoogle:empty {
    display: none !important;
}

/* Hide parent containers when ads are empty */
.adsbygoogle:empty + script + .ad-container,
.adsbygoogle:empty + .ad-container {
    display: none !important;
}

/* AdMob Banner Ad Compliance - Prevent Accidental Clicks */
@media (min-width: 768px) {
    .adsbygoogle {
        min-height: 0 !important;
        /* Ensure ads are clearly separated from interactive content */
        margin: 15px auto;
    }

    /* If ad container has no content, hide it completely */
    .d-none.d-md-block:empty,
    .d-none.d-lg-block:empty {
        display: none !important;
        height: 0 !important;
        margin: 0 !important;
    }
    
    /* Prevent ads from being too close to buttons and interactive elements */
    .ad-container + .btn,
    .btn + .ad-container,
    .ad-container + .card .btn,
    .ad-container + form {
        margin-top: 25px !important;
    }
}

/* Mobile ad compliance - extra spacing for touch interactions */
@media (max-width: 767px) {
    .ad-container {
        margin: 25px 0;
    }
    
    /* Ensure mobile ads have sufficient clearance from interactive elements */
    .ad-container + .btn,
    .btn + .ad-container {
        margin-top: 30px !important;
    }
}

    /* Move modal dialogs up by reducing top margin */
    .modal-dialog {
        margin-top: 0.5rem !important;
        margin-bottom: 0.5rem !important;
    }

    .modal-dialog-centered {
        min-height: calc(100vh - 1rem) !important;
    }

    /* Compact file areas */
    .file-preview {
        height: 120px !important;
    }

    .file-item {
        padding: 8px !important;
        margin-bottom: 8px !important;
    }

    /* Compact convert section */
    .card-header {
        padding: 8px 10px !important;
    }

    .card-header h5, .card-header h6 {
        margin-bottom: 0 !important;
        font-size: 0.9rem !important;
    }

    /* Minimal footer */
    footer {
        padding: 10px 0 !important;
        margin-top: 5px !important;
    }

    /* Remove spacing from rows and columns */
    .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .col-lg-10, .col-xl-8 {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    /* Override body and html completely */
    html {
        height: 100vh !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body {
        height: 100vh !important;
        margin: 0 !important;
        padding: 0 !important;
        position: relative !important;
    }

    /* Eliminate any navbar or header spacing */
    nav, .navbar, header, .header {
        margin: 0 !important;
        padding: 0.25rem !important;
    }

    /* Force all containers to hug the top */
    .container, .container-fluid {
        position: relative !important;
        top: 0 !important;
        margin: 0 !important;
        padding: 0.25rem !important;
    }

    /* Remove row and column gutters */
    .row {
        margin: 0 !important;
        padding: 0 !important;
    }

    .col, .col-1, .col-2, .col-3, .col-4, .col-5, .col-6, 
    .col-7, .col-8, .col-9, .col-10, .col-11, .col-12,
    .col-sm, .col-md, .col-lg, .col-xl, .col-xxl {
        padding: 0.25rem !important;
    }

    /* Forms and buttons */
    .form-select, .form-label {
        margin-bottom: 6px !important;
    }

    .btn {
        margin-bottom: 6px !important;
    }

    /* List spacing */
    .d-flex.gap-3 {
        flex-direction: column !important;
        gap: 8px !important;
    }
}

/* File validation styles */
.file-item.invalid {
    border-color: var(--bs-danger);
    background-color: rgba(var(--bs-danger-rgb), 0.05);
}

.file-item.valid {
    border-color: var(--bs-success);
    background-color: rgba(var(--bs-success-rgb), 0.05);
}

/* Loading states */
.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn.loading {
    position: relative;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}

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

/* Reorder modal styles */
.reorder-item {
    cursor: grab;
    transition: all 0.3s ease;
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
}

.reorder-item:active {
    cursor: grabbing;
}

.reorder-item.sortable-ghost {
    opacity: 0.5;
    transform: scale(0.98);
}

.reorder-item .grip-handle {
    position: static;
    transform: none;
    margin-right: 0.75rem;
}

.reorder-preview {
    width: 60px;
    height: 40px;
    object-fit: cover;
    border-radius: 0.25rem;
}

/* Upload Queue Styles */
.upload-queue-item {
    background: var(--bs-gray-800);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 8px;
    border-left: 3px solid var(--bs-primary);
    transition: all 0.3s ease;
}

.upload-queue-item:last-child {
    margin-bottom: 0;
}

.upload-queue-item.uploading {
    border-left-color: var(--bs-warning);
    background: linear-gradient(90deg, var(--bs-gray-800) 0%, rgba(255, 193, 7, 0.1) 50%, var(--bs-gray-800) 100%);
    background-size: 200% 100%;
    animation: uploadProgress 1.5s ease-in-out infinite;
}

.upload-queue-item.completed {
    border-left-color: var(--bs-success);
    background: var(--bs-gray-700);
}

.upload-queue-item.error {
    border-left-color: var(--bs-danger);
    background: var(--bs-gray-700);
}

@keyframes uploadProgress {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.upload-status {
    font-size: 0.875rem;
    font-weight: 500;
}

.upload-status.uploading {
    color: var(--bs-warning);
}

.upload-status.completed {
    color: var(--bs-success);
}

.upload-status.error {
    color: var(--bs-danger);
}

.upload-progress-bar {
    height: 4px;
    background: var(--bs-gray-600);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}

.upload-progress-fill {
    height: 100%;
    background: var(--bs-primary);
    transition: width 0.3s ease;
    border-radius: 2px;
}

/* Quality Preview Modal Styles */
.quality-preview-btn {
    transition: all 0.2s ease;
    font-size: 0.75rem;
}

.quality-preview-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Image Comparison Styles */
.comparison-container {
    position: relative;
    background: var(--bs-gray-100);
    border-radius: 0.5rem;
    overflow: hidden;
    min-height: 400px;
}

.comparison-labels {
    position: absolute;
    top: 10px;
    left: 0;
    right: 0;
    z-index: 15;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
}

.comparison-label {
    position: relative;
}

.comparison-slider-container {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    width: 200px;
}

.comparison-slider {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 2px;
    outline: none;
    cursor: ew-resize;
}

.comparison-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--bs-primary);
    border-radius: 50%;
    cursor: ew-resize;
    border: 3px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.comparison-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--bs-primary);
    border-radius: 50%;
    cursor: ew-resize;
    border: 3px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.image-comparison-container {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 400px; height: 400px;
    overflow: hidden;
    border-radius: 0.5rem;
}

.comparison-image {
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.comparison-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--bs-gray-200);
    user-select: none;
    -webkit-user-drag: none;
    transition: transform 0.1s ease-out;
    transform-origin: center center;
}

.comparison-image img:hover {
    cursor: grab;
}

.comparison-image img:active {
    cursor: grabbing;
}

.original-side {
    left: 0;
    clip-path: inset(0 50% 0 0);
}

.compressed-side {
    right: 0;
    clip-path: inset(0 0 0 50%);
}

.comparison-divider {
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background: white;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
    z-index: 10;
    transform: translateX(-50%);
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(var(--bs-body-bg-rgb), 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.loading-overlay.d-none {
    display: none !important;
}

.quality-controls-bar {
    background: var(--bs-gray-50);
    border-radius: 0.375rem;
    padding: 0.5rem;
    border: 1px solid var(--bs-border-color);
    margin-bottom: 0.5rem;
    flex-shrink: 0;
}

#qualityPreviewModal .modal-dialog {
    max-width: 98vw;
    max-height: 98vh;
    margin: 1vh auto;
    height: 98vh;
}

#qualityPreviewModal .modal-body {
    padding: 0.5rem;
    height: calc(98vh - 60px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.comparison-container {
    width: 100%;
    height: 100%;
}

@media (max-width: 768px) {
    .comparison-slider-container {
        width: 150px;
    }

    .comparison-labels {
        padding: 0 10px;
    }

    .comparison-labels .badge {
        font-size: 0.7rem;
    }

    .image-comparison-container {
        height: 45vh;
        min-height: 250px;
    }

    .quality-controls-bar {
        padding: 0.5rem;
    }
}

/* Hide scroll bars in the quality preview modal */
#qualityPreviewModal {
    overflow: hidden;
}

#qualityPreviewModal .modal-content {
    overflow: hidden;
}

#qualityPreviewModal .modal-dialog {
    overflow: hidden;
}

/* Remove dead space in quality preview modal */
.comparison-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Reduce spacing around preview info */
#qualityPreviewModal .mt-3 {
    margin-top: 0.5rem !important;
    margin-bottom: 0 !important;
}

/* Make modal footer more compact */
#qualityPreviewModal .modal-footer {
    padding: 0.5rem 1rem !important;
    margin-top: 0 !important;
}

/* Remove any extra spacing from comparison container */
#qualityPreviewModal .comparison-container {
    margin-bottom: 0 !important;
}

/* Make the quality preview modal more compact to show Apply Settings button */
#qualityPreviewModal .modal-dialog {
    max-height: 90vh !important;
    height: 90vh !important;
}

#qualityPreviewModal .modal-body {
    height: calc(90vh - 120px) !important;
}

/* Make image comparison container smaller */
.image-comparison-container {
    height: 300px !important;
    min-height: 300px !important;
}

/* Ensure the modal content fits properly */
#qualityPreviewModal .modal-content {
    height: 100%;
    max-height: 90vh;
}


/* Button Timer Styles */
.button-timer {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    opacity: 0.9;
}

.timer-display {
    font-size: 0.75em !important;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.button-timer .fas.fa-clock {
    font-size: 0.7em !important;
    animation: pulse 1.5s infinite;
}

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




/* Prevent horizontal overflow and content cutoff */
html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* Button Timer Styles */
.button-timer {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    opacity: 0.9;
}

.timer-display {
    font-size: 0.75em !important;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.button-timer .fas.fa-clock {
    font-size: 0.7em !important;
    animation: pulse 1.5s infinite;
}

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

