/**
 * Expeditious Tools - Image to PDF Converter Stylesheet
 * Mobile-first, WCAG 2.2 AA compliant, optimized above-the-fold layout.
 */

:root {
    --pdf-primary: #ffc800;
    --pdf-primary-hover: #e0b000;
    --pdf-primary-light: rgba(255, 200, 0, 0.12);
    --pdf-dark: #111418;
    --pdf-dark-card: #1c2024;
    --pdf-surface: #ffffff;
    --pdf-surface-alt: #f8f9fa;
    --pdf-border: #e2e8f0;
    --pdf-border-hover: #cbd5e1;
    --pdf-text: #1e293b;
    --pdf-text-muted: #64748b;
    --pdf-success: #10b981;
    --pdf-success-light: #ecfdf5;
    --pdf-warn: #f59e0b;
    --pdf-warn-light: #fffbeb;
    --pdf-error: #ef4444;
    --pdf-error-light: #fef2f2;
    --pdf-radius: 14px;
    --pdf-radius-sm: 8px;
    --pdf-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.08);
    --pdf-shadow-hover: 0 10px 25px -3px rgba(0, 0, 0, 0.12);
    --pdf-transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Compact Above-the-Fold Masthead */
.pdf-masthead {
    background-color: var(--pdf-dark);
    background-image: linear-gradient(rgba(17, 20, 24, 0.88), rgba(17, 20, 24, 0.94)), url('/assets/img/background.webp');
    background-size: cover;
    background-position: center;
    color: #ffffff;
    padding: 95px 16px 26px;
    text-align: center;
}

@media (max-width: 767px) {
    .pdf-masthead {
        background-image: linear-gradient(rgba(17, 20, 24, 0.9), rgba(17, 20, 24, 0.96)), url('/assets/img/background-mobile.webp');
        padding: 82px 14px 18px;
    }
}

.pdf-breadcrumbs {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.84rem;
    color: #94a3b8;
    margin-bottom: 10px;
}

.pdf-breadcrumbs a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.15s ease;
}

.pdf-breadcrumbs a:hover {
    color: var(--pdf-primary);
}

.pdf-breadcrumbs .sep {
    color: #64748b;
}

.pdf-hero-h1 {
    font-size: clamp(1.45rem, 4vw, 2.35rem);
    font-weight: 700;
    line-height: 1.25;
    margin: 0 auto 8px;
    max-width: 860px;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.pdf-hero-h1 span {
    color: var(--pdf-primary);
}

.pdf-hero-subhead {
    font-size: clamp(0.9rem, 2vw, 1.05rem);
    color: #cbd5e1;
    max-width: 720px;
    margin: 0 auto 12px;
    line-height: 1.5;
}

/* Tool Main Wrapper */
.pdf-tool-wrapper {
    max-width: 920px;
    margin: -15px auto 40px;
    padding: 0 14px;
    position: relative;
    z-index: 10;
}

.pdf-converter-card {
    background: var(--pdf-surface);
    border-radius: var(--pdf-radius);
    border: 1px solid var(--pdf-border);
    box-shadow: var(--pdf-shadow);
    padding: 24px;
    transition: var(--pdf-transition);
}

@media (max-width: 576px) {
    .pdf-converter-card {
        padding: 16px;
        border-radius: 12px;
    }
}

/* Upload Dropzone */
.pdf-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    background: #fbfcfe;
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--pdf-transition);
    outline: none;
    position: relative;
}

.pdf-dropzone:hover,
.pdf-dropzone:focus-visible {
    border-color: var(--pdf-primary);
    background: #fffdf5;
}

.pdf-dropzone.drag-active {
    border-color: var(--pdf-primary);
    background: rgba(255, 200, 0, 0.08);
    transform: scale(1.008);
}

.pdf-dropzone-icon-box {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--pdf-primary-light);
    color: #b45309;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    transition: var(--pdf-transition);
}

.pdf-dropzone:hover .pdf-dropzone-icon-box {
    transform: translateY(-2px);
    background: var(--pdf-primary);
    color: #111418;
}

.pdf-dropzone-title {
    font-size: 1.18rem;
    font-weight: 700;
    color: var(--pdf-text);
    margin-bottom: 6px;
}

.pdf-dropzone-title .accent-text {
    color: #b45309;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.pdf-dropzone-sub {
    font-size: 0.88rem;
    color: var(--pdf-text-muted);
    margin-bottom: 12px;
}

.pdf-dropzone-badges {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
}

.pdf-badge {
    background: #eef2f6;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
}

.pdf-dropzone-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.btn-choose-images {
    background: #111418;
    color: #ffffff;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 10px 22px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--pdf-transition);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.btn-choose-images:hover {
    background: #000000;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-choose-images:focus-visible {
    outline: 2px solid var(--pdf-primary);
    outline-offset: 2px;
}

