.spacepdf-html-to-pdf-app {
    font-family: 'Poppins', sans-serif;
    color: #cbd5e1;
    line-height: 1.6;
    padding: 2rem 1rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-image: url('https://spacepdf.com/wp-content/uploads/2025/09/Minimal-Starry-Black-Background.webp');
    background-color: #0f172a;
    background-size: cover;
    background-position: 50%;
    background-attachment: fixed;
    text-align: center;
}

.spacepdf-html-to-pdf-app h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 0.5rem 0;
}

.spacepdf-html-to-pdf-app .page-subtitle {
    font-size: 1.1rem;
    color: #94a3b8;
    margin: 0 auto 2rem auto;
    max-width: 800px;
}

.spacepdf-html-to-pdf-app .space-tool-container {
    max-width: 600px;
    margin: 0 auto;
    background: linear-gradient(to bottom, rgb(0, 0, 20), rgb(20, 30, 60));
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-align: left;
}

.spacepdf-html-to-pdf-app #initialContent h2 {
    font-size: 1.75rem;
    color: #f1f5f9;
    margin-bottom: 0.5rem;
    text-align: center;
}

.spacepdf-html-to-pdf-app #initialContent .section-subtitle {
    color: #94a3b8;
    text-align: center;
    margin-bottom: 2rem;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
}

/* --- Upload Section (Dashed Box) --- */
.spacepdf-html-to-pdf-app .upload-section {
    border: 2px dashed #475569;
    border-radius: 10px;
    padding: 3rem 2rem;
    text-align: center;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.spacepdf-html-to-pdf-app .upload-section.drag-over {
    border-color: #38bdf8;
    background-color: rgba(56, 189, 248, 0.05);
}

.spacepdf-html-to-pdf-app .drop-text {
    color: #94a3b8;
    text-align: center;
    margin-top: 1rem;
}

/* --- General Button Styling --- */
.spacepdf-html-to-pdf-app .action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.spacepdf-html-to-pdf-app .action-button:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* --- Specific Button Colors --- */
.spacepdf-html-to-pdf-app .file-label {
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    padding: 0.85rem 2rem;
}

.spacepdf-html-to-pdf-app .file-label:hover {
    background: linear-gradient(135deg, #4ac3f9, #1faaf0);
}

.spacepdf-html-to-pdf-app .convert-button {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    max-width: 250px;
    margin: 2rem auto 0;
}

/* --- Preview Section --- */
.spacepdf-html-to-pdf-app .preview-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.spacepdf-html-to-pdf-app .start-over-button {
    background-color: #475569;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

.spacepdf-html-to-pdf-app .start-over-button:hover {
    background-color: #64748b;
}

.spacepdf-html-to-pdf-app #preview h3 {
    color: #f1f5f9;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.spacepdf-html-to-pdf-app .output-container {
    border: 2px dashed #334155;
    padding: 1.25rem;
    border-radius: 8px;
    background-color: white;
    color: #333;
    transition: border-color 0.3s ease;
    resize: vertical;
    position: relative;
    contain: layout style paint;
    min-height: 300px;
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
    overflow-wrap: break-word;
}

.spacepdf-html-to-pdf-app .output-container img,
.spacepdf-html-to-pdf-app .output-container video,
.spacepdf-html-to-pdf-app .output-container svg,
.spacepdf-html-to-pdf-app .output-container iframe {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.spacepdf-html-to-pdf-app .output-container table {
    table-layout: fixed;
    width: 100%;
}

.spacepdf-html-to-pdf-app .output-container pre,
.spacepdf-html-to-pdf-app .output-container code {
    white-space: pre-wrap;
    word-break: break-all;
}

.spacepdf-html-to-pdf-app .output-container::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.spacepdf-html-to-pdf-app .output-container::-webkit-scrollbar-track {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.spacepdf-html-to-pdf-app .output-container::-webkit-scrollbar-thumb {
    background-color: #475569;
    border-radius: 10px;
    border: 2px solid #1e293b;
}

.spacepdf-html-to-pdf-app .output-container::-webkit-scrollbar-thumb:hover {
    background-color: #64748b;
}

/* --- Custom Scrollbar Styling (for Firefox) --- */
.spacepdf-html-to-pdf-app .output-container {
    scrollbar-width: thin;
    scrollbar-color: #475569 rgba(0, 0, 0, 0.1);
}

/* --- Custom Resize Handle Styling (for WebKit browsers) --- */
.spacepdf-html-to-pdf-app .output-container::-webkit-resizer {
    background-image: repeating-linear-gradient(135deg,
            transparent,
            transparent 2px,
            #64748b 2px,
            #64748b 4px);
    border: none;
    width: 10px;
    height: 10px;
}

.spacepdf-html-to-pdf-app .output-container:focus-within {
    border-color: #38bdf8;
}

/* --- Custom Error Message Tooltip --- */
.spacepdf-html-to-pdf-app .error-message {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(200%);
    background-color: #ef4444;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    opacity: 0;
}

.spacepdf-html-to-pdf-app .error-message.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* --- Global Drag & Drop Overlay --- */
.spacepdf-html-to-pdf-app #globalDropInstructionOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.spacepdf-html-to-pdf-app #globalDropInstructionOverlay.visible {
    opacity: 1;
    visibility: visible;
}

.spacepdf-html-to-pdf-app #globalDropInstructionOverlay div {
    text-align: center;
    color: #fff;
}

.spacepdf-html-to-pdf-app #globalDropInstructionOverlay i {
    font-size: 4rem;
    color: #38bdf8;
    margin-bottom: 1rem;
}

.spacepdf-html-to-pdf-app #globalDropInstructionOverlay p {
    font-size: 1.5rem;
    font-weight: 600;
}

.spacepdf-html-to-pdf-app .preview-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.spacepdf-html-to-pdf-app .start-over-button {
    background-color: #475569;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

.spacepdf-html-to-pdf-app .start-over-button:hover {
    background-color: #64748b;
}

.spacepdf-html-to-pdf-app #preview h3 {
    color: #f1f5f9;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.spacepdf-html-to-pdf-app .output-container:focus-within {
    border-color: #38bdf8;
}

.spacepdf-html-to-pdf-app .error-message {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(200%);
    background-color: #ef4444;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, .3);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    transition: transform .4s cubic-bezier(.25, .8, .25, 1);
    opacity: 0;
}

.spacepdf-html-to-pdf-app .error-message.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* --- NEW: Global Drag & Drop Overlay --- */
.spacepdf-html-to-pdf-app #globalDropInstructionOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.spacepdf-html-to-pdf-app #globalDropInstructionOverlay.visible {
    opacity: 1;
    visibility: visible;
}

