.pdf-to-image-converter-app {
    @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');
    @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500;700&display=swap');
    @import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;600;700&display=swap');
    @import url('https://fonts.googleapis.com/css2?family=Pacifico&display=swap');
    @import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;600&display=swap');
    @import url('https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css');
}

/* Keyframes Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes glow {
    0% {
        text-shadow: 0 0 3px rgba(52, 152, 219, 0.4);
    }

    50% {
        text-shadow: 0 0 8px rgba(52, 152, 219, 0.7);
    }

    100% {
        text-shadow: 0 0 3px rgba(52, 152, 219, 0.4);
    }
}

@keyframes floatRotate {
    0% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-15px) rotate(10deg);
    }

    100% {
        transform: translateY(0px) rotate(0deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }

    to {
        opacity: 1;
        backdrop-filter: blur(5px);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes iconGlow {
    0% {
        filter: drop-shadow(0 0 5px rgba(0, 255, 136, 0.6));
    }

    50% {
        filter: drop-shadow(0 0 15px rgba(0, 255, 136, 1));
    }

    100% {
        filter: drop-shadow(0 0 5px rgba(0, 255, 136, 0.6));
    }
}

@keyframes formatSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes scaleIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes tickAppear {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
        filter: drop-shadow(0 0 0 rgba(52, 152, 219, 0));
    }

    50% {
        transform: translate(-50%, -50%) scale(1.3);
        filter: drop-shadow(0 0 15px rgba(52, 152, 219, 0.8));
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
        filter: drop-shadow(0 0 20px rgba(52, 152, 219, 0.8));
    }
}

@keyframes overlayFade {
    0% {
        opacity: 0;
        backdrop-filter: blur(0px);
    }

    100% {
        opacity: 1;
        backdrop-filter: blur(3px);
    }
}

/* NEW: Spinner animation */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Scoped variables */
.pdf-to-image-converter-app {
    --primary: #1e90ff;
    --secondary: #00bfff;
    --bg-dark: rgba(0, 0, 20, 0.98);
    --bg-card: rgba(20, 30, 60, 0.98);
    --bg-light: rgba(30, 40, 70, 0.98);
    --text-primary: #ffffff;
    --text-secondary: #e2e8f0;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
    --radius: 0.5rem;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
}

.pdf-to-image-converter-app {
    font-family: "Poppins", sans-serif;
    background-size: cover;
    background-position: center;
    text-align: center;
    margin: 0;
    user-select: none;
    position: relative;
    overflow-x: hidden;
    color: #ccc;
    box-sizing: border-box;
    padding: 20px 0;
    /* Provide some default padding */
}

/* General Tool Styles */
.pdf-to-image-converter-app .decorative-icons {
    position: absolute;
    /* Changed from fixed to absolute for scoping */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.pdf-to-image-converter-app .floating-icon {
    position: absolute;
    color: rgba(255, 255, 255, 0.08);
    font-size: 2.5rem;
    animation: floatRotate 12s ease-in-out infinite;
}

.pdf-to-image-converter-app .floating-icon:nth-child(1) {
    top: 15%;
    left: 8%;
    font-size: 2rem;
    animation-delay: 0s;
}

.pdf-to-image-converter-app .floating-icon:nth-child(2) {
    top: 25%;
    right: 12%;
    font-size: 1.8rem;
    animation-delay: 2s;
}

.pdf-to-image-converter-app .floating-icon:nth-child(3) {
    bottom: 20%;
    left: 10%;
    font-size: 2.2rem;
    animation-delay: 4s;
}

.pdf-to-image-converter-app .floating-icon:nth-child(4) {
    bottom: 10%;
    right: 8%;
    font-size: 2rem;
    animation-delay: 6s;
}

.pdf-to-image-converter-app .space-container {
    background: linear-gradient(to bottom, rgb(0, 0, 20), rgb(20, 30, 60));
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 700px;
    border: 1px solid rgb(60, 70, 100);
    color: #e0e0e0;
    text-align: center;
    transition: all 0.5s ease-in-out;
    display: flex;
    flex-direction: column;
    position: relative;
    margin: 2rem auto 20px auto;
}

/* Completely hide scrollbars for all browsers */
.pdf-to-image-converter-app #output-scroll-wrapper::-webkit-scrollbar {
    width: 0;
    display: none;
}

