/* Note8 TTS — front-end styles
 *
 * Philosophy: blend with core's .ns-btn aesthetic so the Speaker toggle
 * and Voice dropdown look native to the existing button row. The only
 * unique element is the pulsing animation while audio is playing.
 */

.n8tts-controls {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
}

/* Speaker toggle button */
.n8tts-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f6f7f7;
    border: 1px solid #c3c4c7;
    color: #1d2327;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.n8tts-toggle:hover {
    background: #ececee;
    border-color: #8c8f94;
}

.n8tts-toggle .n8tts-icon {
    font-size: 1.05em;
    line-height: 1;
}

.n8tts-toggle .n8tts-label {
    font-weight: 500;
    white-space: nowrap;
}

/* ON state */
.n8tts-toggle.n8tts-on {
    background: #2271b1;
    border-color: #135e96;
    color: #fff;
}

.n8tts-toggle.n8tts-on:hover {
    background: #135e96;
    border-color: #0a4b78;
}

/* Speaking state — pulsing aura around the icon */
.n8tts-toggle.n8tts-speaking {
    box-shadow: 0 0 0 0 rgba(34, 113, 177, 0.55);
    animation: n8tts-pulse 1.4s ease-out infinite;
}

@keyframes n8tts-pulse {
    0%   { box-shadow: 0 0 0 0   rgba(34, 113, 177, 0.55); }
    70%  { box-shadow: 0 0 0 10px rgba(34, 113, 177, 0);   }
    100% { box-shadow: 0 0 0 0   rgba(34, 113, 177, 0);    }
}

/* Voice dropdown */
.n8tts-voice {
    cursor: pointer;
    background: #f6f7f7;
    border: 1px solid #c3c4c7;
    color: #1d2327;
    padding: 4px 8px;
    font-size: 0.95em;
    max-width: 160px;
}

.n8tts-voice:hover,
.n8tts-voice:focus {
    border-color: #2271b1;
    outline: none;
}

/* Respect users who disable motion */
@media (prefers-reduced-motion: reduce) {
    .n8tts-toggle.n8tts-speaking {
        animation: none;
        box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.55);
    }
}