.spacepdf-html-to-pdf-app #globalDropInstructionOverlay div {
    text-align: center;
    color: #fff;
}

.spacepdf-html-to-pdf-app #globalDropInstructionOverlay i {
    font-size: 4rem;
    color: #38bdf8;
    margin-bottom: 1rem;
}

.spacepdf-html-to-pdf-app #globalDropInstructionOverlay p {
    font-size: 1.5rem;
    font-weight: 600;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    .spacepdf-html-to-pdf-app {
        padding: 1.5rem 1rem;
        text-align: center;
    }

    .spacepdf-html-to-pdf-app h1 {
        font-size: 1.75rem;
    }

    .spacepdf-html-to-pdf-app .page-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .spacepdf-html-to-pdf-app .space-tool-container {
        padding: 1.5rem;
    }

    .spacepdf-html-to-pdf-app #initialContent h2 {
        font-size: 1.5rem;
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.7);
    }

    60% {
        opacity: 1;
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.spacepdf-html-to-pdf-app #loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.spacepdf-html-to-pdf-app #loadingOverlay.visible {
    opacity: 1;
    visibility: visible;
}

.spacepdf-html-to-pdf-app .loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #38bdf8;
    border-right-color: transparent;
    border-radius: 50%;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.spacepdf-html-to-pdf-app #loadingOverlay.visible .loading-spinner {
    animation: spinner-spin 0.75s linear infinite;
}

@keyframes spinner-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spacepdf-html-to-pdf-app #confirmationPopup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.spacepdf-html-to-pdf-app #confirmationPopup.visible {
    opacity: 1;
    visibility: visible;
}