.pdf-to-image-converter-app #output-scroll-wrapper {
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-color: transparent transparent;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.pdf-to-image-converter-app #output-scroll-wrapper::-webkit-scrollbar {
    display: none;
}

.pdf-to-image-converter-app .space-container.uploading {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: 90%;
    max-width: 1500px;
    height: 60vh;
    min-height: 550px;
    margin: 0rem auto 80px auto;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    z-index: 500;
}

.pdf-to-image-converter-app .space-container.uploading #output-scroll-wrapper {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
    padding: 0 10px;
    box-sizing: border-box;
}

.pdf-to-image-converter-app .space-container.uploading #output-scroll-wrapper>#output {
    width: 100%;
}

.pdf-to-image-converter-app .space-container.uploading .main-title {
    display: none;
}

.pdf-to-image-converter-app .space-container.uploading #dropArea {
    display: none;
}

/* Output area for PDF sections and images */
.pdf-to-image-converter-app #output {
    display: flex;
    flex-direction: column;
    gap: 25px;
    padding-top: 15px;
    width: 100%;
}

.pdf-to-image-converter-app #output-scroll-wrapper {
    width: 100%;
}

.pdf-to-image-converter-app .pdf-section {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 100%;
    box-sizing: border-box;
    text-align: left;
}

.pdf-to-image-converter-app .pdf-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(52, 172, 224, 0.25);
    text-align: left;
}

.pdf-to-image-converter-app .pdf-section-title {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
    flex-grow: 1;
    font-weight: 800;
    text-align: left;
}

.pdf-to-image-converter-app .select-all-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9em;
    color: #b0c4de;
    user-select: none;
}

.pdf-to-image-converter-app .select-all-container input[type="checkbox"] {
    opacity: 0;
    position: absolute;
    width: 0;
    height: 0;
    margin: 0;
    cursor: pointer;
}

.pdf-to-image-converter-app .custom-checkbox-visual {
    position: relative;
    width: 18px;
    height: 18px;
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(52, 152, 219, 0.5);
    border-radius: 4px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

.pdf-to-image-converter-app .custom-checkbox-visual:hover {
    border-color: rgba(52, 152, 219, 0.8);
    background-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.4);
}

.pdf-to-image-converter-app .select-all-container:hover .custom-checkbox-visual {
    border-color: rgba(52, 152, 219, 0.8);
    background-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.4);
}

.pdf-to-image-converter-app .custom-checkbox-visual::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 10px;
    color: #ffffff;
    transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    line-height: 1;
}

.pdf-to-image-converter-app .select-all-container input[type="checkbox"]:checked+.custom-checkbox-visual {
    background-color: #3498db;
    border-color: #2980b9;
}

.pdf-to-image-converter-app .select-all-container input[type="checkbox"]:checked+.custom-checkbox-visual::after {
    transform: translate(-50%, -50%) scale(1);
}

.pdf-to-image-converter-app .select-all-container input[type="checkbox"]:focus+.custom-checkbox-visual {
    outline: 2px solid #3498db;
    outline-offset: 1px;
}

.pdf-to-image-converter-app .select-all-container input[type="checkbox"]:focus-visible+.custom-checkbox-visual {
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.5);
}

.pdf-to-image-converter-app .custom-checkbox {
    position: relative;
    width: 18px;
    height: 18px;
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(52, 152, 219, 0.5);
    border-radius: 4px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    display: inline-block;
    vertical-align: middle;
}

.pdf-to-image-converter-app .images-grid-for-pdf {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    justify-items: center;
    width: 100%;
    box-sizing: border-box;
    padding: 0;
    overflow: visible;
}

.pdf-to-image-converter-app .image-container {
    position: relative;
    width: 100%;
    max-width: 250px;
    height: auto;
    min-height: 300px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 2px solid transparent;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    z-index: 1;
}

.pdf-to-image-converter-app .image-container:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: rgba(52, 152, 219, 0.6);
    box-shadow: 0 5px 12px rgba(52, 152, 219, 0.25);
}

.pdf-to-image-converter-app .image-container .fullscreen-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    z-index: 10;
    opacity: 0.7;
    overflow: visible;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    isolation: isolate;
}

