/* ═══════════════════════════════════════════════════════════════
   PDF Viewer — Extracted Component Styles
   Source: Track 1.2 CSS cleanup (formerly inline style.cssText)
   ═══════════════════════════════════════════════════════════════ */

/* ── Selection Tooltip ── */
.pdf-selection-tooltip {
    position: fixed;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(8px);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(0,0,0,0.5);
    display: none;
    z-index: 10000;
    pointer-events: auto;
    gap: 3px;
}

.tooltip-btn {
    border: none;
    padding: 6px 10px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    color: white;
    white-space: nowrap;
}
.tooltip-btn-ask       { background: #6366f1; }
.tooltip-btn-highlight { background: rgba(234, 179, 8, 0.8); color: #1e1e1e; }
.tooltip-btn-note      { background: rgba(34, 197, 94, 0.8); }

/* ── Context Menu ── */
#pdf-context-menu {
    position: fixed;
    display: none;
    z-index: 10001;
    background: rgba(30, 41, 59, 0.97);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 4px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    min-width: 180px;
    font-family: system-ui, sans-serif;
}
.pdf-ctx-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    border: none;
    background: transparent;
    color: #e2e8f0;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s;
    text-align: left;
    white-space: nowrap;
}
.pdf-ctx-btn:hover { background: rgba(99,102,241,0.25); }

/* ── Draw Mode Static Layer ── */
.draw-static-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4;
    pointer-events: none;
}

/* ── Copybook Toolbar ── */
#copybook-toolbar {
    z-index: 20;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* ── Vision Select Overlay ── */
.vision-select-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    cursor: crosshair;
}

/* ── Vision Popup Overlay ── */
#vision-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.vision-popup {
    background: #1e293b;
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.vision-popup h3 {
    margin: 0 0 1rem;
    color: #e2e8f0;
    font-size: 1.1rem;
}
.vision-popup-preview {
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
    max-height: 200px;
    display: flex;
    justify-content: center;
    background: #0f172a;
}
.vision-popup-preview img {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
}
.vision-popup-meta {
    color: #94a3b8;
    font-size: 0.8rem;
    margin: 0 0 0.75rem;
}
#vision-question-input {
    width: 100%;
    min-height: 80px;
    background: #0f172a;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #e2e8f0;
    padding: 0.75rem;
    font-size: 0.9rem;
    resize: vertical;
    box-sizing: border-box;
    font-family: inherit;
}
.vision-popup-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    justify-content: flex-end;
}
#vision-cancel-btn {
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.85rem;
}
#vision-ask-btn {
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #06b6d4, #6366f1);
    color: white;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
}

/* ── Note Editor — Text Box (floating on canvas) ── */
.note-text-box {
    position: absolute;
    z-index: 10;
    cursor: move;
}
.note-text-box-content {
    font-family: sans-serif;
    outline: none;
    min-width: 40px;
    display: inline-block;
    padding: 1px 4px;
    background: transparent;
    white-space: pre;
    cursor: text;
    border: 1px dashed transparent;
}
.note-text-box-delete {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #f87171;
    color: #fff;
    border: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 10px;
    cursor: pointer;
    display: none;
    line-height: 1;
    padding: 0;
}
.note-text-box:hover .note-text-box-delete { display: block; }

/* ── Note Editor — Image Preview (drag-to-place) ── */
.note-image-preview {
    border: 2px dashed #60a5fa;
    cursor: move;
    z-index: 10;
    box-sizing: border-box;
    position: absolute;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}
.note-image-resize-handle {
    position: absolute;
    right: -5px;
    bottom: -5px;
    width: 12px;
    height: 12px;
    background: #60a5fa;
    border-radius: 2px;
    cursor: nwse-resize;
}
.note-image-place-btn {
    position: absolute;
    top: -28px;
    right: 0;
    background: #22c55e;
    color: #fff;
    border: none;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

/* ── Gallery — Backdrop & Modal ── */
.notes-gallery-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10002;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
}
.notes-gallery-modal {
    background: rgba(30, 41, 59, 0.98);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    width: 90vw;
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,0.6);
    font-family: system-ui, sans-serif;
}

/* Gallery header */
.gallery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.gallery-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}
.gallery-header-icon { font-size: 22px; }
.gallery-header-text { color: #e2e8f0; font-size: 16px; font-weight: 600; }
.gallery-close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}
.gallery-close-btn:hover { background: rgba(255,255,255,0.06); }

/* Gallery loading & empty */
.gallery-loading {
    padding: 40px;
    text-align: center;
    color: #94a3b8;
}
.gallery-loading-icon { font-size: 28px; margin-bottom: 8px; }
.gallery-grid {
    display: none;
    overflow-y: auto;
    padding: 16px;
    gap: 12px;
    flex: 1;
}
.gallery-empty {
    display: none;
    padding: 60px 20px;
    text-align: center;
    color: #64748b;
}
.gallery-empty-icon { font-size: 48px; margin-bottom: 12px; }
.gallery-empty-title { font-size: 15px; font-weight: 500; }
.gallery-empty-hint { font-size: 13px; margin-top: 6px; }

/* Gallery card */
.gallery-card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}
.gallery-card:hover {
    border-color: rgba(99,102,241,0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99,102,241,0.15);
}

/* Gallery thumbnail area */
.gallery-thumb-wrap {
    position: relative;
    width: 100%;
    height: 160px;
    background: #0f172a;
    overflow: hidden;
}
.gallery-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    font-size: 13px;
}
.gallery-thumb-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: rgba(15,23,42,0.5);
}
.gallery-thumb-canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.gallery-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #1e293b;
}

/* Gallery info area */
.gallery-card-info { padding: 10px 12px; }

/* Gallery footer */
.gallery-footer {
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}
.gallery-export-btn {
    padding: 10px 20px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.gallery-export-btn--hardcopy {
    background: rgba(99,102,241,0.15);
    color: #a5b4fc;
}
.gallery-export-btn--hardcopy:hover { background: rgba(99,102,241,0.3); }
.gallery-export-btn--copybook {
    background: rgba(34,197,94,0.12);
    color: #86efac;
}
.gallery-export-btn--copybook:hover { background: rgba(34,197,94,0.25); }

/* ── Vision Toast ── */
.vision-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    font-size: 0.85rem;
    z-index: 10001;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    transition: opacity 0.3s;
}
