/*! AI Text Cleaner v8.7 | © 2025 OneHack.us | All Rights Reserved | minitools.onehack.us | b:7k9m2p4 */
* { box-sizing: border-box; margin: 0; padding: 0; }
._oh7k9m2p4{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}

/* Skip Link for Accessibility - Hidden but functional */
.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: -1;
}

.skip-link:focus {
    position: fixed;
    top: 10px;
    left: 10px;
    width: auto;
    height: auto;
    overflow: visible;
    z-index: 10000;
    background: #333;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    outline: 2px solid #fff;
}

/* Visually hidden but accessible to screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Anti-copy protection */
body, html {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Allow selection in textareas and inputs */
textarea, input {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Disable image dragging */
img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    pointer-events: none;
}

/* Performance optimizations */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    color: #333333;
    line-height: 1.6;
    text-rendering: optimizeSpeed;
    overflow-x: hidden;
}

/* GPU acceleration for animations */
.tab, .btn, .clean-btn, .ai-option-card, .format-card, .convert-btn {
    will-change: transform;
    transform: translateZ(0);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    padding: 30px 0 20px;
}

h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: #333333;
}

.logo-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: opacity 0.2s;
}

.logo-link:hover {
    opacity: 0.8;
}

.typing-title {
    display: inline;
}

.typing-cursor {
    display: inline-block;
    width: 3px;
    height: 1.1em;
    background: #E53131;
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: blink 0.7s infinite;
}

