/* ==========================================================
   TOOL-PAGE.CSS  —  PDFlyst shared tool page improvements
   Scoped to .main-body only. Does NOT override style.css.
   ========================================================== */

/* ── 0. Font import (Inter, same as home) ─────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

.main-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #F8FAFC;
    color: #1E293B;
}

/* ── 1. HERO ─────────────────────────────────────────────── */
.main-body .hero {
    background: linear-gradient(160deg, #EFF6FF 0%, #FAFBFF 60%, #F5F3FF 100%);
    padding: 44px 0 36px;
    text-align: center;
    border-bottom: 1px solid #E2E8F0;
    position: relative;
    overflow: hidden;
}

/* subtle decorative blob */
.main-body .hero::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    top: -180px;
    right: -100px;
    pointer-events: none;
}

/* Tool category breadcrumb-style label */
.tool-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #2563EB;
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.15);
    padding: 5px 14px;
    border-radius: 100px;
    margin-bottom: 18px;
}

.tool-label svg {
    width: 12px;
    height: 12px;
    stroke: #2563EB;
}

.main-body .hero h1 {
    font-size: clamp(26px, 4vw, 42px);
    font-weight: 800;
    color: #0F172A;
    letter-spacing: -0.8px;
    line-height: 1.2;
    margin-bottom: 14px;
    margin-top: 0;
}

.main-body .hero p {
    font-size: clamp(15px, 2vw, 17px);
    color: #475569;
    max-width: 560px;
    margin: 0 auto 24px;
    line-height: 1.7;
    font-weight: 400;
}

/* Inline trust pills below headline */
.hero-trust-pills {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.trust-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #64748B;
    background: white;
    border: 1px solid #E2E8F0;
    padding: 5px 12px;
    border-radius: 100px;
    white-space: nowrap;
}

.trust-pill svg {
    width: 12px;
    height: 12px;
    stroke: #22C55E;
    flex-shrink: 0;
}

/* ── 2. UPLOAD ZONE ──────────────────────────────────────── */

/* Wrapper that contains the upload box + microcopy */
.upload-zone-wrapper {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Reset old upload-box styles and apply new ones */
.main-body .upload-box {
    background: white;
    border: 2px dashed #BFDBFE;
    border-radius: 18px;
    padding: 52px 32px 44px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    width: 100%;
    max-width: 100%;
    color: inherit;
    position: relative;
}

.main-body .upload-box:hover {
    border-color: #2563EB;
    background: #F0F7FF;
    box-shadow: 0 8px 32px rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}

/* Drag-over state */
.main-body .upload-box.drag-over {
    border-color: #2563EB;
    background: #EFF6FF;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    transform: scale(1.01);
}

/* Error state */
.main-body .upload-box.upload-error {
    border-color: #EF4444;
    background: #FEF2F2;
}

/* Success state */
.main-body .upload-box.upload-success {
    border-color: #22C55E;
    background: #F0FDF4;
}

/* Upload icon circle */
.upload-icon-circle {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #EFF6FF 0%, #EEF2FF 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 22px;
    color: #2563EB;
    transition: transform 0.25s ease;
}

.main-body .upload-box:hover .upload-icon-circle {
    transform: scale(1.08) translateY(-2px);
}

.upload-icon-circle svg {
    width: 32px;
    height: 32px;
    stroke: #2563EB;
}

/* Override old .upload-icon that's inside .upload-box */
.main-body .upload-box .upload-icon {
    margin-bottom: 0;
    opacity: 1;
}

.main-body .upload-box .upload-icon svg {
    display: none;
    /* replaced by upload-icon-circle on upgraded pages */
}

/* Upload heading inside box */
.upload-box-heading {
    font-size: 18px;
    font-weight: 700;
    color: #0F172A;
    margin-bottom: 6px;
}

.upload-box-sub {
    font-size: 14px;
    color: #64748B;
    margin-bottom: 28px;
}

/* Primary upload button */
.main-body .upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    color: white !important;
    font-size: 15px;
    font-weight: 700;
    padding: 13px 32px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.22s ease;
    box-shadow: 0 4px 18px rgba(37, 99, 235, 0.28);
    margin-bottom: 16px;
    font-family: inherit;
}

.main-body .upload-btn:hover {
    background: linear-gradient(135deg, #1D4ED8 0%, #1E40AF 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.38);
}

.main-body .upload-btn svg {
    width: 18px;
    height: 18px;
    stroke: white;
}

/* "or drop file here" text */
.main-body .upload-subtext {
    font-size: 13px;
    color: #94A3B8;
    margin: 0;
    opacity: 1 !important;
}

/* Microcopy row below upload box */
.upload-microcopy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.upload-microcopy-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #94A3B8;
    font-weight: 500;
}

.upload-microcopy-item svg {
    width: 12px;
    height: 12px;
    stroke: #CBD5E1;
    flex-shrink: 0;
}

/* ── 3. PROCESSING / STATUS STATES ───────────────────────── */

