/* ============================================================
   FLOATING TOOLS - Marca Texto, Bloco de Notas, Lupa
   Arquivo: assets/css/components/floating-tools.css
   ============================================================ */

/* ---------- Container dos botões flutuantes ---------- */
.bc-floating-tools {
    position: fixed;
    left: 20px;
    right: auto;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
}

/* ---------- Botão base ---------- */
.bc-tool-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    outline: none;
}
.bc-tool-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.22);
}
.bc-tool-btn:active { transform: scale(0.96); }
.bc-tool-btn.active {
    box-shadow: 0 0 0 3px rgba(255,255,255,0.6), 0 6px 20px rgba(0,0,0,0.25);
}

/* ---------- Cores ---------- */
.bc-tool-btn--highlight { background: linear-gradient(135deg, #FFD700, #FFA500); color: #fff; }
.bc-tool-btn--highlight.active { background: linear-gradient(135deg, #FFA500, #FF8C00); }
.bc-tool-btn--notes { background: linear-gradient(135deg, #4A90D9, #1a6cbf); color: #fff; }
.bc-tool-btn--notes.active { background: linear-gradient(135deg, #1a6cbf, #0d4f9e); }
.bc-tool-btn--search { background: linear-gradient(135deg, #2ecc71, #1aab58); color: #fff; }
.bc-tool-btn--search.active { background: linear-gradient(135deg, #1aab58, #0e8c44); }

/* ---------- Tooltip ---------- */
.bc-tool-btn::before {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 10px);
    right: auto;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(20,20,30,0.88);
    color: #fff;
    font-size: 12px;
    white-space: nowrap;
    padding: 5px 10px;
    border-radius: 6px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    font-family: inherit;
    z-index: 1;
}
.bc-tool-btn:hover::before { opacity: 1; }

/* ---------- SVG ícones ---------- */
.bc-tool-btn svg {
    width: 22px;
    height: 22px;
    display: block;
    flex-shrink: 0;
    pointer-events: none;
    overflow: visible;
}
.bc-tool-btn--highlight svg { fill: currentColor; stroke: none; }
.bc-tool-btn--notes svg,
.bc-tool-btn--search svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ============================================================
   MARCA TEXTO
   ============================================================ */
mark.bc-highlight {
    background: linear-gradient(120deg, #ffe066 0%, #ffd700 100%);
    color: inherit;
    border-radius: 3px;
    padding: 0 2px;
    cursor: pointer;
    position: relative;
    transition: background 0.2s;
}
mark.bc-highlight:hover {
    background: linear-gradient(120deg, #ffb347 0%, #ff8c00 100%);
}
.bc-highlight-popover {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.13);
    padding: 6px 8px;
    display: flex;
    gap: 6px;
    z-index: 10000;
    white-space: nowrap;
}
.bc-highlight-popover button {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
}
.bc-popover-remove { background: #ffe0e0; color: #c0392b; }
.bc-popover-remove:hover { background: #fcc; }

/* ============================================================
   BLOCO DE NOTAS — WIDGET FLUTUANTE ARRASTÁVEL
   ============================================================ */
.bc-notes-widget {
    position: fixed;
    top: 120px;
    left: 80px;
    width: 320px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.10);
    z-index: 10001;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1.5px solid #d0e4f7;
    /* Animação de entrada */
    animation: bcNotesAppear 0.22s cubic-bezier(0.4,0,0.2,1);
}
@keyframes bcNotesAppear {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.bc-notes-widget.visible { display: flex; }

/* Barra de arrastar (drag handle) */
.bc-notes-drag {
    background: linear-gradient(135deg, #4A90D9, #1a6cbf);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: grab;
    user-select: none;
    border-radius: 12px 12px 0 0;
}
.bc-notes-drag:active { cursor: grabbing; }

.bc-notes-drag-title {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}
.bc-notes-drag-title svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

/* Ícone de 6 pontos indicando que é arrastável */
.bc-notes-drag-handle {
    display: flex;
    flex-direction: column;
    gap: 3px;
    opacity: 0.6;
    margin-right: 4px;
}
.bc-notes-drag-handle span {
    display: flex;
    gap: 3px;
}
.bc-notes-drag-handle span::before,
.bc-notes-drag-handle span::after {
    content: '';
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
    display: block;
}

.bc-notes-close {
    background: rgba(255,255,255,0.18);
    border: none;
    color: #fff;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    line-height: 1;
    transition: background 0.2s;
    flex-shrink: 0;
}
.bc-notes-close:hover { background: rgba(255,255,255,0.35); }

/* Área de texto */
.bc-notes-body {
    padding: 12px 14px 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.bc-notes-textarea {
    width: 100%;
    min-height: 160px;
    resize: both;        /* usuário pode redimensionar */
    border: 1px solid #dde3ea;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13.5px;
    line-height: 1.6;
    color: #333;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.bc-notes-textarea:focus { border-color: #4A90D9; }

/* Rodapé com botão Salvar */
.bc-notes-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px 12px;
    gap: 8px;
}
.bc-notes-save {
    background: linear-gradient(135deg, #4A90D9, #1a6cbf);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: opacity 0.2s, transform 0.15s;
}
.bc-notes-save:hover { opacity: 0.9; transform: translateY(-1px); }
.bc-notes-save:active { transform: translateY(0); }

.bc-notes-status {
    font-size: 11px;
    color: #888;
    flex: 1;
    text-align: right;
}
.bc-notes-status.saved  { color: #2ecc71; }
.bc-notes-status.saving { color: #f39c12; }

/* ============================================================
   LUPA DE PESQUISA
   ============================================================ */
.bc-search-bar {
    position: fixed;
    top: -70px;
    left: 50%;
    transform: translateX(-50%);
    width: min(600px, 90vw);
    background: #fff;
    border-radius: 50px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.18);
    display: flex;
    align-items: center;
    padding: 6px 6px 6px 20px;
    gap: 8px;
    z-index: 10002;
    transition: top 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid #2ecc71;
}
.bc-search-bar.open { top: 20px; }
.bc-search-bar input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    color: #222;
    background: transparent;
    font-family: inherit;
}
.bc-search-bar input::placeholder { color: #aaa; }
.bc-search-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #888;
    font-size: 13px;
    white-space: nowrap;
}
.bc-search-nav button {
    background: rgba(46,204,113,0.12);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1aab58;
    font-size: 16px;
    transition: background 0.2s;
}
.bc-search-nav button:hover { background: rgba(46,204,113,0.25); }
.bc-search-close {
    background: #f0f0f0;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 18px;
    transition: background 0.2s;
    flex-shrink: 0;
}
.bc-search-close:hover { background: #e0e0e0; }

mark.bc-search-match {
    background: rgba(46,204,113,0.35);
    color: inherit;
    border-radius: 2px;
    padding: 0 1px;
}
mark.bc-search-match.current {
    background: #2ecc71;
    color: #fff;
}

/* ============================================================
   RESPONSIVIDADE
   ============================================================ */
@media (max-width: 768px) {
    .bc-floating-tools {
        left: 12px;
        right: auto;
        bottom: 110px;
        top: auto;
        transform: none;
    }
    .bc-tool-btn { width: 44px; height: 44px; }
    .bc-tool-btn::before { display: none; }

    .bc-notes-widget {
        width: calc(100vw - 24px);
        left: 12px !important;
        top: 60px !important;
    }
    .bc-search-bar { width: 92vw; padding: 5px 5px 5px 16px; }
}