.pdf-to-image-converter-app .image-container:hover .fullscreen-icon {
    opacity: 1;
    transform: scale(1.1);
    z-index: 20;
}

.pdf-to-image-converter-app .image-container .fullscreen-icon:hover {
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 20;
}

.pdf-to-image-converter-app .image-container .fullscreen-icon i {
    font-size: 0.85rem;
}

.pdf-to-image-converter-app .custom-tooltip {
    position: absolute;
    top: -45px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 9999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    font-weight: 500;
    letter-spacing: 0.2px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 110px;
    text-align: center;
    width: auto;
    overflow: visible;
}

.pdf-to-image-converter-app .custom-tooltip::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.85) transparent transparent transparent;
    margin-top: -1px;
}

@media (hover: hover) {
    .pdf-to-image-converter-app .fullscreen-icon:hover .custom-tooltip {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
        z-index: 9999;
    }
}

.pdf-to-image-converter-app .custom-tooltip {
    transform: translateX(-50%) translateY(0);
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
    width: auto !important;
}

@media (hover: none) {
    .pdf-to-image-converter-app .custom-tooltip {
        display: none !important;
    }
}

.pdf-to-image-converter-app .images-grid-for-pdf {
    overflow: visible;
}

.pdf-to-image-converter-app .image-container img {
    width: calc(100% - 16px);
    height: 200px;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
    background: rgba(0, 0, 0, 0.15);
    padding: 8px;
    margin-top: 8px;
    border-radius: 4px;
}

.pdf-to-image-converter-app .image-container.selected img {
    transform: none !important;
}

.pdf-to-image-converter-app .image-info {
    background: rgb(0, 0, 0);
    padding: 10px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    border-radius: 0 0 8px 8px;
    position: relative;
    z-index: 1;
    min-height: 65px;
    text-align: center;
    margin-top: auto;
    box-sizing: border-box;
    bottom: 0;
    left: 0;
    right: 0;
}

.pdf-to-image-converter-app .page-number {
    color: #e0e0e0;
    font-size: 0.9rem;
    font-weight: 500;
}

.pdf-to-image-converter-app .page-number i {
    color: #34ace0;
    margin-right: 4px;
}

.pdf-to-image-converter-app .individual-download-btn {
    font-family: "IBM Plex Sans", sans-serif;
    background: #3498db;
    color: white;
    border: none;
    padding: 7px 5px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
    width: 100%;
    margin: 0 auto;
}

.pdf-to-image-converter-app .individual-download-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 3px 7px rgba(0, 0, 0, 0.2);
}

/* Selected Image Styles */
.pdf-to-image-converter-app .image-container.selected {
    border-top: 3px solid #3498db;
    border-left: 3px solid #3498db;
    border-right: 3px solid #3498db;
    border-bottom: none;
    box-shadow: 0 0 18px rgba(52, 152, 219, 0.5);
    transform: scale(1.02) translateY(0);
}

.pdf-to-image-converter-app .image-container.selected::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 3rem;
    color: #3498db;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.4), 0 0 20px rgba(52, 152, 219, 0.8);
    z-index: 2;
    animation: tickAppear 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.pdf-to-image-converter-app .image-container.selected::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 20, 40, 0.65);
    z-index: 1;
    opacity: 0;
    animation: overlayFade 0.3s ease forwards;
    backdrop-filter: blur(2.5px);
}

.pdf-to-image-converter-app .main-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    color: #fff;
    margin-bottom: 30px;
    text-align: center;
    font-size: 1.8em;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-family: "Poppins", sans-serif;
}

.pdf-to-image-converter-app .main-title.hidden-title {
    opacity: 0;
    transform: translateY(-10px);
    height: 0;
    margin-bottom: 0;
    overflow: hidden;
}

.pdf-to-image-converter-app #dropArea {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 25px;
    transition: all 0.3s ease;
    border: 2px dashed rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    min-height: 220px;
}

.pdf-to-image-converter-app #dropArea:hover {
    background: rgba(52, 152, 219, 0.08);
    border-color: rgba(52, 152, 219, 0.7);
}

.pdf-to-image-converter-app #dropArea.drag-over {
    background: rgba(52, 152, 219, 0.15);
    transform: scale(1.01);
    border-style: solid;
    border-color: #3498db;
}