/* Trust / Privacy Strip */
.pdf-trust-strip {
    display: flex;
    align-items: center;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 16px;
    margin-top: 16px;
    background: var(--pdf-surface-alt);
    border-radius: var(--pdf-radius-sm);
    border: 1px solid #edf2f7;
    font-size: 0.82rem;
    color: #475569;
}

.trust-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.trust-item svg {
    color: var(--pdf-success);
    flex-shrink: 0;
}

/* Status Feedback Bar */
.pdf-status-bar {
    margin-top: 18px;
    padding: 12px 16px;
    border-radius: var(--pdf-radius-sm);
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--pdf-transition);
}

.pdf-status-bar.initial {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.pdf-status-bar.info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.pdf-status-bar.success {
    background: var(--pdf-success-light);
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.pdf-status-bar.error {
    background: var(--pdf-error-light);
    color: #991b1b;
    border: 1px solid #fecaca;
}

.pdf-status-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: pdf-spin 0.75s linear infinite;
    flex-shrink: 0;
}

@keyframes pdf-spin {
    to { transform: rotate(360deg); }
}

/* Uploaded Images Preview Area */
.pdf-preview-area {
    margin-top: 22px;
    display: none;
}

.pdf-preview-area.has-files {
    display: block;
}

.pdf-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--pdf-border);
    margin-bottom: 14px;
}

.pdf-preview-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--pdf-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pdf-count-badge {
    background: var(--pdf-primary);
    color: #111418;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
}

.pdf-preview-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-preview-action {
    background: #ffffff;
    border: 1px solid var(--pdf-border);
    color: var(--pdf-text);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--pdf-transition);
}

.btn-preview-action:hover {
    background: var(--pdf-surface-alt);
    border-color: var(--pdf-border-hover);
}

.btn-preview-action.text-danger:hover {
    background: var(--pdf-error-light);
    border-color: #fca5a5;
    color: var(--pdf-error);
}

.pdf-reorder-hint {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    color: #92400e;
    font-size: 0.82rem;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* File Grid & Cards */
.pdf-file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

@media (max-width: 576px) {
    .pdf-file-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

.pdf-file-card {
    background: var(--pdf-surface);
    border: 1px solid var(--pdf-border);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: var(--pdf-transition);
    user-select: none;
    cursor: grab;
}

.pdf-file-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.pdf-file-card.is-dragging {
    opacity: 0.4;
    border: 2px dashed var(--pdf-primary);
    background: #fffdf5;
}

.pdf-file-card.drag-over {
    border: 2px solid var(--pdf-primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 200, 0, 0.25);
}

.pdf-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.pdf-page-tag {
    background: #111418;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.02em;
}

.pdf-card-remove-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--pdf-transition);
}

.pdf-card-remove-btn:hover {
    color: var(--pdf-error);
    background: var(--pdf-error-light);
}

.pdf-card-thumb-wrap {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 6px;
    overflow: hidden;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.pdf-card-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pdf-card-info {
    font-size: 0.78rem;
    margin-bottom: 8px;
    overflow: hidden;
}

.pdf-card-name {
    font-weight: 600;
    color: var(--pdf-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    margin-bottom: 2px;
}

.pdf-card-size {
    color: var(--pdf-text-muted);
}

/* Card Reordering Arrows (Mobile & Keyboard Accessibility) */
.pdf-card-reorder-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #f1f5f9;
    padding-top: 6px;
    margin-top: auto;
}

.btn-reorder-arrow {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: var(--pdf-transition);
}

.btn-reorder-arrow:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.btn-reorder-arrow:not(:disabled):hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Convert CTA Area */
.pdf-actions-bar {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.btn-convert-pdf {
    width: 100%;
    max-width: 420px;
    background: var(--pdf-primary);
    color: #111418;
    border: none;
    font-size: 1.05rem;
    font-weight: 700;
    padding: 14px 28px;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--pdf-transition);
    box-shadow: 0 4px 14px rgba(255, 200, 0, 0.4);
}

.btn-convert-pdf:hover:not(:disabled) {
    background: var(--pdf-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 200, 0, 0.5);
}

.btn-convert-pdf:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.btn-convert-pdf:focus-visible {
    outline: 3px solid #111418;
    outline-offset: 2px;
}

.pdf-download-ready-actions {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 420px;
}

.pdf-download-ready-actions.active {
    display: flex;
}

.btn-download-again {
    width: 100%;
    background: var(--pdf-success);
    color: #ffffff;
    border: none;
    font-size: 1.05rem;
    font-weight: 700;
    padding: 14px 28px;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--pdf-transition);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-download-again:hover {
    background: #059669;
    transform: translateY(-2px);
}

.btn-reset-converter {
    background: transparent;
    border: none;
    color: var(--pdf-text-muted);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.15s ease;
}

.btn-reset-converter:hover {
    color: var(--pdf-text);
}

/* Progress bar inside tool card */
.pdf-progress-wrap {
    width: 100%;
    max-width: 420px;
    height: 8px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
    display: none;
    margin-top: 6px;
}

.pdf-progress-wrap.active {
    display: block;
}

.pdf-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ffc800, #f59e0b);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* On-Page SEO & Content Container */
.pdf-content-container {
    max-width: 920px;
    margin: 40px auto 60px;
    padding: 0 16px;
    color: var(--pdf-text);
}

.pdf-content-container h2 {
    font-size: clamp(1.4rem, 3vw, 1.85rem);
    font-weight: 700;
    color: #111418;
    margin: 42px 0 18px;
    line-height: 1.3;
}

.pdf-content-container h3 {
    font-size: clamp(1.1rem, 2.5vw, 1.35rem);
    font-weight: 600;
    color: #1e293b;
    margin: 24px 0 12px;
}

.pdf-content-container p {
    font-size: 1rem;
    line-height: 1.75;
    color: #334155;
    margin-bottom: 16px;
}

/* Process Steps Grid */
.pdf-steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin: 24px 0 36px;
}

