body[data-tool-page="true"] .pdf-card {
    background:
        radial-gradient(circle at 18% 20%, rgba(211, 47, 47, 0.12), transparent 45%),
        linear-gradient(135deg, var(--bg-card) 0%, var(--bg-section) 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 26px;
    width: min(100%, 1000px);
    margin: 0 auto 30px;
    box-shadow: var(--shadow-soft);
    box-sizing: border-box;
}

body[data-tool-page="true"] .upload-buttons {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 28px;
    border: 2px dashed rgba(211, 47, 47, 0.35);
    border-radius: 12px;
    background:
        radial-gradient(circle at 20% 20%, rgba(211, 47, 47, 0.12), transparent 55%),
        var(--bg-elevated);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02), 0 14px 28px rgba(0, 0, 0, 0.32);
    box-sizing: border-box;
}

body[data-tool-page="true"] .custom-file-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: 0.2s ease;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
    min-height: 46px;
    max-width: 100%;
}

body[data-tool-page="true"] .custom-file-btn svg {
    width: 20px;
    height: 20px;
}

body[data-tool-page="true"] .custom-file-btn:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

body[data-tool-page="true"] .camera-btn {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    border-color: rgba(255, 255, 255, 0.08);
}

body[data-tool-page="true"] .gallery-btn {
    background: var(--bg-elevated);
}

body[data-tool-page="true"] .preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    border: 1px dashed var(--border);
    background: var(--bg-elevated);
    min-height: 84px;
    justify-content: center;
    box-sizing: border-box;
}

body[data-tool-page="true"] .img-wrapper {
    width: 120px;
    border: 1px solid var(--border);
    padding: 6px;
    border-radius: 10px;
    cursor: grab;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    background: var(--bg-card);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    box-sizing: border-box;
}

body[data-tool-page="true"] .preview-img {
    max-width: 100%;
    max-height: 100px;
    margin-bottom: 6px;
    border-radius: 6px;
    background: #0b0f14;
}

body[data-tool-page="true"] .caption-input {
    width: 100%;
    font-size: 12px;
    padding: 6px 8px;
    border-radius: 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-primary);
    box-sizing: border-box;
}

body[data-tool-page="true"] .caption-input::placeholder {
    color: var(--text-muted);
}

body[data-tool-page="true"] .delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--error);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

body[data-tool-page="true"] #imageCount {
    color: var(--text-muted);
    margin: 12px 0 0;
    font-weight: 600;
    text-align: center;
}

body[data-tool-page="true"] #imagePdfForm > .btn {
    display: block;
    margin: 16px auto 0;
    min-width: 180px;
}

body[data-tool-page="true"] .scan-result-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
    align-items: center;
}

body[data-tool-page="true"] .scan-result-actions .btn {
    margin: 0;
}

body[data-tool-page="true"] .scan-result-actions .btn-share {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 10px;
    line-height: 0;
    gap: 0;
}

body[data-tool-page="true"] .scan-result-actions .btn-share svg {
    width: 18px;
    height: 18px;
    display: block;
    flex-shrink: 0;
}

body[data-tool-page="true"] .btn-share::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translate(-50%, -4px);
    background: rgba(22, 27, 34, 0.96);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px 10px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 10px 24px rgba(0,0,0,0.35);
    z-index: 20;
}

body[data-tool-page="true"] .btn-share:hover::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

body[data-tool-page="true"] #pdfPreview {
    width: 100%;
    height: 500px;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-top: 18px;
    background: var(--bg-elevated);
    box-shadow: var(--shadow-soft);
    display: block;
}

body[data-tool-page="true"] .share-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 20, 25, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 9999;
    backdrop-filter: blur(6px);
}

body[data-tool-page="true"] .share-modal[hidden] { display: none; }

body[data-tool-page="true"] .share-dialog {
    background: linear-gradient(135deg, #161B22 0%, #111827 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px 26px;
    width: min(460px, 92vw);
    box-shadow: 0 24px 60px rgba(0,0,0,0.55);
    color: var(--text-primary);
    position: relative;
}

body[data-tool-page="true"] .share-dialog h3 {
    margin: 0 0 8px 0;
    color: var(--text-heading);
    font-size: 1.25rem;
}

body[data-tool-page="true"] .share-subtext {
    color: var(--text-muted);
    margin: 0 0 18px 0;
}

body[data-tool-page="true"] .share-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: center;
}

body[data-tool-page="true"] .share-copy {
    width: 42px;
    height: 42px;
}

body[data-tool-page="true"] .share-icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-primary);
    text-decoration: none;
    position: relative;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

body[data-tool-page="true"] .share-icon-btn svg {
    width: 20px;
    height: 20px;
}

body[data-tool-page="true"] .share-icon-btn:hover {
    color: #fff;
    border-color: rgba(211,47,47,0.5);
    box-shadow: 0 10px 24px rgba(211,47,47,0.2);
    transform: translateY(-2px);
}

body[data-tool-page="true"] .share-icon-btn.is-copied::after {
    content: 'Copied';
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translate(-50%, -4px);
    background: rgba(22, 27, 34, 0.96);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px 8px;
    font-size: 0.8rem;
    opacity: 1;
    white-space: nowrap;
    box-shadow: 0 10px 24px rgba(0,0,0,0.35);
    pointer-events: none;
}