.typing-cursor.hidden {
    opacity: 0;
    animation: none;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.strikethrough {
    text-decoration: line-through;
    color: #767676;
}

.corrected {
    color: #E53131 !important;
    font-weight: 700;
}

.subtitle {
    color: #555555;
    margin-top: 8px;
}

/* Live Viewers Counter */
.live-viewers {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #fff5f5 0%, #fff 100%);
    border: 1px solid #ffdddd;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.85rem;
    color: #595959;
    margin-top: 10px;
    box-shadow: 0 2px 8px rgba(229, 49, 49, 0.1);
}

.viewer-count {
    font-weight: 700;
    color: #E53131;
    font-size: 0.95rem;
}

.viewer-label {
    color: #595959;
}

.lightning {
    color: #f5a623;
    animation: pulse-lightning 1.5s ease-in-out infinite;
}

.cleaning-status {
    color: #E53131;
    font-style: italic;
    font-size: 0.8rem;
}

.broom {
    animation: sweep 0.8s ease-in-out infinite;
    display: inline-block;
}

@keyframes pulse-lightning {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

@keyframes sweep {
    0%, 100% { transform: rotate(-10deg); }
    50% { transform: rotate(10deg); }
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.tab {
    padding: 10px 20px;
    min-height: 44px; /* WCAG 2.2 touch target */
    border: none;
    background: #f5f5f5;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666666;
    transition: all 0.2s;
}

.tab:hover { background: #eeeeee; color: #333333; }
.tab.active { background: #E53131; color: white; font-weight: 600; }

/* Panels */
.panel {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    border: 1px solid #f0f0f0;
}

.section { display: none; }
.section.active { display: block; }

.section-title { color: #333333; margin-bottom: 6px; font-size: 1.1rem; font-weight: 600; }
.section-desc { color: #595959; margin-bottom: 16px; font-size: 0.9rem; }

/* Main grid */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 800px) {
    .main-grid { grid-template-columns: 1fr; }
    h1 { font-size: 1.6rem; }
    .container { padding: 12px; }
    header { padding: 20px 0 15px; }
    .panel { padding: 16px; }
    textarea { min-height: 200px; }
    .live-stats { gap: 10px; padding: 8px 12px; }
    .live-stat { font-size: 0.8rem; }
}

@media (max-width: 480px) {
    h1 { font-size: 1.3rem; }
    .subtitle { font-size: 0.85rem; }
    .quick-buttons { gap: 8px; }
    .magic-btn { padding: 12px 20px; font-size: 0.9rem; }
    .info-btn { padding: 12px 18px; }
    .tabs { gap: 6px; }
    .tab { padding: 8px 12px; font-size: 0.8rem; }
    .panel { padding: 12px; border-radius: 12px; }
    .cards-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .card { padding: 10px; }
    .card-title { font-size: 0.8rem; }
    .card-example { font-size: 0.7rem; }
    .stats { gap: 8px; padding: 10px 12px; }
    .stat-value { font-size: 1rem; }
    .live-stats { flex-direction: row; justify-content: space-around; }
    .live-stat { flex-direction: column; text-align: center; gap: 2px; }
    .live-stat-label { font-size: 0.65rem; }
    .replace-row { flex-wrap: wrap; }
    .replace-row input { min-width: 100px; }
    .clean-btn { padding: 10px 22px; font-size: 0.9rem; }
    .btn { padding: 8px 14px; font-size: 0.8rem; }
    .modal-content { padding: 20px; }
    .modal-content h2 { font-size: 1.2rem; }
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.panel-title { font-weight: 700; color: #333333; }

textarea {
    width: 100%;
    min-height: 300px;
    padding: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.9rem;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.2s;
    background: #ffffff;
    color: #333333;
}

textarea:focus {
    outline: none;
    border-color: #EA5D5D;
}

textarea::placeholder {
    color: #767676;
}

/* Buttons - WCAG 2.2 minimum 44x44px touch targets */
.btn {
    padding: 10px 18px;
    min-height: 44px;
    min-width: 44px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #EA5D5D 0%, #E53131 100%);
    color: white;
}

.btn-primary:hover { transform: translateY(-1px); }

.btn-success {
    background: linear-gradient(135deg, #EA5D5D 0%, #E53131 100%);
    color: white;
}

.btn-secondary {
    background: #f5f5f5;
    color: #555555;
    border: 1px solid #e0e0e0;
}

.btn-secondary:hover { background: #eeeeee; color: #333333; }

/* ══════════════════════════════════════════════════════════════════════════
   Fix Issues Button - "Stretched Latex" Neumorphic Effect
   Taut, tight surface under tension - sharp edges, pulled outward
   Like rubber stretched to the point it could snap
   © 2025 OneHack.us
   ══════════════════════════════════════════════════════════════════════════ */

/* Base button - stretched/taut tension look */
.btn-fix-issues {
    --neu-shadow-dark: rgba(160, 160, 165, 0.35);
    --neu-shadow-light: rgba(255, 255, 255, 0.9);
    --neu-text: #666;
    --check-color: #22c55e;
    --circle-size: 32px;

    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;

    /* Tight, stretched surface - very subtle gradient for tension */
    background: linear-gradient(
        160deg,
        #f8f8f8 0%,
        #f0f0f0 40%,
        #e8e8e8 100%
    );
    color: var(--neu-text);

    /* Sharp, crisp edge - like stretched material */
    border: 1px solid rgba(255, 255, 255, 0.7);
    font-weight: 600;
    font-size: 0.8rem;
    padding: 8px 14px;

    /* Tight radius - sharp, not pillowy */
    border-radius: 6px;
    cursor: pointer;
    margin-right: 8px;
    vertical-align: middle;

    /* Minimal shadow - just enough to show it's raised/stretched out */
    box-shadow:
        2px 2px 4px var(--neu-shadow-dark),
        -1px -1px 3px var(--neu-shadow-light),
        /* Inner edge highlight - tight stretched surface catching light */
        inset 0 1px 0 rgba(255, 255, 255, 0.6);

    outline: none;
    -webkit-font-smoothing: antialiased;
    transition: all 0.2s ease;
}

/* Hover - pressed/sunk into the surface */
.btn-fix-issues:hover {
    background: linear-gradient(
        160deg,
        #efefef 0%,
        #e8e8e8 40%,
        #e0e0e0 100%
    );
    border-color: rgba(200, 200, 200, 0.5);

    /* Inset = pressed in */
    box-shadow:
        inset 2px 2px 4px var(--neu-shadow-dark),
        inset -1px -1px 3px var(--neu-shadow-light);
}

/* Active/Pressed - deeper press */
.btn-fix-issues:active,
.btn-fix-issues.pressed {
    box-shadow:
        inset 3px 3px 5px var(--neu-shadow-dark),
        inset -2px -2px 4px var(--neu-shadow-light);
    transform: scale(0.98);
}

/* ═══════════════════════════════════════════════════════════════════════════
   ANIMATION ELEMENTS - Hidden by default, absolutely centered
   ═══════════════════════════════════════════════════════════════════════════ */

/* Progress ring + checkmark container - centered in button */
.btn-fix-issues .fix-check {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: var(--circle-size);
    height: var(--circle-size);
    opacity: 0;
    pointer-events: none;
    z-index: 2;
}

/* SVG progress ring */
.btn-fix-issues .progress-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.btn-fix-issues .progress-ring circle {
    fill: none;
    stroke: var(--check-color);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-dasharray: 100.5;
    stroke-dashoffset: 100.5;
}

/* Checkmark - thin, elegant */
.btn-fix-issues .checkmark-path {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
}

.btn-fix-issues .checkmark-path::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 0;
    width: 5px;
    height: 9px;
    border: solid var(--check-color);
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
    opacity: 0;
}

/* Button text - z-index 1 so it's below the animation */
.btn-fix-issues .fix-text {
    display: inline-block;
    transition: opacity 0.15s ease;
    white-space: nowrap;
    z-index: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ANIMATING STATE - Text fades out, button morphs to circle
   ═══════════════════════════════════════════════════════════════════════════ */

.btn-fix-issues.animating {
    width: var(--circle-size);
    min-width: var(--circle-size);
    max-width: var(--circle-size);
    height: var(--circle-size);
    padding: 0;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    pointer-events: none;
    transition: all 0.2s ease;
}

/* Text completely hidden during animation */
.btn-fix-issues.animating .fix-text {
    opacity: 0;
    position: absolute;
    width: 0;
    overflow: hidden;
}

/* Circle animation visible */
.btn-fix-issues.animating .fix-check {
    opacity: 1;
}

.btn-fix-issues.animating .progress-ring circle {
    animation: ring-draw 0.6s ease-out forwards;
}

.btn-fix-issues.animating .checkmark-path::after {
    animation: check-draw 0.3s ease-out 0.5s forwards;
}

@keyframes ring-draw {
    to { stroke-dashoffset: 0; }
}

@keyframes check-draw {
    0% { opacity: 0; transform: rotate(45deg) scale(0); }
    50% { opacity: 1; transform: rotate(45deg) scale(1.2); }
    100% { opacity: 1; transform: rotate(45deg) scale(1); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   DONE STATE - Hold the checkmark
   ═══════════════════════════════════════════════════════════════════════════ */

.btn-fix-issues.done {
    width: var(--circle-size);
    min-width: var(--circle-size);
    max-width: var(--circle-size);
    height: var(--circle-size);
    padding: 0;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    pointer-events: none;
}

.btn-fix-issues.done .fix-text {
    opacity: 0;
    position: absolute;
    width: 0;
    overflow: hidden;
}

.btn-fix-issues.done .fix-check {
    opacity: 1;
}

.btn-fix-issues.done .progress-ring circle {
    stroke-dashoffset: 0;
}

.btn-fix-issues.done .checkmark-path::after {
    opacity: 1;
    transform: rotate(45deg) scale(1);
}

/* ═══════════════════════════════════════════════════════════════════════════
   RETURNING STATE - Morph back to button
   ═══════════════════════════════════════════════════════════════════════════ */

.btn-fix-issues.returning {
    width: auto;
    min-width: auto;
    max-width: none;
    height: auto;
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    background: linear-gradient(160deg, #f8f8f8 0%, #f0f0f0 40%, #e8e8e8 100%);
    box-shadow:
        2px 2px 4px var(--neu-shadow-dark),
        -1px -1px 3px var(--neu-shadow-light),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    pointer-events: none;
    transition: all 0.3s ease;
}

.btn-fix-issues.returning .fix-check {
    opacity: 0;
}

.btn-fix-issues.returning .fix-text {
    opacity: 1;
    position: static;
    width: auto;
    overflow: visible;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .btn-fix-issues {
        --circle-size: 28px;
        padding: 7px 12px;
        font-size: 0.75rem;
        margin-right: 6px;
        border-radius: 5px;
        box-shadow:
            2px 2px 3px var(--neu-shadow-dark),
            -1px -1px 2px var(--neu-shadow-light),
            inset 0 1px 0 rgba(255, 255, 255, 0.5);
    }
    .btn-fix-issues:hover {
        box-shadow:
            inset 2px 2px 3px var(--neu-shadow-dark),
            inset -1px -1px 2px var(--neu-shadow-light);
    }
}

@media (max-width: 480px) {
    .btn-fix-issues {
        --circle-size: 26px;
        padding: 6px 10px;
        font-size: 0.7rem;
        margin-right: 4px;
        border-radius: 4px;
        box-shadow:
            1px 1px 3px var(--neu-shadow-dark),
            -1px -1px 2px var(--neu-shadow-light),
            inset 0 1px 0 rgba(255, 255, 255, 0.4);
    }
    .btn-fix-issues:hover {
        box-shadow:
            inset 1px 1px 3px var(--neu-shadow-dark),
            inset -1px -1px 2px var(--neu-shadow-light);
    }
    .btn-fix-issues .checkmark-path::after {
        width: 4px;
        height: 7px;
        border-width: 0 1.5px 1.5px 0;
    }
}

.btn-small { padding: 8px 14px; font-size: 0.8rem; }

/* Button feedback states */
.btn-success-feedback {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
    color: white !important;
    border-color: #16a34a !important;
    transform: scale(1.02);
    transition: all 0.15s ease;
}

.btn-error-feedback {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: white !important;
    border-color: #dc2626 !important;
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

.btn-group { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ═══════════════════════════════════════════════════════════════════════════
   FIX ISSUES v2.1 - Centered Below Result Textarea
   ═══════════════════════════════════════════════════════════════════════════ */

/* Container for Fix Issues button - centered between textarea and stats */
.fix-issues-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 12px 0 8px;
    position: relative;
}

/* Mode indicator - shows "Fixing for: Perplexity AI v1.6" */
.fix-mode-indicator {
    display: none;
    font-size: 0.7rem;
    color: #666;
    background: linear-gradient(135deg, #f5f5f7 0%, #eee 100%);
    padding: 4px 10px;
    border-radius: 12px;
    opacity: 0;
    transform: translateY(-5px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.fix-mode-indicator.show {
    display: inline-block;
    opacity: 1;
    transform: translateY(0);
}

/* Fix suggestions container */
.fix-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 12px;
    z-index: 100;
    min-width: 220px;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.fix-suggestions.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.fix-suggestions-header {
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
}

.fix-suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fix-suggestion-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    font-size: 0.75rem;
    color: #333;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.fix-suggestion-btn:hover {
    background: #f0f0f0;
    border-color: #ccc;
    transform: translateX(2px);
}

.fix-risk-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
    white-space: nowrap;
}

.fix-risk-low {
    background: #dcfce7;
    color: #166534;
}

.fix-risk-medium {
    background: #fef3c7;
    color: #92400e;
}

.fix-risk-high {
    background: #fee2e2;
    color: #991b1b;
}

/* Make btn-group relative for suggestion positioning */
.panel-header .btn-group {
    position: relative;
}

@media (max-width: 768px) {
    .fix-mode-indicator {
        font-size: 0.65rem;
        padding: 3px 8px;
    }

    .fix-suggestions {
        min-width: 180px;
        right: -10px;
    }

    .fix-suggestion-btn {
        font-size: 0.7rem;
        padding: 6px 10px;
    }
}

@media (max-width: 480px) {
    .fix-mode-indicator {
        display: none !important;
    }

    .fix-suggestions {
        position: fixed;
        bottom: 20px;
        left: 10px;
        right: 10px;
        top: auto;
        min-width: auto;
    }
}

/* Find/Replace rows */
.replace-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }

.replace-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.replace-row input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.85rem;
    background: #ffffff;
    color: #333333;
}

.replace-row input:focus { outline: none; border-color: #EA5D5D; }

.replace-row input::placeholder {
    color: #767676;
}

.remove-btn {
    background: #fff0f0;
    color: #E53131;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
}

.remove-btn:hover { background: #ffe0e0; }

/* Options */
.options {
    display: flex;
    gap: 16px;
    margin: 14px 0;
    flex-wrap: wrap;
}

.option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #555555;
}

.option input { width: 18px; height: 18px; accent-color: #E53131; }

/* Cards grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin: 16px 0;
}

.card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
    background: #f9f9f9;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.card:hover { background: #f0f0f0; }
.card.selected { border-color: #E53131; background: #fff5f5; }
.card input { width: 18px; height: 18px; margin-top: 2px; accent-color: #E53131; }

.card-info { flex: 1; }
.card-title { font-weight: 600; color: #333333; margin-bottom: 2px; font-size: 0.9rem; }
.card-example { font-size: 0.75rem; color: #666666; font-family: monospace; }

/* Pattern list */
.pattern-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 16px 0;
    max-height: 200px;
    overflow-y: auto;
}

.pattern-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f9f9f9;
    border-radius: 8px;
}

.pattern-item input { width: 18px; height: 18px; accent-color: #E53131; }

.pattern-text {
    flex: 1;
    font-family: monospace;
    font-size: 0.85rem;
    color: #333333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pattern-count {
    background: #E53131;
    color: white;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* File upload */
.file-upload {
    border: 2px dashed #d0d0d0;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
}

.file-upload:hover { border-color: #EA5D5D; background: #fff5f5; }
.file-upload.dragover { border-color: #E53131; background: #fff0f0; }
.file-upload input { display: none; }
.file-upload p { color: #666666; margin-bottom: 4px; font-size: 0.9rem; }
.file-info { color: #666666; font-size: 0.8rem; }

/* Stats */
.stats {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    background: #f9f9f9;
    border-radius: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.stat { text-align: center; min-width: 50px; }
.stat-value { font-size: 1.1rem; font-weight: 700; color: #E53131; }
.stat-label { font-size: 0.65rem; color: #666666; text-transform: uppercase; }

/* Diff stats - show reduction/increase */
.stat-diff {
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 2px;
}
.stat-diff.reduced { color: #22c55e; }
.stat-diff.increased { color: #E53131; }
.stat-diff.neutral { color: #666666; }

/* Live stats bar in sections */
.live-stats {
    display: flex;
    gap: 16px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #fff5f5 0%, #fef2f2 100%);
    border-radius: 8px;
    margin: 12px 0;
    border: 1px solid #fecaca;
    flex-wrap: wrap;
    align-items: center;
}

.live-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    color: #555;
}

.live-stat-value { font-weight: 700; color: #E53131; }
.live-stat-label { color: #595959; font-weight: 500; }

/* Badge */
.badge {
    display: inline-block;
    padding: 3px 10px;
    background: linear-gradient(135deg, #EA5D5D 0%, #E53131 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 8px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 14px 24px;
    background: #333333;
    color: white;
    border-radius: 10px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    z-index: 1000;
    font-weight: 500;
    font-size: 0.9rem;
}

.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: linear-gradient(135deg, #EA5D5D 0%, #E53131 100%); }

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1001;
    padding: 20px;
}

.modal.show { display: flex; }

.modal-content {
    background: #ffffff;
    border-radius: 16px;
    padding: 28px;
    max-width: 550px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-content h2 { color: #333333; margin-bottom: 16px; font-size: 1.4rem; }
.modal-content h3 { color: #444444; margin: 20px 0 10px; font-size: 1rem; }
.modal-content p { color: #555555; margin-bottom: 10px; line-height: 1.6; font-size: 0.9rem; }
.modal-content code { background: #f5f5f5; padding: 2px 6px; border-radius: 4px; font-size: 0.85rem; color: #E53131; }
.modal-content pre { background: #f5f5f5; color: #333333; padding: 14px; border-radius: 8px; overflow-x: auto; font-size: 0.8rem; margin: 10px 0; }

.help-text { font-size: 0.8rem; color: #666666; margin-top: 10px; line-height: 1.5; }
.divider { height: 1px; background: #e0e0e0; margin: 16px 0; }

/* ========== GLASS BUTTON - Neumorphic Style ========== */
.clean-btn-wrap {
    position: relative;
    display: inline-block;
    perspective: 500px;
}

.clean-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 36px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    color: #E53131;
    background: linear-gradient(145deg, #ffffff, #e6e6e6);
    box-shadow:
        8px 8px 20px rgba(163, 163, 163, 0.5),
        -8px -8px 20px rgba(255, 255, 255, 0.9),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    overflow: hidden;
}

/* Glossy highlight on top */
.clean-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 50%;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.8) 0%,
        rgba(255, 255, 255, 0.4) 40%,
        transparent 100%
    );
    border-radius: 50px 50px 100px 100px;
    pointer-events: none;
}

/* Hover state */
.clean-btn:hover {
    transform: scale(0.98);
    box-shadow:
        6px 6px 15px rgba(163, 163, 163, 0.5),
        -6px -6px 15px rgba(255, 255, 255, 0.9),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* Active/Pressed state - inset effect */
.clean-btn:active {
    transform: scale(0.96);
    box-shadow:
        2px 2px 8px rgba(163, 163, 163, 0.5),
        -2px -2px 8px rgba(255, 255, 255, 0.9),
        inset 4px 4px 10px rgba(163, 163, 163, 0.3),
        inset -2px -2px 8px rgba(255, 255, 255, 0.5);
}

/* Button content wrapper */
.clean-btn-content {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

/* Icon */
.clean-btn-icon {
    font-size: 1.2em;
    transition: transform 0.3s ease;
}

.clean-btn:hover .clean-btn-icon {
    transform: rotate(15deg) scale(1.1);
}

/* Text */
.clean-btn-text {
    letter-spacing: 0.02em;
}

/* Shadow reflection underneath */
.clean-btn-shadow {
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    height: 10px;
    background: radial-gradient(ellipse, rgba(0,0,0,0.15) 0%, transparent 70%);
    pointer-events: none;
    transition: all 0.2s ease;
}

.clean-btn:hover + .clean-btn-shadow {
    width: 65%;
    opacity: 0.8;
}

.clean-btn:active + .clean-btn-shadow {
    width: 60%;
    opacity: 0.6;
    bottom: -8px;
}

/* ========== SUCCESS STATE ========== */
.clean-btn.success {
    background: linear-gradient(145deg, #a8f0c0, #7dd695);
    color: #15803d;
    animation: celebrate 0.4s ease;
}

@keyframes celebrate {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* ========== PROCESSING STATE ========== */
.clean-btn.processing {
    background: linear-gradient(145deg, #fef3c7, #fcd34d);
    color: #92400e;
    animation: pulse-btn 1.5s ease-in-out infinite;
}

@keyframes pulse-btn {
    0%, 100% {
        transform: scale(1);
        box-shadow:
            8px 8px 20px rgba(163, 140, 80, 0.4),
            -8px -8px 20px rgba(255, 255, 255, 0.9);
    }
    50% {
        transform: scale(0.98);
        box-shadow:
            5px 5px 15px rgba(163, 140, 80, 0.4),
            -5px -5px 15px rgba(255, 255, 255, 0.9);
    }
}

/* ========== ERROR STATE ========== */
.clean-btn.error {
    background: linear-gradient(145deg, #fecaca, #f87171);
    color: #7f1d1d;
    animation: shake-btn 0.5s ease-in-out;
}

@keyframes shake-btn {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

/* ========== ERROR TOAST (global) ========== */
.toast.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border-left: 4px solid #7f1d1d;
}

.toast.error::before {
    content: '⚠️ ';
}

/* ========== BUTTON FEEDBACK SYSTEM v1.0 ========== */
/* Success flash - green glow */
.btn-success-flash,
.btn.btn-success-flash {
    animation: btn-success-flash 0.6s ease-out;
}

@keyframes btn-success-flash {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    50% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.3); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Error flash - red shake */
.btn-error-flash,
.btn.btn-error-flash {
    animation: btn-error-flash 0.5s ease-out;
}

@keyframes btn-error-flash {
    0%, 100% { transform: translateX(0); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-3px); }
    20%, 40%, 60%, 80% { transform: translateX(3px); }
    50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.3); }
}

/* Working/disabled state */
.btn-working,
.btn.btn-working {
    opacity: 0.7;
    cursor: wait;
    pointer-events: none;
}

/* Quick pulse for instant actions */
.btn-pulse,
.btn.btn-pulse {
    animation: btn-pulse 0.3s ease-out;
}

@keyframes btn-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Toast info/warning variants */
.toast.info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-left: 4px solid #1d4ed8;
}

.toast.info::before {
    content: 'ℹ️ ';
}

.toast.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border-left: 4px solid #92400e;
}

.toast.warning::before {
    content: '⚡ ';
}

/* AI Cleanup Options */
.ai-cleanup-options {
    margin: 16px 0;
}

.ai-cleanup-label {
    font-weight: 600;
    color: #555;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.ai-option-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-option {
    cursor: pointer;
}

.ai-option input {
    display: none;
}

.ai-option-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #f9f9f9;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.ai-option-card:hover {
    border-color: #EA5D5D;
    background: #fff;
}

.ai-option input:checked + .ai-option-card {
    border-color: #E53131;
    background: linear-gradient(135deg, #fff5f5 0%, #fef2f2 100%);
    box-shadow: 0 2px 10px rgba(229,49,49,0.1);
}

.ai-option-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.ai-option-logo {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    object-fit: contain;
    border-radius: 6px;
}

.ai-option-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ai-option-name {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

/* Version Badge - Minimalist Style */
.version-badge {
    font-size: 0.6rem;
    font-weight: 500;
    background: rgba(100, 116, 139, 0.12);
    color: #64748b;
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 5px;
    vertical-align: middle;
    letter-spacing: -0.01em;
}

.ai-option input:checked + .ai-option-card .version-badge {
    background: rgba(229, 49, 49, 0.12);
    color: #dc2626;
}

.ai-option input:checked + .ai-option-card .ai-option-name {
    color: #E53131;
}

.ai-option-desc {
    font-size: 0.8rem;
    color: #777;
}

.ai-option-tip {
    display: block;
    font-size: 0.75rem;
    color: #777;
    margin-top: 4px;
}

.ai-option-tip u {
    text-decoration-color: #f59e0b;
    text-underline-offset: 2px;
}

/* Natural Mode Options - Glass Toggle Button */
.natural-mode-options {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.ai-option input:checked + .ai-option-card .natural-mode-options {
    display: block;
}

/* ========== JELLY TOGGLE SWITCH ========== */
.glass-toggle-wrap {
    position: relative;
    display: inline-block;
}

.glass-toggle-wrap > input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.glass-toggle {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: linear-gradient(180deg, #e8e8eb 0%, #dcdcdf 100%);
    border-radius: 100px;
    padding: 5px;
    box-shadow:
        inset 3px 3px 8px rgba(0, 0, 0, 0.1),
        inset -2px -2px 6px rgba(255, 255, 255, 0.7),
        0 2px 4px rgba(0, 0, 0, 0.05);
}

.glass-toggle-option {
    position: relative;
    z-index: 5;
    padding: 10px 22px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: color 0.25s ease, transform 0.15s ease;
    user-select: none;
    white-space: nowrap;
    text-align: center;
    border-radius: 100px;
    display: block;
    -webkit-tap-highlight-color: transparent;
}

.glass-toggle-option:hover {
    color: #4b5563;
}

.glass-toggle-option:active {
    transform: scale(0.95);
}

/* Jelly slider blob */
.glass-toggle-slider {
    position: absolute;
    top: 5px;
    left: 5px;
    width: calc(50% - 5px);
    height: calc(100% - 10px);
    background: linear-gradient(145deg, #ffffff 0%, #f5f5f5 100%);
    border-radius: 100px;
    box-shadow:
        4px 4px 12px rgba(0, 0, 0, 0.15),
        -2px -2px 8px rgba(255, 255, 255, 0.9),
        inset 0 2px 4px rgba(255, 255, 255, 1),
        inset 0 -2px 4px rgba(0, 0, 0, 0.03);
    z-index: 1;
    pointer-events: none;
    /* Jelly bounce transition */
    transition:
        left 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55),
        transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55),
        border-radius 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Squish effect during transition (left state) */
.glass-toggle-wrap input#mode-plain:checked ~ .glass-toggle .glass-toggle-slider {
    left: 5px;
    animation: jellyLeft 0.5s ease;
}

/* Squish effect during transition (right state) */
.glass-toggle-wrap input#mode-keep:checked ~ .glass-toggle .glass-toggle-slider {
    left: calc(50%);
    animation: jellyRight 0.5s ease;
}

/* Jelly bounce animation - moving right */
@keyframes jellyRight {
    0% {
        transform: scaleX(1) scaleY(1);
    }
    20% {
        transform: scaleX(1.15) scaleY(0.85);
        border-radius: 80px 100px 100px 80px;
    }
    40% {
        transform: scaleX(0.9) scaleY(1.1);
        border-radius: 100px 85px 85px 100px;
    }
    60% {
        transform: scaleX(1.05) scaleY(0.95);
    }
    80% {
        transform: scaleX(0.98) scaleY(1.02);
    }
    100% {
        transform: scaleX(1) scaleY(1);
        border-radius: 100px;
    }
}

/* Jelly bounce animation - moving left */
@keyframes jellyLeft {
    0% {
        transform: scaleX(1) scaleY(1);
    }
    20% {
        transform: scaleX(1.15) scaleY(0.85);
        border-radius: 100px 80px 80px 100px;
    }
    40% {
        transform: scaleX(0.9) scaleY(1.1);
        border-radius: 85px 100px 100px 85px;
    }
    60% {
        transform: scaleX(1.05) scaleY(0.95);
    }
    80% {
        transform: scaleX(0.98) scaleY(1.02);
    }
    100% {
        transform: scaleX(1) scaleY(1);
        border-radius: 100px;
    }
}

/* Active label styling */
.glass-toggle-wrap input#mode-plain:checked ~ .glass-toggle label[for="mode-plain"],
.glass-toggle-wrap input#mode-keep:checked ~ .glass-toggle label[for="mode-keep"] {
    color: #E53131;
    font-weight: 600;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .natural-mode-options {
        padding-bottom: 35px;
    }
    .glass-toggle-option {
        padding: 8px 14px;
        font-size: 0.7rem;
    }
    .glass-toggle {
        padding: 4px;
    }
    .glass-toggle-slider {
        top: 4px;
        left: 4px;
        width: calc(50% - 4px);
        height: calc(100% - 8px);
    }
    .glass-toggle-wrap input#mode-plain:checked ~ .glass-toggle .glass-toggle-slider {
        left: 4px;
    }
    .glass-toggle-wrap input#mode-keep:checked ~ .glass-toggle .glass-toggle-slider {
        left: calc(50%);
    }
}

/* Smart Detection Notice */
.smart-detect-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 12px 0;
    font-size: 0.85rem;
    color: #475569;
    animation: slideIn 0.3s ease-out;
}

.smart-detect-notice.scanning {
    background: linear-gradient(90deg, #f8fafc 0%, #f1f5f9 50%, #f8fafc 100%);
    background-size: 200% 100%;
    animation: scanning 1.5s ease-in-out infinite;
    border-color: #cbd5e1;
}

.smart-detect-notice.success {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border-color: #86efac;
    color: #166534;
}

.smart-detect-notice.warning {
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
    border-color: #fde047;
    color: #854d0e;
}

.smart-detect-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.smart-detect-text {
    flex: 1;
    line-height: 1.4;
}

.smart-detect-text strong {
    font-weight: 600;
}

.smart-detect-detail {
    color: #64748b;
    font-size: 0.8rem;
}

.smart-detect-notice.success .smart-detect-detail {
    color: #166534;
    opacity: 0.85;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scanning {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@media (max-width: 600px) {
    .ai-option-card {
        padding: 12px;
    }
    .ai-option-icon {
        font-size: 1.3rem;
    }
    .ai-option-logo {
        width: 24px;
        height: 24px;
    }
    .ai-option-name {
        font-size: 0.9rem;
    }
    .ai-option-desc {
        font-size: 0.75rem;
    }
}

/* Live Search Bar */
.live-search-bar {
    background: linear-gradient(135deg, #fff 0%, #fafafa 100%);
    border: 2px solid #f0f0f0;
    border-radius: 50px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    flex-wrap: wrap;
    justify-content: center;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #666;
    font-weight: 500;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    50% { opacity: 0.6; box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2); }
}

.live-search-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 280px;
}

.live-search-inputs input {
    flex: 1;
    padding: 8px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 0.85rem;
    background: #fff;
    color: #333;
    min-width: 100px;
    transition: border-color 0.2s;
}

.live-search-inputs input:focus {
    outline: none;
    border-color: #EA5D5D;
}

.live-search-inputs input::placeholder {
    color: #767676;
}

.live-arrow {
    color: #E53131;
    font-weight: bold;
    font-size: 1.1rem;
}

.live-count {
    background: linear-gradient(135deg, #EA5D5D 0%, #E53131 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 50px;
    text-align: center;
}

.live-count.zero {
    background: #e0e0e0;
    color: #888;
}

@media (max-width: 600px) {
    .live-search-bar {
        padding: 10px 14px;
        border-radius: 16px;
    }
    .live-search-inputs {
        min-width: 100%;
    }
    .live-indicator {
        width: 100%;
        justify-content: center;
        margin-bottom: 4px;
    }
}

/* File attachment for large text */
.file-attachment {
    background: linear-gradient(135deg, #f8f9fa 0%, #f0f1f2 100%);
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    display: none;
}

.file-attachment.show {
    display: block;
}

.file-attachment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.file-attachment-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #EA5D5D 0%, #E53131 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
}

.file-attachment-info {
    flex: 1;
}

.file-attachment-name {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.file-attachment-size {
    color: #666;
    font-size: 0.8rem;
}

.file-attachment-remove {
    background: #fff0f0;
    color: #E53131;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.2s;
}

.file-attachment-remove:hover {
    background: #ffe0e0;
}

.file-attachment-note {
    background: #fff;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.85rem;
    color: #666;
    line-height: 1.5;
}

/* Disabled live mode state */
.live-search-bar.disabled {
    opacity: 0.6;
    pointer-events: none;
    background: linear-gradient(135deg, #f5f5f5 0%, #eee 100%);
}

.live-search-bar.disabled .live-dot {
    background: #767676;
    animation: none;
}

.live-disabled-note {
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.85rem;
    color: #E53131;
    text-align: center;
    margin-bottom: 12px;
    display: none;
}

.live-disabled-note.show {
    display: block;
}

/* Duplicates list styles */
.duplicates-list {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dup-item {
    background: #f9f9f9;
    border-radius: 10px;
    padding: 14px;
    border-left: 4px solid #E53131;
}

.dup-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.dup-item-text {
    font-family: monospace;
    font-size: 0.85rem;
    color: #333;
    background: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    word-break: break-word;
    max-height: 60px;
    overflow: hidden;
}

.dup-item-count {
    background: #E53131;
    color: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.dup-item-lines {
    font-size: 0.8rem;
    color: #666;
    margin-top: 8px;
}

.dup-line-badge {
    display: inline-block;
    background: #fff5f5;
    color: #E53131;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    margin: 2px;
    font-weight: 500;
}

.dup-line-badge.kept {
    background: #f0fdf4;
    color: #22c55e;
}

.dup-line-badge.removed {
    background: #fff5f5;
    color: #E53131;
    text-decoration: line-through;
}

.dup-summary {
    background: linear-gradient(135deg, #fff5f5 0%, #fef2f2 100%);
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 16px;
    text-align: center;
}

.dup-summary-stat {
    display: inline-block;
    margin: 0 12px;
}

.dup-summary-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #E53131;
}

.dup-summary-label {
    font-size: 0.75rem;
    color: #666;
    display: block;
}

/* Fresh start overlay */
.fresh-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.fresh-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.fresh-icon {
    font-size: 4rem;
    animation: freshBounce 0.6s ease;
}

.fresh-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: #22c55e;
    margin-top: 16px;
    animation: freshFadeIn 0.4s ease 0.2s both;
}

.fresh-subtext {
    font-size: 1rem;
    color: #666;
    margin-top: 8px;
    animation: freshFadeIn 0.4s ease 0.3s both;
}

@keyframes freshBounce {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes freshFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Textarea fresh state placeholder enhancement */
textarea.fresh-state {
    animation: freshPulse 0.5s ease;
}

@keyframes freshPulse {
    0% { border-color: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    50% { border-color: #22c55e; box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { border-color: #e0e0e0; box-shadow: none; }
}

/* Footer styles - sneaky reveal */
.footer {
    margin-top: 40px;
    text-align: center;
}

.footer-teaser {
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
    user-select: none;
}

.footer-teaser:hover {
    background: linear-gradient(135deg, #fff5f5 0%, #fef2f2 100%);
}

.footer-teaser-text {
    font-size: 0.95rem;
    color: #666;
}

.footer-teaser-text span {
    color: #E53131;
    font-weight: 600;
}

.footer-laugh {
    display: inline-block;
    color: #E53131;
    font-weight: 700;
    cursor: pointer;
    animation: giggle 2s ease-in-out infinite;
    position: relative;
}

.footer-laugh::after {
    content: '👆';
    position: absolute;
    font-size: 0.7rem;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
}

.footer-teaser:hover .footer-laugh::after {
    opacity: 1;
    animation: bounce 0.5s ease infinite;
}

@keyframes giggle {
    0%, 100% { transform: rotate(0deg); }
    10% { transform: rotate(-3deg) scale(1.05); }
    20% { transform: rotate(3deg) scale(1.05); }
    30% { transform: rotate(-3deg) scale(1.05); }
    40% { transform: rotate(3deg) scale(1.05); }
    50% { transform: rotate(0deg) scale(1); }
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-5px); }
}

/* Hidden content that reveals */
.footer-hidden {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, padding 0.5s ease;
    background: linear-gradient(135deg, #fff5f5 0%, #fef2f2 100%);
    border-top: 2px solid #fecaca;
}

.footer-hidden.show {
    max-height: 800px;
    padding: 30px 20px;
}

.footer-reveal-text {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 20px;
    line-height: 1.6;
}

.footer-reveal-text .evil {
    color: #E53131;
    font-weight: 700;
}

.footer-reveal-text .knife {
    display: inline-block;
    animation: stab 1s ease-in-out infinite;
}

@keyframes stab {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    25% { transform: translateX(3px) rotate(10deg); }
    75% { transform: translateX(-3px) rotate(-10deg); }
}

.footer-share {
    margin: 24px 0;
}

.footer-share-title {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 16px;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    text-decoration: none;
    color: white;
    transition: all 0.3s;
    font-size: 1.3rem;
}

.share-btn:hover {
    transform: translateY(-4px) scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.share-btn.whatsapp { background: #25D366; }
.share-btn.telegram { background: #0088cc; }
.share-btn.discord { background: #5865F2; }
.share-btn.twitter { background: #000000; }
.share-btn.facebook { background: #1877F2; }

/* SVG icons inside buttons */
.share-btn svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.footer-brand {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid #fecaca;
}

.footer-brand a {
    display: inline-block;
    padding: 14px 32px;
    background: linear-gradient(135deg, #EA5D5D 0%, #E53131 100%);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s;
    font-size: 1rem;
}

.footer-brand a:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(229,49,49,0.35);
}

.footer-tagline {
    font-size: 0.9rem;
    color: #666;
    margin-top: 14px;
}

.footer-about {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #fecaca;
}

.footer-about-toggle {
    background: none;
    border: none;
    color: #E53131;
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 600;
    padding: 8px 16px;
    transition: all 0.2s;
}

.footer-about-toggle:hover {
    background: rgba(229,49,49,0.1);
    border-radius: 20px;
}

.footer-about-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    text-align: left;
    max-width: 500px;
    margin: 0 auto;
}

.footer-about-content.show {
    max-height: 500px;
    padding-top: 16px;
}

.footer-about-content p {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 10px;
    line-height: 1.5;
}

.footer-about-content strong {
    color: #E53131;
}

.footer-close {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px dashed #fecaca;
}

.footer-close-btn {
    background: none;
    border: 2px solid #E53131;
    color: #E53131;
    padding: 10px 24px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.footer-close-btn:hover {
    background: #E53131;
    color: white;
}

/* Format Picker Styles */
.format-picker {
    margin: 20px 0;
}

.format-picker-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 12px;
    text-align: center;
}

.format-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 600px) {
    .format-options {
        grid-template-columns: 1fr;
    }
}

.format-option {
    cursor: pointer;
}

.format-option input {
    display: none;
}

.format-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    background: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    transition: all 0.2s;
    text-align: center;
}

.format-option input:checked + .format-card {
    border-color: #E53131;
    background: linear-gradient(135deg, #fff5f5 0%, #fef2f2 100%);
    box-shadow: 0 4px 15px rgba(229,49,49,0.15);
}

.format-card:hover {
    border-color: #EA5D5D;
    transform: translateY(-2px);
}

.format-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.format-name {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.format-desc {
    font-size: 0.75rem;
    color: #666;
}

.format-option input:checked + .format-card .format-name {
    color: #E53131;
}

/* Disabled format options */
.format-disabled {
    pointer-events: none;
    opacity: 0.6;
}

.format-disabled .format-card {
    background: #f0f0f0;
    border-style: dashed;
    border-color: #ccc;
}

.format-disabled .format-card:hover {
    transform: none;
    border-color: #ccc;
}

.format-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 3px 8px;
    background: linear-gradient(135deg, #ffd700 0%, #ffb700 100%);
    color: #333;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 10px;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

/* Convert button - centered and prominent */
.convert-action {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

.convert-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 40px;
    background: linear-gradient(135deg, #E53131 0%, #c92a2a 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(229,49,49,0.3);
}

.convert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229,49,49,0.4);
}

.convert-btn:active {
    transform: translateY(0);
}

.convert-btn-icon {
    font-size: 1.3rem;
}

/* ============================================
   DIFF VIEW v2.0 - Cute, Grouped, Click-to-Jump
   ============================================ */

.diff-toggle-container {
    display: none;
    margin-top: 12px;
    text-align: center;
}

.diff-toggle-container.show {
    display: block;
}

.diff-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    transition: all 0.2s;
}

.diff-toggle-btn:hover {
    border-color: #E53131;
    color: #E53131;
}

.diff-toggle-btn.active {
    background: linear-gradient(135deg, #EA5D5D 0%, #E53131 100%);
    border-color: #E53131;
    color: white;
}

.diff-toggle-btn .toggle-icon {
    transition: transform 0.2s;
}

.diff-toggle-btn.active .toggle-icon {
    transform: rotate(180deg);
}

.diff-panel {
    display: none;
    margin-top: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    background: #fafafa;
}

.diff-panel.show {
    display: block;
    animation: diffSlideIn 0.25s ease-out;
}

@keyframes diffSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tiny Receipt Summary Bar */
.diff-receipt {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.8rem;
}

.receipt-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: white;
    border-radius: 20px;
    font-weight: 500;
    color: #64748b;
    border: 1px solid #e2e8f0;
    transition: transform 0.15s ease;
}

.receipt-item:hover {
    transform: scale(1.02);
}

.receipt-total {
    color: #22c55e;
    border-color: #bbf7d0;
    font-weight: 600;
}

.receipt-removed { color: #ef4444; border-color: #fecaca; }
.receipt-converted { color: #3b82f6; border-color: #bfdbfe; }
.receipt-fixed { color: #22c55e; border-color: #bbf7d0; }
.receipt-time { color: #94a3b8; border-color: #e2e8f0; font-size: 0.75rem; }
.receipt-note { color: #f59e0b; border-color: #fde68a; font-style: italic; }

/* Snarky Note */
.diff-sarcastic-note {
    padding: 10px 16px;
    background: linear-gradient(135deg, #fff5f5 0%, #fff 100%);
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
    text-align: center;
}

.diff-sarcastic-note .roast {
    color: #E53131;
    font-weight: 600;
    font-style: normal;
}

/* Filter Pills */
.diff-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 14px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    justify-content: center;
}

.diff-filter-pill {
    padding: 5px 12px;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    background: white;
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s ease;
}

.diff-filter-pill:hover {
    border-color: #E53131;
    color: #E53131;
}

.diff-filter-pill.active {
    background: linear-gradient(135deg, #EA5D5D 0%, #E53131 100%);
    border-color: #E53131;
    color: white;
}

/* Main Content Area */
.diff-content {
    padding: 12px;
    max-height: 350px;
    overflow-y: auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.85rem;
    line-height: 1.5;
}

.diff-empty {
    text-align: center;
    padding: 24px;
    color: #9ca3af;
    font-style: italic;
}

/* Grouped Change Cards */
.diff-group {
    margin-bottom: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    background: white;
    transition: box-shadow 0.15s ease;
}

.diff-group:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.diff-group[data-type="removed"] { border-left: 3px solid #ef4444; }
.diff-group[data-type="converted"] { border-left: 3px solid #3b82f6; }
.diff-group[data-type="fixed"] { border-left: 3px solid #22c55e; }

.diff-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.8rem;
}

.diff-group-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.diff-group-desc {
    flex: 1;
    font-weight: 500;
    color: #374151;
}

.diff-group-count {
    padding: 2px 8px;
    background: linear-gradient(135deg, #EA5D5D 0%, #E53131 100%);
    color: white;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Examples */
.diff-group-examples {
    padding: 8px;
}

.diff-example {
    padding: 8px 10px;
    margin-bottom: 6px;
    border-radius: 8px;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.diff-example:last-child {
    margin-bottom: 0;
}

.diff-example:hover {
    background: #fff7ed;
    border-color: #fed7aa;
}

.diff-example:active {
    transform: scale(0.99);
}

.diff-before, .diff-after {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.78rem;
    line-height: 1.4;
    padding: 2px 0;
}

.diff-label {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.7rem;
}

.diff-before .diff-label {
    background: #fee2e2;
    color: #dc2626;
}

.diff-after .diff-label {
    background: #dcfce7;
    color: #16a34a;
}

.diff-text {
    flex: 1;
    word-break: break-word;
    color: #374151;
}

.diff-before .diff-text {
    text-decoration: line-through;
    color: #9ca3af;
}

.diff-note {
    font-size: 0.75rem;
    color: #9ca3af;
    font-style: italic;
    padding: 4px 0;
}

.diff-more-note {
    font-size: 0.75rem;
    color: #9ca3af;
    padding: 6px 10px;
    text-align: center;
    background: #f1f5f9;
    border-radius: 6px;
    margin-top: 4px;
}

/* Load More Button */
.diff-load-more {
    padding: 10px 14px;
    text-align: center;
    border-top: 1px solid #e5e7eb;
}

.diff-load-btn {
    padding: 8px 20px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s ease;
}

.diff-load-btn:hover {
    border-color: #E53131;
    color: #E53131;
}

/* Flash highlight effect when jumping to change */
textarea.diff-flash {
    animation: diffFlash 0.7s ease;
}

@keyframes diffFlash {
    0%, 100% { box-shadow: inset 0 0 0 0 rgba(251, 191, 36, 0); }
    30% { box-shadow: inset 0 0 20px 5px rgba(251, 191, 36, 0.4); }
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    .diff-receipt {
        gap: 6px;
        padding: 8px 10px;
    }
    .receipt-item {
        padding: 2px 8px;
        font-size: 0.7rem;
    }
    .diff-filters {
        gap: 4px;
        padding: 8px 10px;
    }
    .diff-filter-pill {
        padding: 4px 10px;
        font-size: 0.7rem;
    }
    .diff-content {
        padding: 10px;
        max-height: 280px;
    }
    .diff-group-header {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
    .diff-example {
        padding: 6px 8px;
    }
    .diff-before, .diff-after {
        font-size: 0.72rem;
    }
    .diff-toggle-btn {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
}

/* ============================================
   E2E ENCRYPTION BADGE & MODAL STYLES
   ============================================ */

/* Encryption Badge in Header */
.encryption-badge-container {
    display: flex;
    justify-content: center;
    margin-top: 12px;
}

/* ============================================
   CREEPY EYE ENCRYPTION BUTTON
   Adapted from CodePen by Jon Kantner
   Theme: Soft Pink/Peach
   ============================================ */
.creepy-btn {
    --creepy-primary: #ffb8b8;
    --creepy-primary-hover: #ffcccc;
    --creepy-black: #2a2a2a;
    --creepy-white: #ffffff;
    --creepy-text: #4b4b4b;
    --creepy-text-light: #3d3d3d;

    background-color: var(--creepy-black);
    border-radius: 2em;
    border: none;
    color: var(--creepy-white);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    min-width: 14em;
    outline: 3px solid transparent;
    padding: 0;
    position: relative;
    transition: outline 0.1s linear;
    -webkit-tap-highlight-color: transparent;
}

.creepy-btn__cover,
.creepy-btn__eye {
    position: relative;
}

.creepy-btn__cover,
.creepy-btn__pupil {
    border-radius: inherit;
    display: block;
}

.creepy-btn__cover {
    background: linear-gradient(135deg, var(--creepy-primary) 0%, var(--creepy-primary-hover) 100%);
    box-shadow: 0 0 0 2px var(--creepy-black) inset;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    transform-origin: 2em 50%;
    transition: background-color 0.3s, transform 0.3s cubic-bezier(0.65, 0, 0.35, 1);
}

.creepy-btn__eye {
    animation: creepy-eye-blink 3s infinite;
    background-color: var(--creepy-white);
    border-radius: 50%;
    overflow: hidden;
    width: 0.9em;
    height: 0.9em;
}

.creepy-btn__eyes {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 0.4em;
    right: 1.2em;
    bottom: 0.55em;
    height: 0.9em;
}

.creepy-btn__pupil {
    background-color: var(--creepy-black);
    position: absolute;
    aspect-ratio: 1;
    top: 50%;
    left: 50%;
    width: 0.45em;
    height: 0.45em;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: transform 0.1s ease-out;
}

.creepy-btn:focus-visible {
    outline: 3px solid #ffd0d0;
}

.creepy-btn:hover .creepy-btn__cover {
    background: linear-gradient(135deg, #ffc8c8 0%, #ffe0e0 100%);
}

.creepy-btn:focus-visible .creepy-btn__cover,
.creepy-btn:hover .creepy-btn__cover {
    transform: rotate(-10deg);
    transition-timing-function: cubic-bezier(0.65, 0, 0.35, 1.65);
}

.creepy-btn:active .creepy-btn__cover {
    transform: rotate(0);
    transition-timing-function: cubic-bezier(0.65, 0, 0.35, 1);
}

@keyframes creepy-eye-blink {
    0%, 92%, 100% {
        animation-timing-function: cubic-bezier(0.32, 0, 0.67, 0);
        transform: scaleY(1);
    }
    96% {
        animation-timing-function: cubic-bezier(0.33, 1, 0.68, 1);
        transform: scaleY(0.1);
    }
}

/* Encryption badge text inside creepy button */
.creepy-btn .encryption-icon {
    font-size: 1.1rem;
}

.creepy-btn .encryption-text {
    font-weight: 600;
    color: var(--creepy-text);
}

.creepy-btn .encryption-info {
    font-size: 0.85rem;
    color: var(--creepy-text-light);
    transition: opacity 0.2s;
}

.creepy-btn:hover .encryption-info {
    opacity: 1;
}

/* Legacy support - keep old class working */
.encryption-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 2px solid #4caf50;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    color: #2e7d32;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
}

.encryption-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    background: linear-gradient(135deg, #c8e6c9 0%, #a5d6a7 100%);
}

.encryption-badge.active {
    animation: encryptionPulse 2s ease-in-out infinite;
}

@keyframes encryptionPulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2); }
    50% { box-shadow: 0 2px 15px rgba(76, 175, 80, 0.4); }
}

.encryption-icon {
    font-size: 1rem;
}

.encryption-text {
    font-weight: 600;
}

.encryption-info {
    font-size: 0.9rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.encryption-badge:hover .encryption-info {
    opacity: 1;
}

/* Encryption Demo Modal */
.encryption-modal-content {
    max-width: 600px;
    max-height: 85vh;
    max-height: 85dvh; /* Use dynamic viewport height for mobile */
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    scrollbar-width: none; /* Firefox - hide scrollbar */
    -ms-overflow-style: none; /* IE/Edge - hide scrollbar */
    width: calc(100% - 20px);
    margin: 10px;
}

/* Hide scrollbar for Chrome/Safari/Opera */
.encryption-modal-content::-webkit-scrollbar {
    display: none;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 1.2rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    z-index: 1010;
    font-weight: 400;
    line-height: 1;
    backdrop-filter: blur(4px);
    background: rgba(0, 0, 0, 0.2);
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
}

.modal-close:active {
    transform: scale(0.92);
}

@media (max-width: 650px) {
    .modal-close {
        top: 10px;
        right: 10px;
    }
}

.encryption-demo-header {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    padding: 30px 24px;
    text-align: center;
}

.encryption-demo-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    animation: lockBounce 2s ease-in-out infinite;
}

@keyframes lockBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.encryption-demo-header h2 {
    color: white;
    margin-bottom: 8px;
    font-size: 1.5rem;
}

.encryption-demo-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    margin: 0;
}

/* Info Cards */
.encryption-info-cards {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #fafafa;
}

.encryption-info-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s;
}

.encryption-info-card:hover {
    border-color: #22c55e;
    box-shadow: 0 2px 10px rgba(34, 197, 94, 0.1);
}

.info-card-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.info-card-content h3,
.info-card-content h4,
.info-card-title {
    color: #333;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.info-card-content p {
    color: #666;
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.4;
}

/* Demo Section */
.encryption-demo-section {
    padding: 24px;
    border-top: 1px solid #e0e0e0;
}

.encryption-demo-section h3 {
    color: #333;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.demo-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.demo-step {
    margin-bottom: 16px;
}

.demo-step-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
}

.step-number {
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #EA5D5D 0%, #E53131 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.demo-textarea {
    width: 100%;
    min-height: 60px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.85rem;
    font-family: 'Monaco', 'Menlo', monospace;
    resize: none;
    transition: border-color 0.2s;
}

.demo-textarea:focus {
    outline: none;
    border-color: #22c55e;
}

.demo-textarea.encrypted-output {
    background: #f5f5f5;
    color: #888;
    font-size: 0.75rem;
    word-break: break-all;
}

.demo-status {
    text-align: center;
    padding: 10px;
    font-size: 0.85rem;
    color: #595959;
    font-weight: 500;
}

.demo-run-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    margin-top: 8px;
}

/* Encryption Footer Note */
.encryption-footer-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 16px 24px;
    background: linear-gradient(135deg, #fff5f5 0%, #fef2f2 100%);
    border-top: 1px solid #fecaca;
    font-size: 0.85rem;
    color: #666;
    line-height: 1.5;
}

.note-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* Responsive adjustments for encryption UI */
@media (max-width: 600px) {
    .creepy-btn {
        font-size: 0.75rem;
        min-width: 12em;
    }

    .creepy-btn__cover {
        padding: 8px 16px;
    }

    .creepy-btn__eyes {
        right: 0.8em;
        bottom: 0.4em;
    }

    .creepy-btn__eye {
        width: 0.7em;
        height: 0.7em;
    }

    .creepy-btn__pupil {
        width: 0.35em;
        height: 0.35em;
    }

    .encryption-badge {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .modal {
        padding: 10px;
        align-items: flex-start;
        padding-top: 5vh;
        padding-top: 5dvh;
    }

    .encryption-modal-content {
        max-height: 80vh;
        max-height: 80dvh;
        margin: 0;
        width: 100%;
        border-radius: 12px;
    }

    .modal-close {
        top: 8px;
        right: 8px;
        width: 32px;
        height: 32px;
        font-size: 1.3rem;
    }

    .encryption-demo-header {
        padding: 20px 16px;
        padding-top: 40px; /* Space for close button */
    }

    .encryption-demo-icon {
        font-size: 2rem;
    }

    .encryption-demo-header h2 {
        font-size: 1.2rem;
    }

    .encryption-demo-subtitle {
        font-size: 0.85rem;
    }

    .encryption-info-cards {
        padding: 12px;
        gap: 8px;
    }

    .encryption-info-card {
        padding: 10px;
        gap: 10px;
    }

    .info-card-icon {
        font-size: 1.2rem;
    }

    .info-card-content h3,
    .info-card-content h4,
    .info-card-title {
        font-size: 0.85rem;
    }

    .info-card-content p {
        font-size: 0.8rem;
    }

    .encryption-demo-section {
        padding: 16px;
    }

    .encryption-demo-section h3 {
        font-size: 1rem;
    }

    .demo-description {
        font-size: 0.85rem;
    }

    .demo-step {
        margin-bottom: 12px;
    }

    .demo-textarea {
        min-height: 45px;
        font-size: 0.8rem;
        padding: 10px;
    }

    .demo-textarea.encrypted-output {
        font-size: 0.7rem;
    }

    .encryption-footer-note {
        padding: 12px 16px;
        font-size: 0.8rem;
    }
}

/* Very small screens */
@media (max-width: 400px) {
    .modal {
        padding: 5px;
        padding-top: 3vh;
        padding-top: 3dvh;
    }

    .encryption-modal-content {
        max-height: 85vh;
        max-height: 85dvh;
        margin: 0;
        border-radius: 10px;
    }

    .modal-close {
        top: 6px;
        right: 6px;
        width: 30px;
        height: 30px;
    }

    .encryption-demo-header {
        padding: 16px 12px;
        padding-top: 36px;
    }

    .encryption-demo-icon {
        font-size: 1.8rem;
        margin-bottom: 8px;
    }

    .encryption-demo-header h2 {
        font-size: 1.1rem;
    }

    .encryption-info-cards {
        padding: 10px;
    }

    .encryption-info-card {
        padding: 8px;
    }

    .info-card-icon {
        font-size: 1rem;
    }

    .encryption-demo-section {
        padding: 12px;
    }

    .demo-textarea {
        min-height: 40px;
        padding: 8px;
    }
}

/* ============================================
   UPGRADE BADGES v5.0 - Professional Style
   "Upgraded ⚡ X ago" format
   ============================================ */

/* Position fix for ai-option-card */
.ai-option-card {
    position: relative;
}

/* Card Badge - Full "Upgraded ⚡ X ago" */
.upgrade-badge {
    position: absolute;
    bottom: 8px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 500;
    z-index: 10;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.upgrade-badge:hover {
    transform: translateY(-1px);
}

.upgrade-badge-label {
    opacity: 0.85;
}

.upgrade-badge-bolt {
    font-size: 0.8rem;
    filter: saturate(1.2);
}

.upgrade-badge-time {
    font-weight: 600;
}

/* Hot (< 1 hour) - Vibrant orange/gold */
.upgrade-badge-hot {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, rgba(245, 158, 11, 0.2) 100%);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #b45309;
}
.upgrade-badge-hot .upgrade-badge-bolt {
    animation: bolt-pulse 1s ease-in-out infinite;
}

/* Recent (< 6 hours) - Fresh green */
.upgrade-badge-recent {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(22, 163, 74, 0.15) 100%);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: #15803d;
}
.upgrade-badge-recent .upgrade-badge-bolt {
    animation: bolt-pulse 2s ease-in-out infinite;
}

/* Today (< 24 hours) - Cool blue */
.upgrade-badge-today {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(37, 99, 235, 0.12) 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #1d4ed8;
}

/* This week - Subtle gray */
.upgrade-badge-week {
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: #64748b;
}

/* Older - Very subtle */
.upgrade-badge-old {
    background: rgba(203, 213, 225, 0.08);
    border: 1px solid rgba(203, 213, 225, 0.15);
    color: #94a3b8;
}
.upgrade-badge-old .upgrade-badge-bolt {
    opacity: 0.5;
}

/* Error state - version mismatch */
.upgrade-badge-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #ef4444;
    animation: error-pulse 2s infinite;
}
@keyframes error-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Bolt animation */
@keyframes bolt-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.15);
    }
}

/* ============================================
   TAB BADGES - Compact "⚡ Xh" format
   ============================================ */

.tab {
    position: relative;
}

.tab-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 600;
    vertical-align: middle;
    transition: all 0.2s ease;
}

.tab-badge-bolt {
    font-size: 0.7rem;
}

.tab-badge-time {
    letter-spacing: -0.02em;
}

/* Hot (< 1 hour) */
.tab-badge-hot {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2) 0%, rgba(245, 158, 11, 0.25) 100%);
    color: #b45309;
}
.tab-badge-hot .tab-badge-bolt {
    animation: bolt-pulse 1s ease-in-out infinite;
}

/* Recent (< 6 hours) */
.tab-badge-recent {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12) 0%, rgba(22, 163, 74, 0.18) 100%);
    color: #15803d;
}
.tab-badge-recent .tab-badge-bolt {
    animation: bolt-pulse 2s ease-in-out infinite;
}

/* Today (< 24 hours) */
.tab-badge-today {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
}

/* This week */
.tab-badge-week {
    background: rgba(148, 163, 184, 0.12);
    color: #64748b;
}

/* Older */
.tab-badge-old {
    background: rgba(203, 213, 225, 0.1);
    color: #94a3b8;
}
.tab-badge-old .tab-badge-bolt {
    opacity: 0.4;
}

/* Active tab - light colors */
.tab.active .tab-badge {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.95);
}
.tab.active .tab-badge-bolt {
    filter: brightness(1.2);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .upgrade-badge {
        font-size: 0.65rem;
        padding: 3px 8px;
        bottom: 6px;
        right: 8px;
    }
    .upgrade-badge-label {
        display: none;
    }
}

/* Prevent overlap with glass toggle on Natural option */
@media (max-width: 480px) {
    #ai-natural + .ai-option-card .upgrade-badge {
        bottom: auto;
        top: 8px;
    }
}

@media (max-width: 600px) {
    .tab-badge {
        font-size: 0.6rem;
        padding: 1px 5px;
        margin-left: 4px;
    }
}

@media (max-width: 400px) {
    .tab-badge {
        display: none;
    }
}

/* ========== PRINT STYLES ========== */
@media print {
    /* Hide non-essential elements */
    .tabs,
    .footer,
    .live-viewers,
    .encryption-badge-container,
    .btn-group,
    .file-upload,
    .file-attachment,
    .toast,
    .fresh-start-overlay,
    .modal,
    .diff-toggle-container,
    .diff-panel,
    .smart-detect-notice,
    .clean-btn-wrap,
    .stats,
    .live-stats,
    .help-text,
    .skip-link,
    .options,
    .ai-cleanup-options,
    .convert-formats,
    .convert-action,
    .duplicates-options {
        display: none !important;
    }

    /* Reset backgrounds and shadows */
    body {
        background: white;
        color: black;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    .panel {
        box-shadow: none;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }

    /* Show textareas as clean text */
    textarea {
        border: 1px solid #ccc;
        min-height: auto !important;
        height: auto !important;
        overflow: visible;
        resize: none;
    }

    /* Section titles */
    .section-title {
        color: black;
        font-size: 14pt;
    }

    /* Page header for print */
    header {
        border-bottom: 2px solid #E53131;
        padding-bottom: 10px;
        margin-bottom: 20px;
    }

    h1 {
        font-size: 18pt;
        color: black;
    }

    .subtitle {
        display: none;
    }

    /* Add URL after links */
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 80%;
        color: #666;
    }

    /* Remove animations */
    * {
        animation: none !important;
        transition: none !important;
    }
}
