/* ==========================================================================
   VOCAB-TOOLTIP.CSS — Từ Vựng Tàng Hình & Smart Tooltip
   ========================================================================== */

/* Giao diện Từ Vựng tĩnh — Không thay đổi độ rộng hay border để tránh giật khung */
.vocab-word {
    display: inline; position: relative; cursor: help; text-decoration: none !important;
    transition: color 0.2s ease, background 0.2s ease;
    padding: 0 2px; margin: 0; border-radius: 4px;
}
body:not(.vocab-disabled) .vocab-word { color: var(--vocab-highlight); }
body:not(.vocab-disabled) .vocab-word:hover { background-color: #fee2e2; }
body.vocab-disabled .vocab-word { color: inherit !important; cursor: auto !important; pointer-events: none !important; background: transparent !important; }

/* Popup thông minh */
#smart-vocab-tooltip {
    position: absolute; display: none; background: #ffffff; border: 1px solid #e2e8f0;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.15); padding: 16px 20px; border-radius: 12px;
    z-index: 9999; min-width: 220px; max-width: 300px; color: #0f172a; pointer-events: auto;
}
#smart-vocab-tooltip::before {
    content: ''; position: absolute; top: -6px; left: 24px; width: 12px; height: 12px;
    background: #ffffff; border-top: 1px solid #e2e8f0; border-left: 1px solid #e2e8f0;
    transform: rotate(45deg);
}

.tooltip-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; border-bottom: 1px dashed #e2e8f0; padding-bottom: 10px; }
.tooltip-base { font-size: 1.3em; font-weight: 800; color: var(--vocab-highlight); letter-spacing: 0.5px; }
.save-vocab-btn { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; cursor: pointer; padding: 6px 10px; transition: 0.2s; font-size: 1.1em; display: inline-flex; align-items: center; justify-content: center; }
.save-vocab-btn:hover { background: #e2e8f0; transform: translateY(-2px); box-shadow: 0 2px 5px rgba(0,0,0,0.05); }

/* Flat icon button (Lưu / Phát âm trong tooltip) */
.flat-icon-btn {
    background: transparent; border: none; cursor: pointer; padding: 6px;
    border-radius: 6px; color: #64748b; display: inline-flex; align-items: center;
    justify-content: center; transition: 0.2s;
}
.flat-icon-btn:hover { background: #f1f5f9; color: #0f172a; }
.flat-icon-btn.saved { color: #3b82f6; }

/* Vocab toggle switch */
.vocab-toggle-container { position: fixed; top: 15px; left: 15px; z-index: 99999; background: #fff; padding: 8px 12px; border-radius: 8px; border: 1px solid #cbd5e0; font-weight: bold; color: #4a5568; font-size: 0.85em; display: flex; align-items: center; gap: 8px; transition: all 0.3s ease; }
.switch { position: relative; display: inline-block; width: 36px; height: 20px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #cbd5e0; transition: .3s; border-radius: 20px; }
.slider:before { position: absolute; content: ""; height: 14px; width: 14px; left: 3px; bottom: 3px; background-color: white; transition: .3s; border-radius: 50%; }
input:checked + .slider { background-color: #48bb78; }
input:checked + .slider:before { transform: translateX(16px); }