.pdf-to-image-converter-app #dropArea #dropArea-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.pdf-to-image-converter-app #dropArea p {
    font-size: 1.05em;
    font-weight: 500;
    margin-bottom: 18px;
}

.pdf-to-image-converter-app #dropArea p i {
    margin-right: 7px;
    color: #34ace0;
}

/* NEW: Initial Loader Styles */
.pdf-to-image-converter-app #initial-loader {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.pdf-to-image-converter-app .loader-spinner {
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-left-color: #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.pdf-to-image-converter-app #initial-loader p {
    font-size: 1em;
    color: #bbb;
    margin: 0;
}


.pdf-to-image-converter-app .file-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 18px 0;
}

.pdf-to-image-converter-app .file-icon {
    font-size: 2rem;
    margin: 0 15px;
    color: rgba(255, 255, 255, 0.75);
    transition: all 0.3s ease;
}

.pdf-to-image-converter-app .file-icon:first-child {
    color: #3c9ae7;
}

.pdf-to-image-converter-app .file-icon:last-child {
    color: #2ecc71;
}

.pdf-to-image-converter-app .arrow-icon {
    color: rgba(255, 255, 255, 0.85);
    animation: pulse 1.5s infinite;
    font-size: 1.4rem;
}

.pdf-to-image-converter-app .custom-file-input {
    display: inline-block;
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
    padding: 11px 25px;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 18px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: all 0.3s ease-in-out;
}

.pdf-to-image-converter-app .custom-file-input:hover {
    background: linear-gradient(45deg, #2980b9, #3498db);
}

.pdf-to-image-converter-app .custom-file-input input[type="file"] {
    display: none;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
    }

    50% {
        box-shadow: 0 0 20px rgba(46, 204, 113, 0.8);
    }

    100% {
        box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
    }
}

@keyframes shimmer {
    0% {
        background-position: -468px 0;
    }

    100% {
        background-position: 468px 0;
    }
}

.pdf-to-image-converter-app #progressContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 8, 25, 0.92);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 10000;
    animation: fadeIn 0.3s ease forwards;
    backdrop-filter: blur(10px);
}

.pdf-to-image-converter-app .progress-label {
    color: #fff;
    font-size: 1.3em;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.4s ease forwards;
    opacity: 0;
    transform: translateY(-20px);
    font-weight: 600;
    text-shadow: none;
    letter-spacing: 0.5px;
}

.pdf-to-image-converter-app .progress-label i {
    color: #2ecc71;
    font-size: 1.7em;
    animation: rotate 1.5s linear infinite;
    filter: drop-shadow(0 0 8px rgba(46, 204, 113, 0.8));
}

/* Custom Progress Bar Container */
.pdf-to-image-converter-app .progress-container {
    width: 320px;
    height: 20px;
    background: rgba(20, 30, 60, 0.5);
    border-radius: 10px;
    padding: 3px;
    position: relative;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    margin: 10px 0;
    border: 1px solid rgba(52, 172, 224, 0.3);
    overflow: hidden;
    animation: slideIn 0.4s ease forwards 0.1s, pulseGlow 3s infinite;
    opacity: 0;
    transform: translateY(-20px);
}

/* Progress Bar Inner */
.pdf-to-image-converter-app .progress-bar-inner {
    height: 100%;
    width: 0%;
    border-radius: 8px;
    background: linear-gradient(90deg, #3498db, #2ecc71, #9b59b6, #3498db);
    background-size: 300% 300%;
    animation: gradientShift 3s ease infinite;
    position: relative;
    transition: width 0.3s ease-in-out;
}

/* Animated Shimmer Effect */
.pdf-to-image-converter-app .progress-bar-inner::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: 200% 100%;
    animation: shimmer 2s infinite linear;
}

/* Hide the default progress element but keep it for value tracking */
.pdf-to-image-converter-app progress {
    width: 0;
    height: 0;
    opacity: 0;
    position: absolute;
    pointer-events: none;
}

.pdf-to-image-converter-app #progressText {
    color: #fff;
    font-size: 1.2em;
    margin-top: 15px;
    animation: slideIn 0.4s ease forwards 0.2s;
    opacity: 0;
    transform: translateY(-20px);
    font-weight: 600;
    text-shadow: none;
    letter-spacing: 0.5px;
    padding: 5px 15px;
}