body[data-tool-page="true"] .share-bmc-wrap {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

body[data-tool-page="true"] .share-bmc {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    border-radius: 999px;
    background: linear-gradient(135deg, #D32F2F 0%, #B71C1C 100%);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 14px 32px rgba(211,47,47,0.4);
    overflow: hidden;
}

body[data-tool-page="true"] .share-bmc::before {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 999px;
    border: 1px solid rgba(211,47,47,0.45);
    opacity: 0;
    animation: sharePulse 2.8s ease-out infinite;
}

body[data-tool-page="true"] .share-note {
    margin-top: 18px;
    padding: 12px 14px;
    background: rgba(31, 41, 55, 0.7);
    border-radius: 12px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

body[data-tool-page="true"] .share-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
}

body[data-tool-page="true"] .share-close:hover {
    background: var(--bg-card);
}

@keyframes sharePulse {
    0% { transform: scale(0.95); opacity: 0; }
    15% { opacity: 0.8; }
    100% { transform: scale(1.25); opacity: 0; }
}

body[data-tool-page="true"] .pdf-loading {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 20, 25, 0.82);
    z-index: 9999;
    backdrop-filter: blur(4px);
}

body[data-tool-page="true"] .pdf-loading[hidden] { display: none; }

body[data-tool-page="true"] .pdf-loading-inner {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.95), rgba(17, 24, 39, 0.95));
    border: 1px solid rgba(211, 47, 47, 0.35);
    border-radius: 999px;
    padding: 12px 18px;
    color: var(--text-primary);
    box-shadow: 0 18px 40px rgba(0,0,0,0.55), 0 0 28px rgba(211,47,47,0.25);
}

body[data-tool-page="true"] .pdf-spinner {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 3px solid rgba(211,47,47,0.25);
    border-top-color: var(--accent);
    box-shadow: 0 0 12px rgba(211,47,47,0.55);
    animation: pdfSpinner 0.9s linear infinite;
}

body[data-tool-page="true"] .pdf-loading-text {
    font-size: 0.98rem;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

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

/* Content Sections */
body[data-tool-page="true"] .content-section {
    padding: 40px;
    border-radius: 16px;
    margin: 30px auto;
    max-width: 1120px;
    box-sizing: border-box;
}

body[data-tool-page="true"] .content-section h2 {
    margin-bottom: 20px;
    font-size: 1.8rem;
}

body[data-tool-page="true"] .content-section p {
    color: var(--text-muted) !important;
    line-height: 1.8;
    margin-bottom: 15px;
}

body[data-tool-page="true"] .steps-guide {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 25px 0;
}

body[data-tool-page="true"] .step-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    min-width: 0;
}

body[data-tool-page="true"] .step-num {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

body[data-tool-page="true"] .step-content p {
    color: var(--text-muted) !important;
    margin: 0;
}

body[data-tool-page="true"] .features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin: 25px 0;
}

body[data-tool-page="true"] .feature-card {
    border-left: 3px solid var(--accent);
}

body[data-tool-page="true"] .feature-card p {
    color: var(--text-muted) !important;
    margin: 0;
    font-size: 0.95rem;
}

body[data-tool-page="true"] .use-cases-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 25px 0;
}

body[data-tool-page="true"] .use-case-item {
    background: var(--bg-section);
    padding: 15px 20px;
    border-radius: 10px;
    color: var(--text-primary);
    font-weight: 600;
    border: 1px solid var(--border);
}

body[data-tool-page="true"] .faq-item p {
    color: var(--text-muted) !important;
    margin: 0;
}

body[data-tool-page="true"] .cta-section {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #fff;
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    margin: 30px auto;
    max-width: 1120px;
    box-sizing: border-box;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

body[data-tool-page="true"] .cta-section p {
    color: rgba(255, 255, 255, 0.92) !important;
    margin-bottom: 20px;
}

body[data-tool-page="true"] .cta-btn {
    background: #fff;
    color: var(--accent);
    padding: 12px 30px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
}

body[data-tool-page="true"] .related-tools {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 25px 0;
}

body[data-tool-page="true"] .related-tool-link {
    background: var(--bg-section);
    padding: 15px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-primary) !important;
    text-align: center;
    transition: all 0.3s;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 64px;
}

body[data-tool-page="true"] .related-tool-link span {
    margin-right: 0 !important;
    flex-shrink: 0;
}

body[data-tool-page="true"] .related-tool-link:hover {
    background: var(--bg-elevated);
    color: var(--text-heading) !important;
    transform: translateY(-3px);
    border-color: var(--accent);
}

@media (max-width: 768px) {
    body[data-tool-page="true"] .pdf-card {
        padding: 18px;
        border-radius: 12px;
    }

    body[data-tool-page="true"] .content-section { padding: 25px; }
    body[data-tool-page="true"] .step-item { flex-direction: column; gap: 10px; }
    body[data-tool-page="true"] .features-grid,
    body[data-tool-page="true"] .use-cases-list,
    body[data-tool-page="true"] .related-tools { grid-template-columns: 1fr; }
    body[data-tool-page="true"] .upload-buttons {
        flex-direction: column;
        align-items: stretch;
        padding: 22px 16px;
    }
    body[data-tool-page="true"] .custom-file-btn { width: 100%; justify-content: center; }
    body[data-tool-page="true"] #imagePdfForm > .btn,
    body[data-tool-page="true"] .scan-result-actions .btn {
        width: 100%;
    }
    body[data-tool-page="true"] .scan-result-actions .btn-share {
        width: 42px;
        margin: 0 auto;
    }
    body[data-tool-page="true"] #pdfPreview {
        height: 420px;
    }
    body[data-tool-page="true"] .btn-share::after {
        white-space: normal;
        width: 200px;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    body[data-tool-page="true"] .share-bmc::before {
        animation: none;
    }
    body[data-tool-page="true"] .pdf-spinner {
        animation: none;
    }
}
