/* ===== Base & Layout Styles ===== */
body {
    font-family: 'Inter', 'Plus Jakarta Sans', 'Noto Sans Devanagari', sans-serif;
    background-color: #F8FAFC;
    color: #0F172A;
    -webkit-font-smoothing: antialiased;
}
.surface-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03), 0 4px 12px rgba(15, 23, 42, 0.02);
    transition: all 0.18s ease;
}
.tool-nav-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    transition: all 0.16s ease;
}
.tool-nav-card:hover {
    border-color: #94A3B8;
    transform: translateY(-1px);
}
.tool-nav-active {
    border: 1.5px solid #2563EB !important;
    background: #F8FAFF !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.08);
}
.editor-mode-active {
    background: #0F172A !important;
    color: #FFFFFF !important;
    border-color: #0F172A !important;
}
canvas {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    touch-action: none;
}
.book-serif {
    font-family: 'Merriweather', 'Noto Sans Devanagari', Georgia, serif;
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #F1F5F9; border-radius: 4px; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* ===== Tool 1: Audio Reader ===== */
.sentence-chunk {
    transition: background-color 0.2s ease, color 0.2s ease;
    border-radius: 6px;
    padding: 2px 0;
    cursor: pointer;
}
.sentence-chunk:hover {
    background-color: rgba(59, 130, 246, 0.08);
}
.sentence-active {
    background-color: rgba(37, 99, 235, 0.11);
    box-shadow: -3px 0 0 #2563EB;
    padding-left: 4px;
}
.theme-dark .sentence-active {
    background-color: rgba(59, 130, 246, 0.24);
    box-shadow: -3px 0 0 #60A5FA;
}
.word-highlight {
    background-color: #FDE047 !important;
    color: #0F172A !important;
    padding: 1px 5px;
    border-radius: 5px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(202, 138, 4, 0.35);
}
.pdf-page-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 28px 0 18px 0;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748B;
    user-select: none;
}
.pdf-page-divider::before,
.pdf-page-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #CBD5E1;
}
.reader-theme-cream { background-color: #FFFDF7 !important; color: #1E293B !important; border-color: #E7E5E4 !important; }
.reader-theme-sepia { background-color: #F4ECD8 !important; color: #3E2723 !important; border-color: #D7CCC8 !important; }
.reader-theme-dark  { background-color: #0F172A !important; color: #E2E8F0 !important; border-color: #334155 !important; }
.reader-theme-white { background-color: #FFFFFF !important; color: #0F172A !important; border-color: #E2E8F0 !important; }
@keyframes eqPulse {
    0%, 100% { height: 4px; }
    50% { height: 14px; }
}
.eq-bar {
    width: 3px;
    background-color: #34D399;
    border-radius: 2px;
    display: inline-block;
    animation: eqPulse 0.8s infinite ease-in-out;
}
.eq-paused .eq-bar {
    animation: none !important;
    height: 4px !important;
    background-color: #94A3B8 !important;
}

/* ===== Tool 2: True PDF Text Editor ===== */
#pdf-page-stage {
    position: relative;
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.12);
    user-select: none;
    transform-origin: top center;
}
#pdf-editor-canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
}
#pdf-annotation-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 15;
}
#true-text-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 20;
}
.true-pdf-text-item {
    position: absolute;
    cursor: text;
    padding: 0 2px;
    margin: 0;
    border: 1px dashed transparent;
    border-radius: 2px;
    line-height: 1.12;
    white-space: pre;
    outline: none;
    box-sizing: border-box;
    transform-origin: left top;
    transition: border-color 0.12s, background-color 0.12s;
}
.true-pdf-text-item:hover {
    border-color: #3B82F6;
    background-color: rgba(59, 130, 246, 0.08);
}
.true-pdf-text-item:focus {
    background-color: #FFFFFF !important;
    border: 1.5px solid #2563EB !important;
    z-index: 35;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.18);
}
.true-pdf-text-item.modified:not(:focus) {
    border-color: transparent;
    box-shadow: none;
    z-index: 25;
}