@media (max-width: 768px) {
    .pdf-to-image-converter-app #progressText {
        font-size: 14px;
    }
}

.pdf-to-image-converter-app .action-buttons {
    font-family: "IBM Plex Sans", sans-serif;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    display: none;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    background: linear-gradient(to top, rgba(0, 0, 8, 0.96), rgba(8, 18, 38, 0.88));
    padding: 8px 14px;
    border-top: 1px solid rgba(52, 172, 224, 0.35);
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(4px);
}

.pdf-to-image-converter-app .add-more-btn-fixed {
    font-family: "IBM Plex Sans", sans-serif;
    background: #3498db;
    color: white;
    border: none;
    padding: 9px 18px;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.18);
}

.pdf-to-image-converter-app .add-more-btn-fixed:hover {
    background: #2980b9;
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 3px 10px rgba(41, 128, 185, 0.38);
}

.pdf-to-image-converter-app .custom-format-dropdown {
    font-family: "IBM Plex Sans", sans-serif;
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 180px;
}

.pdf-to-image-converter-app .format-label {
    color: #e0e0e0;
    font-size: 0.95em;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    white-space: nowrap;
}

.pdf-to-image-converter-app .format-label i {
    color: #2ecc71;
    font-size: 1.05em;
    animation: iconGlow 2s infinite;
}

.pdf-to-image-converter-app .dropdown-selected {
    background: linear-gradient(135deg, rgba(30, 144, 255, 0.2), rgba(0, 191, 255, 0.15));
    border: 1px solid rgba(52, 172, 224, 0.5);
    border-radius: 6px;
    color: #ffffff;
    padding: 8px 12px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 90px;
    box-shadow: 0 2px 10px rgba(0, 140, 255, 0.2);
    user-select: none;
}

.pdf-to-image-converter-app .dropdown-selected:hover {
    background: linear-gradient(135deg, rgba(30, 144, 255, 0.3), rgba(0, 191, 255, 0.25));
    border-color: rgba(52, 172, 224, 0.7);
    box-shadow: 0 4px 15px rgba(0, 140, 255, 0.3);
    transform: translateY(-2px);
}

.pdf-to-image-converter-app .dropdown-selected:active {
    transform: translateY(0);
}

.pdf-to-image-converter-app .dropdown-selected i {
    transition: transform 0.25s ease;
    font-size: 0.8rem;
    margin-left: 8px;
}

.pdf-to-image-converter-app .dropdown-selected.active i {
    transform: rotate(-180deg);
}

.pdf-to-image-converter-app .dropdown-options {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(10, 15, 40, 0.95);
    border: 1px solid rgba(52, 172, 224, 0.5);
    border-radius: 6px;
    overflow: hidden;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.4), 0 -2px 8px rgba(0, 140, 255, 0.25);
    backdrop-filter: blur(5px);
    min-width: 130px;
}

.pdf-to-image-converter-app .dropdown-options.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.pdf-to-image-converter-app .dropdown-option {
    padding: 10px 15px;
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pdf-to-image-converter-app .dropdown-option:hover {
    background: rgba(52, 152, 219, 0.25);
    color: #ffffff;
}

.pdf-to-image-converter-app .dropdown-option.selected {
    background: rgba(52, 152, 219, 0.3);
    color: #ffffff;
    font-weight: 600;
}

.pdf-to-image-converter-app .dropdown-option i {
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s ease;
    color: #2ecc71;
}

.pdf-to-image-converter-app .dropdown-option.selected i {
    opacity: 1;
    transform: scale(1);
}

.pdf-to-image-converter-app .download-buttons-container {
    display: flex;
    gap: 12px;
}

.pdf-to-image-converter-app #downloadSelected,
.pdf-to-image-converter-app #downloadZip {
    font-family: "IBM Plex Sans", sans-serif;
    background: #4CAF50;
    color: white;
    border: none;
    padding: 9px 18px;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.18);
}

.pdf-to-image-converter-app #downloadSelected:hover,
.pdf-to-image-converter-app #downloadZip:hover {
    background: #45a049;
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 3px 10px rgba(76, 175, 80, 0.38);
}

