/*
 * patch.css — Styles for Dans Annotator Patch overlay systems.
 *
 * Covers two modes:
 *   1. Logged-in / collaborator: overlay badges in #annotate-patch-overlay
 *   2. Public preview:           overlay pins in #ann-preview-overlay
 *
 * IMPORTANT: Do NOT add top/left/right with !important — those properties are
 * controlled by JavaScript via inline styles (rAF loop). CSS !important would
 * silently override them and break positioning.
 */

/* ════════════════════════════════════════════════════════════════════════════
   1. LOGGED-IN OVERLAY BADGES  (#annotate-patch-overlay)
   ════════════════════════════════════════════════════════════════════════════ */

#annotate-patch-overlay .annotate-badge {
    position: fixed !important;  /* must be fixed, not absolute */
    transform: none !important;  /* cancel translate(-50%,-50%) from annotate.css */
}

#annotate-patch-overlay .annotate-badge:hover {
    transform: scale(1.08) !important;
}

/* ════════════════════════════════════════════════════════════════════════════
   2. PUBLIC PREVIEW PINS  (#ann-preview-overlay)
   ════════════════════════════════════════════════════════════════════════════ */

#ann-preview-overlay {
    pointer-events: none;
}

/* ── Pin (red circle with number) ──────────────────────────────────────────── */

.ann-pin {
    position: fixed !important;
    width: 26px;
    height: 26px;
    background: #ff4757;
    color: #fff;
    border-radius: 50%;
    border: 2px solid #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    font-family: sans-serif;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    transform: translate(-50%, -50%);
    pointer-events: auto;
    transition: opacity 0.15s ease, transform 0.1s ease;
}

.ann-pin:hover {
    transform: translate(-50%, -50%) scale(1.15);
}

/* ── Highlight outline on hovered element ────────────────────────────────── */

.ann-highlight {
    outline: 3px dashed #ff4757 !important;
    outline-offset: 2px !important;
}

/* ── Popover ──────────────────────────────────────────────────────────────── */

.ann-preview-pop {
    position: fixed;
    width: 310px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 2147483647;
    border: 1px solid #ddd;
    font-family: sans-serif;
}

.ann-preview-pop-header {
    padding: 12px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    cursor: move;
    font-weight: bold;
    font-size: 13px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #333;
    user-select: none;
}

.ann-preview-pop-close {
    cursor: pointer;
    font-size: 14px;
    color: #888;
    line-height: 1;
    padding: 2px 4px;
}

.ann-preview-pop-close:hover {
    color: #333;
}

.ann-preview-pop-body {
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
    color: #333;
}

.ann-preview-comment {
    margin-bottom: 12px;
    border-bottom: 1px solid #f1f2f6;
    padding-bottom: 8px;
}

.ann-preview-comment:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.ann-preview-author {
    font-size: 10px;
    font-weight: bold;
    color: #747d8c;
    text-transform: uppercase;
    display: block;
    margin-bottom: 4px;
}

.ann-preview-text {
    font-size: 13px;
    color: #2f3542;
    line-height: 1.4;
}

.ann-preview-text p {
    margin: 0 0 6px;
}

.ann-preview-text p:last-child {
    margin-bottom: 0;
}

.ann-preview-close-btn {
    display: block;
    width: 100%;
    border: 0;
    background: #eee;
    padding: 10px;
    cursor: pointer;
    border-radius: 0 0 12px 12px;
    font-weight: bold;
    font-size: 13px;
    color: #555;
}

.ann-preview-close-btn:hover {
    background: #e0e0e0;
}