/* ===== Tool 3: GDPR Redactor ===== */
#redactor-stage-wrapper {
    position: relative;
    display: inline-block;
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.12);
    border-radius: 6px;
    overflow: hidden;
    user-select: none;
    max-width: 100%;
}
#pdf-redactor-canvas {
    display: block;
    width: 100%;
    height: auto;
}
#pdf-redactor-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    touch-action: none;
    z-index: 20;
}

/* ===== Tool 4: Merge & Split ===== */
.mobile-safe-file-btn {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.mobile-safe-file-btn input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    font-size: 100px;
    z-index: 20;
}
.split-page-card {
    transition: all 0.15s ease;
    cursor: pointer;
    user-select: none;
}
.split-page-card.selected {
    border-color: #2563EB !important;
    background-color: #EFF6FF !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

/* ===== Tool 5: Image to PDF ===== */
.i2p-hidden-input {
    position: fixed;
    top: -9999px;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.i2p-touch-label {
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.i2p-touch-label * {
    pointer-events: none;
}
.i2p-page-card {
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.i2p-page-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px -6px rgba(15, 23, 42, 0.08);
    border-color: #94A3B8;
}
.i2p-paper-sheet {
    background: #FFFFFF;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
    border: 1px solid #E2E8F0;
}

/* ===== Tools 7, 8 & 9: Compress, Unlock & Label Cropper ===== */
.priva-sr-file {
    position: fixed;
    top: -9999px;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.priva-touch-trigger {
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.priva-touch-trigger * {
    pointer-events: none;
}
.cmp-mode-btn-active,
.cmpv2-mode-active {
    background-color: #0F172A !important;
    color: #FFFFFF !important;
    border-color: #0F172A !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.14);
}
.lbl-preset-active {
    background-color: #EA580C !important;
    color: #FFFFFF !important;
    border-color: #EA580C !important;
}

/* ===== Tool 11: Word to PDF ===== */
#w2p-paper-stage h1 { font-size: 1.65rem; font-weight: 800; margin-bottom: 0.6rem; color: #0F172A; line-height: 1.25; }
#w2p-paper-stage h2 { font-size: 1.3rem; font-weight: 700; margin-top: 1rem; margin-bottom: 0.45rem; color: #0F172A; }
#w2p-paper-stage h3 { font-size: 1.08rem; font-weight: 700; margin-top: 0.8rem; margin-bottom: 0.35rem; color: #1E293B; }
#w2p-paper-stage p { margin-bottom: 0.65rem; font-size: 14px; }
#w2p-paper-stage ul { list-style-type: disc; padding-left: 1.4rem; margin-bottom: 0.75rem; font-size: 14px; }
#w2p-paper-stage ol { list-style-type: decimal; padding-left: 1.4rem; margin-bottom: 0.75rem; font-size: 14px; }
#w2p-paper-stage table { width: 100%; border-collapse: collapse; margin: 0.9rem 0; font-size: 13px; }
#w2p-paper-stage th, #w2p-paper-stage td { border: 1px solid #CBD5E1; padding: 6px 10px; text-align: left; }
#w2p-paper-stage th { background: #F1F5F9; font-weight: 700; }
#w2p-paper-stage img { max-width: 100%; height: auto; margin: 0.7rem 0; border-radius: 4px; }

/* ===== SEO Clickable Keyword Pills (Bottom Section) ===== */
.seo-keyword-pill {
    background-color: #F8FAFC;
    border: 1px solid #E2E8F0;
    color: #334155;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 9999px;
    transition: all 0.16s ease;
    cursor: pointer;
}
.seo-keyword-pill:hover {
    background-color: #EFF6FF;
    border-color: #2563EB;
    color: #1D4ED8;
    transform: translateY(-1px);
}

/* ===== Tools 12-18: Sign PDF, Excel/PPT, Organize & OCR Helpers ===== */
.organize-page-card {
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
    user-select: none;
}
.organize-page-card:hover {
    border-color: #2563EB;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.1);
}
.ocr-result-area {
    font-family: 'Inter', 'Noto Sans Devanagari', 'Noto Sans Gurmukhi', sans-serif;
    line-height: 1.7;
}