.pdf-to-image-converter-app #downloadSelected i,
.pdf-to-image-converter-app #downloadZip i {
    font-size: 1rem;
    margin-right: 4px;
}

.pdf-to-image-converter-app .notification {
    position: fixed;
    top: 18px;
    right: 18px;
    padding: 13px 22px;
    border-radius: 7px;
    color: white;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10001;
    box-shadow: 0 4px 13px rgba(0, 0, 0, 0.22);
    max-width: 330px;
    border-left-width: 4px;
    border-left-style: solid;
}

.pdf-to-image-converter-app .notification i {
    font-size: 1.3em;
}

.pdf-to-image-converter-app .notification.success {
    background: rgba(76, 175, 80, 0.92);
    border-left-color: #388E3C;
}

.pdf-to-image-converter-app .notification.error {
    background: rgba(244, 67, 54, 0.92);
    border-left-color: #D32F2F;
}

.pdf-to-image-converter-app .notification.info {
    background: rgba(33, 150, 243, 0.92);
    border-left-color: #1976D2;
}

.pdf-to-image-converter-app .notification.warning {
    background: rgba(255, 152, 0, 0.92);
    border-left-color: #F57C00;
}

.pdf-to-image-converter-app .format-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 8, 25, 0.88);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(7px);
    animation: fadeIn 0.3s ease forwards;
}

.pdf-to-image-converter-app .format-loading-content {
    text-align: center;
    color: #fff;
    background: linear-gradient(135deg, rgba(10, 25, 55, 0.85), rgba(20, 35, 70, 0.9));
    padding: 28px 40px;
    border-radius: 12px;
    box-shadow: 0 0 22px rgba(52, 172, 224, 0.28), 0 5px 15px rgba(0, 0, 0, 0.2);
    animation: scaleIn 0.3s ease forwards;
    max-width: 90%;
    width: 300px;
    border: 1px solid rgba(52, 172, 224, 0.3);
}

.pdf-to-image-converter-app .format-loading-content p {
    margin-top: 18px;
    font-size: 1.05em;
    color: #34ace0;
    text-shadow: 0 0 8px rgba(52, 172, 224, 0.45);
}

.pdf-to-image-converter-app .format-spinner {
    width: 40px;
    height: 40px;
    border: 3.5px solid rgba(52, 172, 224, 0.18);
    border-left-color: #34ace0;
    border-radius: 50%;
    animation: formatSpin 0.9s linear infinite;
    margin: 0 auto;
    box-shadow: 0 0 12px rgba(52, 172, 224, 0.28);
}

.pdf-to-image-converter-app #globalDragOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 8, 25, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(7px);
    color: #fff;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.pdf-to-image-converter-app #globalDragOverlay.visible {
    opacity: 1;
    visibility: visible;
}

.pdf-to-image-converter-app .global-drag-content {
    padding: 28px;
    border-radius: 8px;
}

.pdf-to-image-converter-app .global-drag-content i {
    color: #3498db;
    margin-bottom: 18px;
    font-size: 3.2em;
}

.pdf-to-image-converter-app .global-drag-content p {
    font-size: 1.5em;
    font-weight: 500;
}

.pdf-to-image-converter-app #fullscreenModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    backdrop-filter: blur(5px);
    padding: 20px;
    box-sizing: border-box;
}

.pdf-to-image-converter-app #fullscreenModal img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    border: 3px solid #3498db;
    border-radius: 5px;
    box-shadow: 0 0 30px rgba(52, 152, 219, 0.5);
}

.pdf-to-image-converter-app #fullscreenModal .close-fullscreen {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2rem;
    color: white;
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 50%;
}

/* Responsive Adjustments */
@media (max-width: 900px) {
    .pdf-to-image-converter-app .space-container.uploading {
        width: 90%;
        max-width: 90%;
    }
}

