/**
 * WHAT: Styles for the DW Text Tools floating selection toolbar and feedback form.
 * WHY:  Extracted from dwbooks.css; now shared across all readers (books, bible).
 * DEPENDS ON: dwtexttools.js (creates .dwtexttools-toolbar in the DOM)
 */

/* --- Floating toolbar container --- */
.dwtexttools-toolbar {
    position: absolute;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #333;
    color: #fff;
    border-radius: 4px;
    padding: 0.4rem 0.75rem;
    font-size: 0.85em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

.dwtexttools-toolbar button {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: inherit;
    padding: 0;
}

.dwtexttools-toolbar button:hover {
    text-decoration: underline;
}

.dwtexttools-sep {
    color: #888;
}

/* --- Feedback form (replaces toolbar buttons when "Report error" is clicked) --- */
.dwtexttools-feedback-form {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    width: 100%;
    white-space: normal;
}

.dwtexttools-feedback-preview {
    font-size: 0.8em;
    color: #aaa;
    font-style: italic;
    line-height: 1.3;
    max-height: 2.6em;
    overflow: hidden;
}

.dwtexttools-feedback-message {
    width: 100%;
    min-height: 3em;
    padding: 0.35rem 0.5rem;
    font-size: 0.9em;
    font-family: inherit;
    border: 1px solid #555;
    border-radius: 3px;
    background: #444;
    color: #fff;
    resize: vertical;
    box-sizing: border-box;
}

.dwtexttools-feedback-message::placeholder {
    color: #999;
}

.dwtexttools-feedback-message.dwtexttools-feedback-error {
    border-color: #e57373;
}

/* Honeypot — invisible to real users */
.dwtexttools-feedback-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    tab-index: -1;
}

.dwtexttools-feedback-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.dwtexttools-feedback-send,
.dwtexttools-feedback-cancel {
    font-size: 0.85em;
    padding: 0.25rem 0.6rem;
    border-radius: 3px;
    cursor: pointer;
    border: none;
}

.dwtexttools-feedback-send {
    background: #5b9bd5;
    color: #fff;
}

.dwtexttools-feedback-send:hover {
    background: #4a8bc4;
    text-decoration: none;
}

.dwtexttools-feedback-send:disabled {
    opacity: 0.6;
    cursor: default;
}

.dwtexttools-feedback-cancel {
    background: transparent;
    color: #aaa;
    border: 1px solid #555;
}

.dwtexttools-feedback-cancel:hover {
    color: #fff;
    border-color: #888;
    text-decoration: none;
}

/* "Thank you!" flash message after successful submission */
.dwtexttools-feedback-thanks {
    padding: 0.2rem 0;
    font-size: 0.9em;
    color: #81c784;
}

/* --- Phrase highlight (books context: #sel= URL fragment on page load) ---
   Targets the Latin text element inside the phrase, not the whole phrase wrapper. */
.dwbooks-phrase-highlight .dwbooks-la {
    background: rgba(253, 224, 71, 0.4);
    border-radius: 2px;
    padding: 0 1px;
}
