/* ==========================================================================
   Text To Speech (TTS) - Selection-Only Reader Styles
   ========================================================================== */

:root {
    --tts-primary: #00838f;
    --tts-primary-hover: #006978;
    --tts-accent: #ff9800;
    --tts-dark: #1e293b;
    --tts-text: #ffffff;
}

/* Floating Tooltip Button above selected text */
.tts-selection-tooltip {
    position: absolute;
    z-index: 100000;
    display: none;
    align-items: center;
    gap: 8px;
    background: var(--tts-dark);
    color: var(--tts-text);
    padding: 6px 12px;
    border-radius: 30px;
    font-family: 'Tajawal', sans-serif;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.15);
    direction: rtl;
    transform: translate(-50%, -100%);
    margin-top: -10px;
    user-select: none;
    animation: ttsFadeInUp 0.2s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
    cursor: default;
}

@keyframes ttsFadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, -85%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -100%) scale(1);
    }
}

/* Action button inside selection tooltip */
.tts-btn-speak {
    background: linear-gradient(135deg, #00838f, #00acc1);
    color: #ffffff;
    border: none;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    outline: none;
}

.tts-btn-speak:hover {
    background: linear-gradient(135deg, #00acc1, #00838f);
    transform: scale(1.04);
}

.tts-btn-stop {
    background: #e53935;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.tts-btn-stop:hover {
    background: #c62828;
    transform: scale(1.1);
}

/* Sound wave animation while reading selection */
.tts-waves-mini {
    display: none;
    align-items: center;
    gap: 2px;
    height: 12px;
}

.tts-waves-mini span {
    width: 2.5px;
    height: 100%;
    background-color: #4dd0e1;
    border-radius: 2px;
    animation: waveMini 0.8s ease-in-out infinite alternate;
}

.tts-waves-mini span:nth-child(2) { animation-delay: 0.2s; }
.tts-waves-mini span:nth-child(3) { animation-delay: 0.4s; }

@keyframes waveMini {
    0% { height: 3px; }
    100% { height: 12px; }
}

/* Arrow indicator at bottom of tooltip */
.tts-selection-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 6px 0 6px;
    border-style: solid;
    border-color: var(--tts-dark) transparent transparent transparent;
}