@media (max-width: 768px) {
    .pdf-to-image-converter-app {
        padding-bottom: 140px;
    }

    .pdf-to-image-converter-app .space-container {
        width: 90%;
        padding: 20px;
        margin-top: 5rem;
        justify-content: center;
        min-height: 350px;
    }

    /* Modified space-container for mobile */
    .pdf-to-image-converter-app .space-container.uploading {
        position: relative;
        top: auto !important;
        left: auto;
        transform: none;
        height: 73vh;
        min-height: 450px;
        max-height: none;
        width: 95%;
        margin: 1rem auto 50px auto;
        padding-bottom: 10px;
    }

    .pdf-to-image-converter-app #output-scroll-wrapper::-webkit-scrollbar {
        width: 8px;
    }

    .pdf-to-image-converter-app #output-scroll-wrapper::-webkit-scrollbar-thumb {
        border: 1.5px solid rgba(0, 0, 20, 0.5);
    }

    .pdf-to-image-converter-app #output-scroll-wrapper {
        scrollbar-width: thin;
    }

    .pdf-to-image-converter-app .main-title {
        font-size: 1.5em;
        margin-bottom: 20px;
    }

    .pdf-to-image-converter-app #dropArea {
        padding: 20px;
        min-height: 180px;
    }

    .pdf-to-image-converter-app #dropArea p {
        font-size: 1em;
    }

    .pdf-to-image-converter-app .file-icon {
        font-size: 1.7rem;
    }

    .pdf-to-image-converter-app .custom-file-input {
        width: 75%;
        padding: 10px 18px;
        font-size: 0.85em;
    }

    .pdf-to-image-converter-app .pdf-section-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: nowrap;
    }

    .pdf-to-image-converter-app .pdf-section-title {
        font-size: 1em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex-grow: 1;
        margin-right: 10px;
        min-width: 0;
        text-align: left;
    }

    .pdf-to-image-converter-app .select-all-container {
        display: flex;
        align-items: center;
        gap: 5px;
        font-size: 0.8em;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .pdf-to-image-converter-app .select-all-container .custom-checkbox-visual {
        flex-shrink: 0;
    }

    .pdf-to-image-converter-app .images-grid-for-pdf {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

    .pdf-to-image-converter-app .image-container {
        min-height: 280px;
    }

    .pdf-to-image-converter-app .image-container img {
        height: 170px;
    }

    .pdf-to-image-converter-app .action-buttons {
        position: fixed;
        bottom: 0px;
        left: 0;
        width: 100%;
        box-sizing: border-box;
        z-index: 900;
        background: linear-gradient(to top, rgba(0, 0, 8, 0.96), rgba(8, 18, 38, 0.88));
        border-top: 1px solid rgba(52, 172, 224, 0.35);
        display: none;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        padding: 8px 6px;
        gap: 6px;
    }

    .pdf-to-image-converter-app .action-buttons>.add-more-btn-fixed {
        flex-basis: auto;
        width: auto;
        flex-grow: 1;
        box-sizing: border-box;
        margin-bottom: 0;
        order: 1;
        justify-content: center;
        font-size: 0.8rem;
        padding: 7px 8px;
    }

    .pdf-to-image-converter-app .action-buttons>.custom-format-dropdown {
        order: 2;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        padding: 0;
        flex-grow: 0;
        flex-shrink: 0;
        margin-left: 5px;
    }

    .pdf-to-image-converter-app .format-label {
        font-size: 0.8rem;
        display: none;
    }

    .pdf-to-image-converter-app .format-label i {
        font-size: 0.9em;
    }

    .pdf-to-image-converter-app .dropdown-selected {
        padding: 7px 10px;
        font-size: 0.8rem;
        width: auto;
        min-width: 60px;
    }

    @media (max-width: 380px) {
        .pdf-to-image-converter-app .action-buttons {
            padding: 8px 4px;
        }

        .pdf-to-image-converter-app .action-buttons>.add-more-btn-fixed {
            font-size: 0.75rem;
            padding: 7px 5px;
        }

        .pdf-to-image-converter-app .dropdown-selected {
            padding: 7px 8px;
            min-width: 50px;
        }
    }

    .pdf-to-image-converter-app .action-buttons>.download-buttons-container {
        flex-basis: 100%;
        display: flex;
        justify-content: space-between;
        gap: 6px;
        order: 3;
        box-sizing: border-box;
        margin-top: 6px;
    }

    .pdf-to-image-converter-app .download-buttons-container>button {
        flex-grow: 1;
        flex-basis: 0;
        min-width: 110px;
        justify-content: center;
        box-sizing: border-box;
        font-size: 0.8rem;
        padding: 7px 8px;
    }

    .pdf-to-image-converter-app .download-buttons-container>button i {
        font-size: 0.9em;
    }

    .pdf-to-image-converter-app .global-drag-content i {
        font-size: 2.8em;
    }

    .pdf-to-image-converter-app .global-drag-content p {
        font-size: 1.25em;
    }

    .pdf-to-image-converter-app .image-container .fullscreen-icon {
        width: 26px;
        height: 26px;
        top: 10px;
        right: 10px;
    }

    .pdf-to-image-converter-app .image-container .fullscreen-icon i {
        font-size: 0.75rem;
    }

    .pdf-to-image-converter-app .custom-checkbox {
        width: 16px;
        height: 16px;
    }

    .pdf-to-image-converter-app .custom-checkbox::after {
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    .pdf-to-image-converter-app .space-container {
        min-height: 300px;
        padding: 15px;
    }

    .pdf-to-image-converter-app .main-title {
        font-size: 1.3em;
    }

    .pdf-to-image-converter-app .custom-file-input {
        width: 85%;
        font-size: 0.8em;
    }

    .pdf-to-image-converter-app .images-grid-for-pdf {
        grid-template-columns: 1fr;
    }

    .pdf-to-image-converter-app .add-more-btn-fixed,
    .pdf-to-image-converter-app #downloadSelected,
    .pdf-to-image-converter-app #downloadZip {
        font-size: 0.85em;
        padding: 8px 14px;
    }

    .pdf-to-image-converter-app .notification {
        width: calc(100% - 30px);
        right: 10px;
        top: 10px;
        padding: 11px 16px;
    }

    .pdf-to-image-converter-app .pdf-section-title {
        font-size: 0.9em;
    }

    .pdf-to-image-converter-app .select-all-container {
        font-size: 0.75em;
        gap: 4px;
    }
}

/* Universal focus/tap highlight reset */
.pdf-to-image-converter-app * {
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.pdf-to-image-converter-app button,
.pdf-to-image-converter-app a,
.pdf-to-image-converter-app input,
.pdf-to-image-converter-app textarea,
.pdf-to-image-converter-app select {
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.pdf-to-image-converter-app *:focus {
    outline: none !important;
    box-shadow: none !important;
}

.pdf-to-image-converter-app #addMoreBtnFixed,
.pdf-to-image-converter-app #downloadZip {
    font-family: "Poppins", sans-serif;
}

.pdf-to-image-converter-app .pdf-title-container {
    position: relative;
    display: inline-block;
    /* Or 'flex-grow: 1' if it's in a flex container and should take space */
    flex-grow: 1;
    min-width: 0;
}

/* Style for the title to indicate it's interactive (truncated) */
.pdf-to-image-converter-app .pdf-section-title.is-truncated {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-color: rgba(176, 196, 222, 0.7);
    text-underline-offset: 3px;
}

.pdf-to-image-converter-app .filename-tooltip {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    transform: none;
    background-color: #000;
    color: #fff;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 0.85rem;
    font-weight: 400;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    border: 1px solid #3498db;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
    white-space: normal;
    /* Allow text to wrap to new lines */
    word-break: break-all;
    /* Break long words without spaces */
    max-width: 450px;
    /* Set a maximum width for the tooltip */
    text-align: left;
    /* Ensure text inside is left-aligned */
}

.pdf-to-image-converter-app .filename-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    /* Position at the top of the tooltip box */
    left: 30px;
    /* Position arrow near the left side */
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent #3498db transparent;
    /* Make arrow point up */
}

/* Show tooltip on hover of the container */
.pdf-to-image-converter-app .pdf-title-container:hover .filename-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Mobile: Styles for when filename is expanded */
.pdf-to-image-converter-app .pdf-section-title.is-expanded {
    white-space: normal;
    /* Allow text to wrap */
    word-break: break-all;
    /* Break long words to prevent overflow */
    text-decoration: none;
    /* Remove underline when expanded */
    font-weight: 600;
    color: #fff;
}


@media (max-width: 768px) {
    .pdf-to-image-converter-app .filename-tooltip {
        display: none;
        /* Ensure tooltips are never shown on mobile */
    }

    .pdf-to-image-converter-app .pdf-section-title {
        text-align: left;
        /* Ensure alignment stays correct on mobile */
    }
}