/* Progress overlay — shown during processing */
.upload-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #2563EB, #7C3AED);
    border-radius: 0 0 18px 18px;
    width: 0%;
    transition: width 0.4s ease;
}

/* Status message row */
.tool-status-message {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 10px;
    margin: 16px auto 0;
    max-width: 500px;
}

.tool-status-message.status-processing {
    display: flex;
    background: #EFF6FF;
    color: #1D4ED8;
    border: 1px solid #BFDBFE;
}

.tool-status-message.status-success {
    display: flex;
    background: #F0FDF4;
    color: #15803D;
    border: 1px solid #BBF7D0;
}

.tool-status-message.status-error {
    display: flex;
    background: #FEF2F2;
    color: #DC2626;
    border: 1px solid #FECACA;
}

.status-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(37, 99, 235, 0.2);
    border-top-color: #2563EB;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    flex-shrink: 0;
}

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

.status-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ── 4. TOOLBAR (editor state) ───────────────────────────── */

/* Generic toolbar improvements — applied via the .main-body scope */
.main-body .merge-toolbar,
.main-body .compress-toolbar,
.main-body .jpg-toolbar,
.main-body .split-toolbar,
.main-body [class$="-toolbar"] {
    background: white;
    border-bottom: 1.5px solid #F1F5F9;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border-radius: 12px 12px 0 0;
}

.main-body .toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    background: #F8FAFC;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    font-family: inherit;
}

.main-body .toolbar-btn:hover {
    background: #EFF6FF;
    border-color: #BFDBFE;
    color: #1D4ED8;
}

.main-body .toolbar-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
}

.main-body .toolbar-btn.btn-primary {
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 3px 12px rgba(37, 99, 235, 0.25);
}

.main-body .toolbar-btn.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #1D4ED8 0%, #1E40AF 100%);
    box-shadow: 0 5px 18px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

.main-body .toolbar-btn.btn-success {
    background: linear-gradient(135deg, #16A34A 0%, #15803D 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 3px 12px rgba(22, 163, 74, 0.25);
}

.main-body .toolbar-btn.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #15803D 0%, #166534 100%);
    box-shadow: 0 5px 18px rgba(22, 163, 74, 0.35);
    transform: translateY(-1px);
}

/* ── 5. STEP FLOW SECTION ("How to Use") ─────────────────── */

.main-body [class^="how-to"],
.main-body [class*="how-to"] {
    padding: 64px 0;
    background: white;
}

/* Reusable step-flow layout */
.step-flow {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    position: relative;
    flex-wrap: wrap;
}

.step-flow-item {
    flex: 1;
    min-width: 180px;
    max-width: 240px;
    text-align: center;
    padding: 0 16px;
    position: relative;
}

/* Connecting line between steps */
.step-flow-item:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 24px;
    right: -8px;
    width: 16px;
    height: 2px;
    background: linear-gradient(90deg, #CBD5E1, #BFDBFE);
}

.step-flow-num {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #EFF6FF 0%, #EEF2FF 100%);
    border: 2px solid #BFDBFE;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 15px;
    font-weight: 800;
    color: #2563EB;
    transition: all 0.2s;
}

.step-flow-item:hover .step-flow-num {
    background: #2563EB;
    color: white;
    border-color: #2563EB;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
}

.step-flow-item h3 {
    font-size: 15px;
    font-weight: 700;
    color: #0F172A;
    margin-bottom: 8px;
}

.step-flow-item p {
    font-size: 13.5px;
    color: #64748B;
    line-height: 1.6;
    margin: 0;
}