.pdf-step-card {
    background: #ffffff;
    border: 1px solid var(--pdf-border);
    border-radius: var(--pdf-radius-sm);
    padding: 22px 18px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.pdf-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--pdf-primary);
    color: #111418;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 12px;
}

.pdf-step-card h4 {
    font-size: 1.08rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #111418;
}

.pdf-step-card p {
    font-size: 0.9rem;
    color: #475569;
    margin: 0;
    line-height: 1.6;
}

/* Supported Formats Table */
.pdf-formats-table-wrap {
    overflow-x: auto;
    border-radius: var(--pdf-radius-sm);
    border: 1px solid var(--pdf-border);
    margin: 20px 0 32px;
}

.pdf-formats-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    font-size: 0.92rem;
    text-align: left;
}

.pdf-formats-table th {
    background: #f8fafc;
    color: #1e293b;
    font-weight: 700;
    padding: 14px 16px;
    border-bottom: 1px solid var(--pdf-border);
}

.pdf-formats-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}

.pdf-formats-table tr:last-child td {
    border-bottom: none;
}

.pdf-formats-table tr:hover td {
    background: #fafbfc;
}

/* Benefits & Use Cases Grid */
.pdf-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin: 24px 0 36px;
}

.pdf-feature-card {
    background: #ffffff;
    border: 1px solid var(--pdf-border);
    border-radius: var(--pdf-radius-sm);
    padding: 22px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.pdf-feature-icon {
    font-size: 1.75rem;
    margin-bottom: 12px;
    display: inline-block;
}

.pdf-feature-card h3 {
    font-size: 1.12rem;
    margin: 0 0 8px;
    color: #111418;
}

.pdf-feature-card p {
    font-size: 0.92rem;
    color: #475569;
    margin: 0;
    line-height: 1.6;
}

/* Callout Box */
.pdf-callout {
    background: #fffdf5;
    border-left: 4px solid var(--pdf-primary);
    padding: 16px 20px;
    border-radius: 0 var(--pdf-radius-sm) var(--pdf-radius-sm) 0;
    margin: 24px 0;
    font-size: 0.95rem;
    color: #78350f;
    line-height: 1.65;
}

/* FAQ Section */
.pdf-faq-section {
    margin-top: 50px;
}

.pdf-faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.pdf-faq-item {
    background: #ffffff;
    border: 1px solid var(--pdf-border);
    border-radius: var(--pdf-radius-sm);
    overflow: hidden;
    transition: var(--pdf-transition);
}

.pdf-faq-item:hover {
    border-color: var(--pdf-border-hover);
}

.pdf-faq-question {
    width: 100%;
    background: transparent;
    border: none;
    text-align: left;
    padding: 16px 20px;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    transition: color 0.15s ease;
}

.pdf-faq-question:hover {
    color: #b45309;
}

.pdf-faq-question:focus-visible {
    outline: 2px solid var(--pdf-primary);
    outline-offset: -2px;
}

.pdf-faq-chevron {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: transform 0.25s ease;
    color: #94a3b8;
}

.pdf-faq-item.is-open .pdf-faq-chevron {
    transform: rotate(180deg);
    color: #b45309;
}

.pdf-faq-answer {
    display: none;
    padding: 0 20px 18px;
    font-size: 0.94rem;
    line-height: 1.7;
    color: #475569;
    border-top: 1px solid #f1f5f9;
}

.pdf-faq-item.is-open .pdf-faq-answer {
    display: block;
}

/* Screen reader only utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