.spacepdf-html-to-pdf-app #confirmationPopup.visible .confirmation-popup-content {
    animation: bounceIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.spacepdf-html-to-pdf-app .confirmation-popup-content {
    background-color: #1e2b3b;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 1.5rem 2rem;
    max-width: 400px;
    width: 100%;
    text-align: center;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.spacepdf-html-to-pdf-app .confirmation-popup-content h3 {
    color: #f1f5f9;
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.spacepdf-html-to-pdf-app .confirmation-popup-content p {
    color: #94a3b8;
    margin-bottom: 1.5rem;
}

.spacepdf-html-to-pdf-app .confirmation-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.spacepdf-html-to-pdf-app .confirmation-buttons button {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    flex-grow: 1;
    transition: background-color 0.2s;
}

.spacepdf-html-to-pdf-app .confirmation-buttons #cancelActionBtn {
    background-color: #475569;
    color: white;
}

.spacepdf-html-to-pdf-app .confirmation-buttons #confirmActionBtn {
    background-color: #ef4444;
    color: white;
}

.spacepdf-html-to-pdf-app #infoPopupOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 10003;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.spacepdf-html-to-pdf-app #infoPopupOverlay.visible {
    opacity: 1;
    visibility: visible;
}

.spacepdf-html-to-pdf-app #infoPopupOverlay.visible .info-popup-content {
    animation: bounceIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.spacepdf-html-to-pdf-app .info-popup-content {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    border: 1px solid #4f8ef7;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    padding: 1rem;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    text-align: center;
    position: relative;
    color: #e0e7ff;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.spacepdf-html-to-pdf-app .info-popup-scrollable-area {
    overflow-y: auto;
    padding: 1.5rem;
    flex-grow: 1;
}

.spacepdf-html-to-pdf-app .info-popup-close-btn {
    position: absolute;
    top: 10px;
    right: 35px;
    font-size: 2rem;
    color: #c7d2fe;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.spacepdf-html-to-pdf-app .info-popup-close-btn:hover {
    color: #fff;
}

.spacepdf-html-to-pdf-app #infoPopupMessage p {
    margin: 0 0 1rem 0;
}

.spacepdf-html-to-pdf-app #infoPopupMessage strong {
    color: #fff;
}

.spacepdf-html-to-pdf-app #infoPopupMessage .skipped-list {
    list-style-type: none;
    /* Remove default dot */
    padding-left: 0;
    margin-top: 0.5rem;
    font-size: 0.9em;
    opacity: 0.9;
    text-align: left;
}

.spacepdf-html-to-pdf-app #infoPopupMessage p {
    text-align: left;
    margin: 0 0 0.75rem 0;
}

.spacepdf-html-to-pdf-app #infoPopupMessage .skipped-list li::before {
    content: '- ';
    color: #93c5fd;
    /* A nice contrasting color */
    margin-right: 0.5em;
}

.spacepdf-html-to-pdf-app .info-popup-scrollable-area::-webkit-scrollbar {
    width: 8px;
}

.spacepdf-html-to-pdf-app .info-popup-scrollable-area::-webkit-scrollbar-track {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.spacepdf-html-to-pdf-app .info-popup-scrollable-area::-webkit-scrollbar-thumb {
    background-color: #93c5fd;
    border-radius: 10px;
}

.spacepdf-html-to-pdf-app .info-popup-scrollable-area {
    scrollbar-width: thin;
    scrollbar-color: #93c5fd rgba(0, 0, 0, 0.2);
}

/* Add this new block of CSS */

/* --- Result/Download Container --- */
.spacepdf-html-to-pdf-app .result-container {
    text-align: center;
    padding: 2rem 1rem;
    animation: bounceIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.spacepdf-html-to-pdf-app .result-icon {
    font-size: 4rem;
    color: #22c55e;
    margin-bottom: 1rem;
}

.spacepdf-html-to-pdf-app .result-container h2 {
    font-size: 1.75rem;
    color: #f1f5f9;
    margin-bottom: 0.5rem;
}

.spacepdf-html-to-pdf-app .result-container p {
    color: #94a3b8;
    margin-bottom: 2rem;
}

.spacepdf-html-to-pdf-app .download-btn {
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    padding: 0.85rem 2.5rem;
    font-size: 1.1rem;
}

.spacepdf-html-to-pdf-app .download-btn:hover {
    background: linear-gradient(135deg, #4ac3f9, #1faaf0);
}