/* Override legacy .step-number on tool pages */
.main-body .step-number {
    width: 48px;
    height: 48px;
    font-size: 16px;
    font-weight: 800;
    background: linear-gradient(135deg, #EFF6FF 0%, #EEF2FF 100%);
    border: 2px solid #BFDBFE;
    color: #2563EB;
}

.main-body .step-card {
    text-align: center;
    flex: 1 1 200px;
    max-width: 280px;
    padding: 28px 20px;
    border-radius: 14px;
    background: #F8FAFC;
    border: 1.5px solid #F1F5F9;
    transition: all 0.2s ease;
}

.main-body .step-card:hover {
    background: #EFF6FF;
    border-color: #BFDBFE;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.09);
}

.main-body .step-card h3 {
    font-size: 16px;
    font-weight: 700;
    color: #0F172A;
    margin-bottom: 8px;
}

.main-body .step-card p {
    font-size: 14px;
    color: #64748B;
    line-height: 1.65;
}

/* Override the old steps-grid spacing on tool pages */
.main-body .steps-grid {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 40px;
}

/* ── 6. FEATURES SECTION ─────────────────────────────────── */

.main-body .tool-features {
    background: linear-gradient(180deg, #F8FAFC 0%, #EFF6FF 100%);
    padding: 64px 0;
}

.main-body .tool-features .section-title {
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 800;
    color: #0F172A;
    letter-spacing: -0.3px;
    margin-bottom: 40px;
}

/* Replace the plain text feature list with cards */
.features-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.feature-card-item {
    background: white;
    border: 1.5px solid #F1F5F9;
    border-radius: 14px;
    padding: 26px 22px;
    transition: all 0.22s ease;
}

.feature-card-item:hover {
    border-color: #BFDBFE;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.08);
    transform: translateY(-3px);
}

.feature-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, #EFF6FF 0%, #EEF2FF 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563EB;
    margin-bottom: 16px;
}

.feature-card-icon svg {
    width: 22px;
    height: 22px;
    stroke: #2563EB;
}

.feature-card-item h3 {
    font-size: 15px;
    font-weight: 700;
    color: #0F172A;
    margin-bottom: 8px;
}

.feature-card-item p {
    font-size: 13.5px;
    color: #64748B;
    line-height: 1.65;
    margin: 0;
}

/* Maintain legacy .features-content for tool pages not yet upgraded */
.main-body .tool-features .features-content h3 {
    font-size: 16px;
    font-weight: 700;
    color: #0F172A;
    margin-bottom: 8px;
    margin-top: 28px;
    padding-left: 16px;
    border-left: 3px solid #2563EB;
}

.main-body .tool-features .features-content p {
    font-size: 14.5px;
    color: #64748B;
    line-height: 1.7;
    margin-bottom: 4px;
}

/* ── 7. FAQ SECTION ──────────────────────────────────────── */

.main-body .faq-section {
    padding: 64px 0;
    background: white;
}

.main-body .faq-section .section-title {
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 800;
    color: #0F172A;
    letter-spacing: -0.3px;
}

.main-body .faq-list {
    max-width: 740px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.main-body .faq-item {
    padding: 20px 0;
    border-bottom: 1px solid #F1F5F9;
    cursor: pointer;
}

.main-body .faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.main-body .faq-item h3 {
    font-size: 16px;
    font-weight: 700;
    color: #0F172A;
    margin-bottom: 0;
    line-height: 1.4;
}

.faq-chevron {
    width: 20px;
    height: 20px;
    stroke: #94A3B8;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.main-body .faq-item.is-open .faq-chevron {
    transform: rotate(180deg);
    stroke: #2563EB;
}

.main-body .faq-item.is-open h3 {
    color: #2563EB;
}

.faq-answer {
    display: none;
    font-size: 14.5px;
    color: #64748B;
    line-height: 1.75;
    margin-top: 12px;
    padding-right: 36px;
}

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

/* Legacy faq-item p (non-accordion pages) */
.main-body .faq-item p {
    font-size: 14.5px;
    color: #64748B;
    line-height: 1.75;
    margin: 10px 0 0;
}

/* ── 8. SECTION TITLE shared improvement ─────────────────── */
.main-body .section-title {
    font-size: clamp(22px, 3.5vw, 32px);
    font-weight: 800;
    color: #0F172A;
    letter-spacing: -0.4px;
    text-align: center;
    margin-bottom: 16px;
}

/* ── 9. MOBILE OPTIMISATIONS ─────────────────────────────── */

@media (max-width: 768px) {
    .main-body .hero {
        padding: 32px 0 28px;
    }

    .main-body .hero h1 {
        font-size: 26px;
        letter-spacing: -0.4px;
    }

    .hero-trust-pills {
        gap: 6px;
    }

    .trust-pill {
        font-size: 11px;
        padding: 4px 10px;
    }

    .main-body .upload-box {
        padding: 36px 20px 32px;
        border-radius: 14px;
    }

    .upload-icon-circle {
        width: 60px;
        height: 60px;
    }

    .upload-box-heading {
        font-size: 16px;
    }

    .main-body .upload-btn {
        font-size: 15px;
        padding: 14px 28px;
        width: 100%;
        justify-content: center;
    }

    .upload-microcopy {
        gap: 12px;
    }

    .main-body .steps-grid {
        gap: 12px;
    }

    .main-body .step-card {
        max-width: 100%;
        min-width: auto;
    }

    .main-body [class^="how-to"],
    .main-body [class*="how-to"],
    .main-body .tool-features,
    .main-body .faq-section {
        padding: 48px 0;
    }

    .features-cards-grid {
        grid-template-columns: 1fr;
    }

    .main-body .merge-toolbar,
    .main-body .compress-toolbar,
    .main-body .jpg-toolbar,
    .main-body [class$="-toolbar"] {
        gap: 6px;
        padding: 10px 14px;
    }

    .main-body .toolbar-btn {
        font-size: 12px;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .main-body .hero h1 {
        font-size: 22px;
    }

    .main-body .hero p {
        font-size: 14px;
    }

    .hero-trust-pills {
        flex-direction: column;
        gap: 6px;
    }

    .upload-microcopy {
        flex-direction: column;
        gap: 6px;
    }

    .main-body .upload-box {
        padding: 28px 16px 24px;
    }

    .step-flow-item:not(:last-child)::after {
        display: none;
    }

    .main-body .steps-grid {
        flex-direction: column;
        align-items: center;
    }

    .main-body .step-card {
        width: 100%;
    }
}